{
  "openapi": "3.1.0",
  "info": {
    "title": "Lurk API",
    "version": "1.0.0",
    "description": "Events in, rules decide, units change, receipts out."
  },
  "servers": [
    {
      "url": "https://api.getlurk.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A project key (Developers → API keys). Keep it on your server, not in an app."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_json",
                  "invalid_key",
                  "forbidden",
                  "approval_required",
                  "not_found",
                  "idempotency_conflict",
                  "conflict",
                  "unblock_clock_reversed",
                  "insufficient_balance",
                  "reference_used",
                  "validation_failed",
                  "rate_limited",
                  "internal",
                  "unavailable"
                ]
              },
              "message": {
                "type": "string"
              },
              "param": {
                "type": "string"
              },
              "next_step": {
                "type": "string",
                "description": "What to do about this kind of error, in one sentence. Always sent by current servers"
              },
              "request_id": {
                "type": "string"
              },
              "doc_url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "status",
              "code",
              "message",
              "request_id",
              "doc_url"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "SendEventOutput": {
        "type": "object",
        "properties": {
          "activity": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receipt envelope, or null when nothing changed"
          },
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Your own identifier for the person: an email, a user ID or a session ID. 1 to 256 characters"
          },
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "receipts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Receipt"
            },
            "description": "What changed: one for each unit a rule changed, with the balance after. Empty when nothing changed"
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Skipped"
            },
            "description": "Rules that heard the event and did nothing, and why. Not an error"
          },
          "held": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Held"
            },
            "default": [],
            "description": "Changes that wait for a person to give or refuse them; none have been made"
          },
          "alias": {
            "type": "object",
            "properties": {
              "made": {
                "type": "boolean",
                "description": "Whether the identifier is this person's alias now (true also when it already was)"
              },
              "reason": {
                "type": "string",
                "description": "Why it was not made, as `users.alias` would refuse it. Only when `made` is false"
              }
            },
            "required": [
              "made"
            ],
            "description": "Only when the event carried `alias`: what became of it. A refused alias never refuses the event"
          }
        },
        "required": [
          "activity",
          "user",
          "event",
          "receipts",
          "skipped"
        ],
        "examples": [
          {
            "activity": "act_01m6jxa1q0eq98wwe0n7sr9cb0",
            "user": "ana@example.com",
            "event": "order.paid",
            "receipts": [
              {
                "by": "rule:order-points",
                "unit": "points",
                "change": 49,
                "balance": 169
              }
            ],
            "skipped": [],
            "held": []
          }
        ]
      },
      "Receipt": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string",
            "description": "Who acted: \"rule:<key>\", \"member:<id>\", \"user:<id>\""
          },
          "via": {
            "type": "string",
            "enum": [
              "api",
              "agent",
              "lurky",
              "dashboard",
              "system",
              "chat",
              "device"
            ],
            "description": "How the change arrived: `api`, `agent`, `lurky`, `dashboard`, `system` or `device` (where device sign-in is switched on); `chat` is not available yet. Left out when a project key sent the event"
          },
          "agent": {
            "type": "string",
            "description": "The agent's name when an agent or Lurky acted; left out otherwise"
          },
          "unit": {
            "type": "string",
            "description": "The key of the unit that changed"
          },
          "change": {
            "type": "integer",
            "description": "Positive for giving, negative for taking"
          },
          "balance": {
            "type": "integer",
            "description": "The person's balance of this unit after the change"
          }
        },
        "required": [
          "by",
          "unit",
          "change",
          "balance"
        ]
      },
      "Skipped": {
        "type": "object",
        "properties": {
          "by": {
            "type": "string",
            "description": "The rule: \"rule:<key>\""
          },
          "reason": {
            "type": "string",
            "enum": [
              "condition_failed",
              "condition_unknown",
              "limit_reached",
              "insufficient_balance",
              "unit_setting",
              "hold_refused",
              "budget_reached",
              "supply_gone"
            ],
            "description": "condition_unknown: the holding could not be confirmed, so the rule does not fire and is not retried. unit_setting: a unit's own setting stopped it (it cannot go up or down, or the change would pass its cap). hold_refused: a person refused the change a rule had held. budget_reached: the rule has given all its budget for this window. supply_gone: a unit with a limited supply has none left for the change"
          },
          "check": {
            "type": "string",
            "description": "The check that stopped it: limit, budget, audience, unit…"
          }
        },
        "required": [
          "by",
          "reason",
          "check"
        ]
      },
      "Held": {
        "type": "object",
        "properties": {
          "hold": {
            "type": "string",
            "description": "The hold_… ID"
          },
          "by": {
            "type": "string",
            "description": "The rule: \"rule:<key>\""
          },
          "reason": {
            "type": "string",
            "description": "Why it waits: 900 beans is over 500, so a person decides"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "unit": {
                  "type": "string",
                  "description": "The key of the unit that would change"
                },
                "change": {
                  "type": "integer",
                  "description": "Positive for giving, negative for taking"
                }
              },
              "required": [
                "unit",
                "change"
              ]
            },
            "description": "What would change if a person gives it"
          }
        },
        "required": [
          "hold",
          "by",
          "reason",
          "changes"
        ]
      },
      "SendEventInput": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event name such as checkin.scanned. The onchain. and web. prefixes are reserved for Lurk’s integrations and cannot be sent here"
          },
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Your own identifier for the person, 1 to 256 characters. Lurk makes the person the first time it sees it"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 1024
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                },
                {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1024
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "maxItems": 50
                }
              ]
            },
            "description": "Flat facts about the event, up to 50. Each name is 1 to 64 characters; each value is a string (up to 1,024 characters), a number, true or false, null, or a list of up to 50 of those"
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Makes a retry safe: the same key with the same request returns the first answer and changes nothing. 1 to 255 characters, no control characters. Remembered for 30 days"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened, as an ISO 8601 time with an offset. Defaults to now. It may be in the past, so you can import history, but not more than 5 minutes ahead of Lurk's clock"
          },
          "profile": {
            "type": "object",
            "properties": {
              "email": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 254,
                "format": "email",
                "description": "Lurk keeps it lowercase. Null clears it"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^(?![\\s\\S]*<[A-Za-z!/?])[^\\u0000-\\u001f\\u007f-\\u009f‪-‮⁦-⁩]*$",
                "description": "Plain text, 1 to 100 characters. Null clears it"
              },
              "avatar_url": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2048,
                "pattern": "^https:\\/\\/[^/?#@\\s]+(?:[/?#]\\S*)?$",
                "description": "An https:// link, at most 2048 characters. Null clears it"
              },
              "handles": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/HandleChange"
                },
                "description": "By platform: an entry sets that platform's handle, null removes it, and platforms left out are kept. A person has handles on at most 10 platforms"
              },
              "locale": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 35,
                "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8}){0,4}$",
                "description": "A BCP 47 tag: en, en-GB. Null clears it"
              }
            },
            "additionalProperties": false,
            "description": "Changes to the person's profile, applied with the event in the same transaction, once (a replay of the same `idempotency_key` applies nothing). Rules do not read it, and it is not kept with the event"
          },
          "alias": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Another identifier this person was known by, such as the anonymous visitor ID they had before this sign-in: their history also reads its events from now on. Nothing moves, and the alias can be removed (`DELETE /v1/users/{id}/aliases`). Made with the event, once. A refused alias is not made and the event is recorded all the same: `alias` in the answer says which, and why"
          }
        },
        "required": [
          "event",
          "user",
          "idempotency_key"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "event": "order.paid",
            "user": "ana@example.com",
            "properties": {
              "order_id": "ord_1042",
              "total_cents": 4900,
              "currency": "USD"
            },
            "idempotency_key": "order-1042-paid"
          }
        ]
      },
      "HandleChange": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^@?[A-Za-z0-9_][A-Za-z0-9_.@-]{0,99}$",
            "description": "The username, with or without the @ (Lurk drops it)"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
            "description": "The platform's own ID for the account, when you know it (X's numeric user ID). Left out is null: an entry replaces what Lurk kept for that platform"
          }
        },
        "required": [
          "handle"
        ],
        "additionalProperties": false
      },
      "EventsCatalog": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogEvent"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "examples": [
          {
            "data": [
              {
                "event": "order.paid",
                "kind": "own",
                "title": null,
                "description": null,
                "platforms": [],
                "count_30d": 2,
                "last_seen_at": "2026-11-04T09:12:44.000Z",
                "properties": [
                  "currency",
                  "order_id",
                  "total_cents"
                ],
                "property_types": {
                  "currency": "string",
                  "order_id": "string",
                  "total_cents": "number"
                },
                "value_sources": {},
                "known_values": {},
                "rules": [
                  {
                    "id": "rule_01m2z44880ev18z457tkgkpp00",
                    "key": "order-points",
                    "name": "Points for orders",
                    "status": "live"
                  }
                ]
              }
            ],
            "has_more": false,
            "next_cursor": null
          }
        ]
      },
      "CatalogEvent": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "kind": {
            "type": "string",
            "enum": [
              "own",
              "lurk"
            ],
            "description": "`own`: a name the project sent or a rule listens for. `lurk`: an event Lurk defines for chat (chat.*), which is not available yet; it is listed before anything is heard"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Lurk event in plain words, such as `Someone checks in`; null for an event of the project's own"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "When a Lurk event happens and how often it can; null for an event of the project's own"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "discord",
                "slack",
                "telegram"
              ]
            },
            "description": "Not available yet. The chat platforms that can supply a Lurk event; empty for an event of the project's own"
          },
          "count_30d": {
            "type": "integer",
            "minimum": 0,
            "description": "How many arrived in the last 30 days"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The newest one, within the last 30 days; null if none arrived"
          },
          "properties": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The property names of the newest one. Names only: values are in `known_values`, and only where a person asked"
          },
          "property_types": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CatalogPropertyType"
            },
            "description": "What each property holds, by name: read from the newest event, or fixed for a Lurk event. Never values"
          },
          "value_sources": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PropertyValueSource"
            },
            "description": "Where each property's possible values come from, by property name, for the properties that have a known set. Only the chat events Lurk defines (not available yet) have one; the values of an event of the project's own are in `known_values`, and only when a person asked for them (they can be personal data). A hint: any value may still be typed"
          },
          "known_values": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/KnownValues"
            },
            "description": "The values Lurk remembers, by property name, only for the properties a person switched \"remember values\" on for (`known_values.enable`): at most 20 each, as events carried them. Empty for every other property and every other event: values are never listed unless a person asked. A hint: any value may still be typed"
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The rule_… ID"
                },
                "key": {
                  "type": "string",
                  "description": "The rule's key"
                },
                "name": {
                  "type": "string",
                  "description": "The rule's name"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "live",
                    "paused"
                  ],
                  "description": "`draft`, `live` or `paused`"
                }
              },
              "required": [
                "id",
                "key",
                "name",
                "status"
              ]
            },
            "description": "The rules listening for it"
          }
        },
        "required": [
          "event",
          "kind",
          "title",
          "description",
          "platforms",
          "count_30d",
          "last_seen_at",
          "properties",
          "property_types",
          "value_sources",
          "known_values",
          "rules"
        ]
      },
      "CatalogPropertyType": {
        "type": "string",
        "enum": [
          "string",
          "number",
          "boolean",
          "list",
          "null"
        ]
      },
      "PropertyValueSource": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "enum"
                ],
                "description": "A fixed list of values"
              },
              "values": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "string",
                      "description": "What the event carries"
                    },
                    "label": {
                      "type": "string",
                      "description": "What people read"
                    },
                    "installed": {
                      "type": "boolean",
                      "description": "Chat platforms only (not available yet): whether this project has a community there"
                    }
                  },
                  "required": [
                    "value",
                    "label"
                  ]
                },
                "description": "The values the property can hold"
              }
            },
            "required": [
              "kind",
              "values"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "community"
                ],
                "description": "Not available yet. The project's installed chat communities, by name"
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "channel"
                ],
                "description": "Not available yet. A channel of a chat community, by the platform's own ID"
              },
              "community_property": {
                "type": "string",
                "description": "The property of the same event that holds the community the channel is in"
              }
            },
            "required": [
              "kind",
              "community_property"
            ]
          }
        ]
      },
      "KnownValues": {
        "type": "object",
        "properties": {
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KnownValue"
            },
            "description": "At most 20, in alphabetical order"
          }
        },
        "required": [
          "values"
        ]
      },
      "KnownValue": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "The value as an event carried it: `pro`, `12`, `true`"
          },
          "type": {
            "$ref": "#/components/schemas/KnownValueType"
          }
        },
        "required": [
          "value",
          "type"
        ]
      },
      "KnownValueType": {
        "type": "string",
        "enum": [
          "text",
          "number",
          "yes_no"
        ],
        "description": "`text`, a number, or `yes_no` (a true or false flag): a rule compares it as that type"
      },
      "KnownValuesList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KnownValuesSetting"
            },
            "description": "One for each property a person switched on, including those that turned themselves off"
          },
          "cap": {
            "type": "integer",
            "description": "The most values kept for a property"
          }
        },
        "required": [
          "data",
          "cap"
        ]
      },
      "KnownValuesSetting": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "`event/property`: what the audit log names"
          },
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "property": {
            "type": "string",
            "description": "The property's name, as events carry it"
          },
          "state": {
            "type": "string",
            "enum": [
              "on",
              "stopped"
            ],
            "description": "`on`: Lurk keeps its values. `stopped`: it turned itself off, see `stopped`"
          },
          "values": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KnownValue"
            },
            "description": "Empty unless `on`"
          },
          "stopped": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reason": {
                "$ref": "#/components/schemas/KnownValuesStopReason"
              },
              "message": {
                "type": "string",
                "description": "The reason in a sentence a person can act on"
              }
            },
            "required": [
              "reason",
              "message"
            ],
            "description": "Why it turned itself off, in a sentence; null while `on`"
          },
          "enabled_by": {
            "type": "string",
            "description": "Who turned it on, as the audit log names them"
          },
          "enabled_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was switched on: ISO 8601, UTC"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "event",
          "property",
          "state",
          "values",
          "stopped",
          "enabled_by",
          "enabled_at",
          "updated_at"
        ]
      },
      "KnownValuesStopReason": {
        "type": "string",
        "enum": [
          "too_many",
          "too_long",
          "personal"
        ],
        "description": "Why a property turned itself off: `too_many` (more than 20 different values), `too_long` (a value over 64 characters) or `personal` (a value looked like an email address, phone number, link, long code or free text)"
      },
      "ActivityList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "examples": [
          {
            "data": [
              {
                "id": "act_01m6jxa1q0eq98wwe0n7sr9cb0",
                "at": "2026-11-04T09:12:44.000Z",
                "user": {
                  "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
                  "external_id": "ana@example.com"
                },
                "by": "rule:order-points",
                "via": "api",
                "agent": null,
                "event": {
                  "id": "evt_01m6jxa1q0f6z881kx3gx5hwg0",
                  "name": "order.paid"
                },
                "lines": [
                  {
                    "unit": "points",
                    "change": 49,
                    "balance": 169,
                    "rule": "order-points"
                  }
                ],
                "reverses": null,
                "reversed_by": null,
                "note": null,
                "cause": null,
                "reference": null,
                "transfer": null
              },
              {
                "id": "act_01m647c5srfj28m47pwdwjpq80",
                "at": "2026-10-29T16:20:03.000Z",
                "user": {
                  "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
                  "external_id": "ana@example.com"
                },
                "by": "rule:order-points",
                "via": "api",
                "agent": null,
                "event": {
                  "id": "evt_01m647c5srfmx8bt0gfeac5xgg",
                  "name": "order.paid"
                },
                "lines": [
                  {
                    "unit": "points",
                    "change": 120,
                    "balance": 120,
                    "rule": "order-points"
                  }
                ],
                "reverses": null,
                "reversed_by": null,
                "note": null,
                "cause": null,
                "reference": null,
                "transfer": null
              }
            ],
            "has_more": false,
            "next_cursor": null
          }
        ]
      },
      "ActivityItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The act_… ID"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was made: ISO 8601, UTC"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person: an email, a user ID"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it happened to"
          },
          "by": {
            "type": "string",
            "description": "Who acted: \"rule:<key>\" for rules"
          },
          "via": {
            "type": "string",
            "enum": [
              "api",
              "agent",
              "lurky",
              "dashboard",
              "system",
              "chat",
              "device"
            ],
            "description": "How the change arrived: `api` (a project key), `agent`, `lurky`, `dashboard` (a signed-in member) or `system` (Lurk itself, such as an expiry or a schedule), `device` (a person signing in, where device sign-in is switched on) or `chat` (not available yet)"
          },
          "agent": {
            "type": [
              "string",
              "null"
            ],
            "description": "The agent's name when an agent or Lurky acted"
          },
          "event": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event it came from; null for a change made by hand or by a schedule"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityLine"
            },
            "description": "One for each unit the receipt changed"
          },
          "reverses": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receipt this one undoes"
          },
          "reversed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receipt that undid this one"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the person wrote when they gave by hand, or the reason on a spend; null otherwise"
          },
          "cause": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "spend",
              "use",
              "send",
              "receive",
              null
            ],
            "description": "`spend` for value a brand took in exchange for something, `use` for something a person redeemed, `send` and `receive` for the two sides of one unit moving between people; null for a rule's change, a give or an undo"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand's own redemption or order ID on a spend; null otherwise"
          },
          "transfer": {
            "type": [
              "string",
              "null"
            ],
            "description": "On the two receipts of one `units.send`: the same ID on both, the sender's receipt ID. Null otherwise"
          }
        },
        "required": [
          "id",
          "at",
          "user",
          "by",
          "via",
          "agent",
          "event",
          "lines",
          "reverses",
          "reversed_by",
          "note",
          "cause",
          "reference",
          "transfer"
        ],
        "description": "One thing that happened to one person, with every unit it changed. Never edited"
      },
      "ActivityLine": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The key of the unit that changed"
          },
          "change": {
            "type": "integer",
            "description": "Positive for giving, negative for taking"
          },
          "balance": {
            "type": "integer",
            "description": "The person's balance of this unit after the change"
          },
          "rule": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key of the rule that made this change"
          }
        },
        "required": [
          "unit",
          "change",
          "balance",
          "rule"
        ]
      },
      "ExplainActivityOutput": {
        "type": "object",
        "properties": {
          "activity": {
            "$ref": "#/components/schemas/ActivityItem"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityCheck"
            },
            "description": "From the trace stored with the receipt, never reconstructed. Empty for receipts from before traces were stored"
          },
          "traced": {
            "type": "boolean",
            "description": "Whether this receipt has a stored trace"
          }
        },
        "required": [
          "activity",
          "checks",
          "traced"
        ],
        "examples": [
          {
            "activity": {
              "id": "act_01m6jxa1q0eq98wwe0n7sr9cb0",
              "at": "2026-11-04T09:12:44.000Z",
              "user": {
                "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
                "external_id": "ana@example.com"
              },
              "by": "rule:order-points",
              "via": "api",
              "agent": null,
              "event": {
                "id": "evt_01m6jxa1q0f6z881kx3gx5hwg0",
                "name": "order.paid"
              },
              "lines": [
                {
                  "unit": "points",
                  "change": 49,
                  "balance": 169,
                  "rule": "order-points"
                }
              ],
              "reverses": null,
              "reversed_by": null,
              "note": null,
              "cause": null,
              "reference": null,
              "transfer": null
            },
            "checks": [
              {
                "rule": "order-points",
                "check": "when",
                "ok": true,
                "detail": "heard order.paid"
              },
              {
                "rule": "order-points",
                "check": "property",
                "ok": true,
                "detail": "currency = \"USD\""
              },
              {
                "rule": "order-points",
                "check": "limit",
                "ok": true,
                "detail": "0 of 5 per day used"
              },
              {
                "rule": "order-points",
                "check": "amount",
                "ok": true,
                "detail": "total_cents 4900 per 100 is 49"
              }
            ],
            "traced": true
          }
        ]
      },
      "ActivityCheck": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "string",
            "description": "The key of the rule that made the check"
          },
          "check": {
            "type": "string",
            "enum": [
              "when",
              "audience",
              "time",
              "property",
              "balance",
              "source",
              "limit",
              "action",
              "unit",
              "hold",
              "budget",
              "amount",
              "streak",
              "modifier",
              "effect",
              "held_for"
            ],
            "description": "What was checked, such as `limit`, `budget`, `audience` or `balance`"
          },
          "ok": {
            "type": "boolean",
            "description": "Whether the check passed"
          },
          "detail": {
            "type": "string",
            "description": "The check in words: 08:12 is between 07:00 and 10:00"
          }
        },
        "required": [
          "rule",
          "check",
          "ok",
          "detail"
        ]
      },
      "UserList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EndUser"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "How many people match, across every page. Only when `include=total` was sent"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "examples": [
          {
            "data": [
              {
                "id": "usr_01m6es2t9refr8kfbt871ed180",
                "external_id": "guest-4417",
                "created_at": "2026-11-02T18:41:55.000Z",
                "last_active_at": "2026-11-02T19:00:00.000Z",
                "status": "new",
                "balances": [
                  {
                    "unit": "points",
                    "amount": 40
                  }
                ],
                "profile": {
                  "email": null,
                  "name": null,
                  "avatar_url": null,
                  "handles": {},
                  "locale": null,
                  "updated_at": null
                },
                "blocked_at": null,
                "blocked_by": null,
                "erased_at": null
              },
              {
                "id": "usr_01m40d9ax0e2vrtmq9mk0z6t00",
                "external_id": "ben@example.com",
                "created_at": "2026-10-03T08:15:00.000Z",
                "last_active_at": "2026-10-30T12:00:00.000Z",
                "status": "returning",
                "balances": [
                  {
                    "unit": "points",
                    "amount": 85
                  }
                ],
                "profile": {
                  "email": "ben@example.com",
                  "name": "Ben Okafor",
                  "avatar_url": null,
                  "handles": {},
                  "locale": "en-GB",
                  "updated_at": "2026-10-03T08:15:02.000Z"
                },
                "blocked_at": null,
                "blocked_by": null,
                "erased_at": null
              },
              {
                "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
                "external_id": "ana@example.com",
                "created_at": "2026-09-12T14:03:10.000Z",
                "last_active_at": "2026-11-04T09:00:00.000Z",
                "status": "returning",
                "balances": [
                  {
                    "unit": "points",
                    "amount": 169
                  }
                ],
                "profile": {
                  "email": "ana@example.com",
                  "name": "Ana Lima",
                  "avatar_url": null,
                  "handles": {
                    "x": {
                      "handle": "ana_lima",
                      "account_id": null
                    }
                  },
                  "locale": "pt-BR",
                  "updated_at": "2026-10-29T16:20:05.000Z"
                },
                "blocked_at": null,
                "blocked_by": null,
                "erased_at": null
              }
            ],
            "has_more": false,
            "next_cursor": null,
            "total": 3
          }
        ]
      },
      "EndUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The usr_… ID"
          },
          "external_id": {
            "type": "string",
            "description": "The brand's own identifier: an email, a user ID"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When Lurk first heard of them"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When they last did something, to the hour. Null until an event arrives after Lurk started keeping it"
          },
          "status": {
            "$ref": "#/components/schemas/PersonStatus"
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitBalance"
            },
            "description": "What they hold now. Units at 0 are left out"
          },
          "profile": {
            "$ref": "#/components/schemas/PersonProfile"
          },
          "blocked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a member blocked this person; null when not blocked. Blocks apply where device sign-in is switched on."
          },
          "blocked_by": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^mem_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "description": "A member ID, starting with `mem_`."
              },
              "name": {
                "type": "string",
                "description": "The member's display name."
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The member who blocked them; null when not blocked. Blocks apply where device sign-in is switched on."
          },
          "erased_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Not available yet. When the person was erased. Null for everyone else. From then on external_id is a random value starting erased:, the brand's old identifier means a new person, and nothing can be added to this one"
          }
        },
        "required": [
          "id",
          "external_id",
          "created_at",
          "last_active_at",
          "status",
          "balances",
          "profile",
          "blocked_at",
          "blocked_by"
        ]
      },
      "PersonStatus": {
        "type": "string",
        "enum": [
          "new",
          "returning",
          "lapsing"
        ],
        "description": "new: first heard of within the project's `new_for_days`. lapsing: older than that, and nothing from them for `lapsing_after_days`. returning: everyone else"
      },
      "UnitBalance": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "How much of the unit they hold"
          }
        },
        "required": [
          "unit",
          "amount"
        ]
      },
      "PersonProfile": {
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 254,
            "format": "email",
            "description": "Their email, lowercase. Search finds it, whole"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^(?![\\s\\S]*<[A-Za-z!/?])[^\\u0000-\\u001f\\u007f-\\u009f‪-‮⁦-⁩]*$",
            "description": "The name to show them by: Ana Lima, or their X display name"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "pattern": "^https:\\/\\/[^/?#@\\s]+(?:[/?#]\\S*)?$",
            "description": "A picture of them, https only. Lurk never fetches it; the dashboard shows it"
          },
          "handles": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PersonHandle"
            },
            "description": "Their usernames, by platform: `{ x: { handle: 'ana', account_id: '12' } }`. Empty when none. Search finds each, whole, with or without the @"
          },
          "locale": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 35,
            "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8}){0,4}$",
            "description": "Their language, as a BCP 47 tag"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the profile last changed. Null when nothing was ever set"
          }
        },
        "required": [
          "email",
          "name",
          "avatar_url",
          "handles",
          "locale",
          "updated_at"
        ],
        "description": "What you told Lurk about them. Kept sealed; nothing in it is verified by Lurk, and rules do not read it. Every field is null (handles empty) until you set it"
      },
      "PersonHandle": {
        "type": "object",
        "properties": {
          "handle": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_][A-Za-z0-9_.@-]{0,99}$",
            "description": "The username, without the @, in the case you sent. Search ignores case"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
            "description": "The platform's own ID for the account, when you know it (X's numeric user ID). It stays the same when the username changes. Kept sealed and not searchable"
          }
        },
        "required": [
          "handle",
          "account_id"
        ]
      },
      "WebAcquisition": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "computed_at": {
            "type": "string",
            "format": "date-time",
            "description": "The real server read time in UTC."
          },
          "attribution_lookback_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "description": "The project’s current lookback in days for the last non-direct source."
          },
          "sites": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "site": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^wst_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "description": "A web site ID, starting with `wst_`."
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80,
                      "description": "The saved site name, including for a disabled site."
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ],
                  "additionalProperties": false,
                  "description": "The site with a surviving browser link for this person or a person merged into them."
                },
                "browsers": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991,
                  "description": "Exact distinct linked visitor records, including shared ones"
                },
                "first_touch": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "known"
                          ],
                          "description": "The stored source is known and belongs to this person."
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the consented source was first seen, not when it was linked"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "direct",
                            "organic_search",
                            "organic_social",
                            "organic_video",
                            "paid_search",
                            "paid_social",
                            "paid_video",
                            "display",
                            "email",
                            "sms",
                            "push",
                            "affiliate",
                            "referral",
                            "cross_network",
                            "unassigned"
                          ],
                          "description": "The stored source channel."
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 255,
                          "description": "The stored attribution source, or null when none was recorded."
                        },
                        "campaign": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 255,
                          "description": "The stored campaign, or null when none was recorded."
                        },
                        "landing_path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048,
                          "pattern": "^\\/(?!\\/)[^?#\\s]*$",
                          "description": "The stored landing path without a query or fragment."
                        }
                      },
                      "required": [
                        "state",
                        "at",
                        "channel",
                        "source",
                        "campaign",
                        "landing_path"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ],
                          "description": "No source can be shown for this touch."
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "shared",
                            "too_many_browsers"
                          ],
                          "description": "Why the first source is unavailable."
                        }
                      },
                      "required": [
                        "state",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "description": "The first source of the earliest linked browser on this site, with no lookback limit."
                },
                "last_non_direct_touch": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "known"
                          ],
                          "description": "The stored source is known and belongs to this person."
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the consented source was first seen, not when it was linked"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "organic_search",
                            "organic_social",
                            "organic_video",
                            "paid_search",
                            "paid_social",
                            "paid_video",
                            "display",
                            "email",
                            "sms",
                            "push",
                            "affiliate",
                            "referral",
                            "cross_network",
                            "unassigned"
                          ],
                          "description": "The stored non-direct source channel."
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 255,
                          "description": "The stored attribution source, or null when none was recorded."
                        },
                        "campaign": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 255,
                          "description": "The stored campaign, or null when none was recorded."
                        },
                        "landing_path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2048,
                          "pattern": "^\\/(?!\\/)[^?#\\s]*$",
                          "description": "The stored landing path without a query or fragment."
                        }
                      },
                      "required": [
                        "state",
                        "at",
                        "channel",
                        "source",
                        "campaign",
                        "landing_path"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "unavailable"
                          ],
                          "description": "No source can be shown for this touch."
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "no_recent_non_direct_touch",
                            "shared",
                            "too_many_browsers"
                          ],
                          "description": "Why the last non-direct source is unavailable."
                        }
                      },
                      "required": [
                        "state",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "description": "The latest eligible non-direct source on this site within the labelled lookback."
                }
              },
              "required": [
                "site",
                "browsers",
                "first_touch",
                "last_non_direct_touch"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "description": "Sites with surviving browser links, each once by site ID ascending, omitted in overflow."
          },
          "first_touch": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "unavailable"
                ],
                "description": "No source can be shown for this touch."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "too_many_browsers"
                ],
                "description": "The merged group exceeds the people or candidate link read limit."
              }
            },
            "required": [
              "state",
              "reason"
            ],
            "additionalProperties": false,
            "description": "The unavailable first source when the merged group exceeds a read limit."
          },
          "last_non_direct_touch": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "unavailable"
                ],
                "description": "No source can be shown for this touch."
              },
              "reason": {
                "type": "string",
                "enum": [
                  "too_many_browsers"
                ],
                "description": "The merged group exceeds the people or candidate link read limit."
              }
            },
            "required": [
              "state",
              "reason"
            ],
            "additionalProperties": false,
            "description": "The unavailable last non-direct source when the merged group exceeds a read limit."
          }
        },
        "required": [
          "computed_at",
          "attribution_lookback_days"
        ],
        "additionalProperties": false,
        "description": "The person’s web acquisition card, null with no surviving link, or absent when the caller cannot receive it or the API is older."
      },
      "EndUserDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The usr_… ID"
          },
          "external_id": {
            "type": "string",
            "description": "The brand's own identifier: an email, a user ID"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When Lurk first heard of them"
          },
          "last_active_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When they last did something, to the hour. Null until an event arrives after Lurk started keeping it"
          },
          "status": {
            "$ref": "#/components/schemas/PersonStatus"
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitBalance"
            },
            "description": "What they hold now. Units at 0 are left out"
          },
          "profile": {
            "$ref": "#/components/schemas/PersonProfile"
          },
          "blocked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a member blocked this person; null when not blocked. Blocks apply where device sign-in is switched on."
          },
          "blocked_by": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^mem_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "description": "A member ID, starting with `mem_`."
              },
              "name": {
                "type": "string",
                "description": "The member's display name."
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The member who blocked them; null when not blocked. Blocks apply where device sign-in is switched on."
          },
          "erased_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Not available yet. When the person was erased. Null for everyone else. From then on external_id is a random value starting erased:, the brand's old identifier means a new person, and nothing can be added to this one"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their own time zone, when they have one; else the project's applies"
          },
          "receipts": {
            "type": "integer",
            "minimum": 0,
            "description": "How many receipts they have"
          },
          "last_receipt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When their most recent receipt was made. Null when they have none"
          }
        },
        "required": [
          "id",
          "external_id",
          "created_at",
          "last_active_at",
          "status",
          "balances",
          "profile",
          "blocked_at",
          "blocked_by",
          "timezone",
          "receipts",
          "last_receipt_at"
        ],
        "examples": [
          {
            "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
            "external_id": "ana@example.com",
            "created_at": "2026-09-12T14:03:10.000Z",
            "last_active_at": "2026-11-04T09:00:00.000Z",
            "status": "returning",
            "balances": [
              {
                "unit": "points",
                "amount": 169
              }
            ],
            "profile": {
              "email": "ana@example.com",
              "name": "Ana Lima",
              "avatar_url": null,
              "handles": {
                "x": {
                  "handle": "ana_lima",
                  "account_id": null
                }
              },
              "locale": "pt-BR",
              "updated_at": "2026-10-29T16:20:05.000Z"
            },
            "blocked_at": null,
            "blocked_by": null,
            "erased_at": null,
            "timezone": "America/Sao_Paulo",
            "receipts": 2,
            "last_receipt_at": "2026-11-04T09:12:44.000Z"
          }
        ]
      },
      "UserHistory": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryItem"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "includes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergedPerson"
            },
            "description": "The other people this history reads: those merged into them, and their aliases Lurk has heard from. Empty when none"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor",
          "includes"
        ]
      },
      "HistoryItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/HistoryEvent"
          },
          {
            "$ref": "#/components/schemas/HistoryReceipt"
          }
        ],
        "discriminator": {
          "propertyName": "kind",
          "mapping": {
            "event": "#/components/schemas/HistoryEvent",
            "receipt": "#/components/schemas/HistoryReceipt"
          }
        }
      },
      "HistoryEvent": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "event"
            ],
            "description": "Always `event`: this item is an event"
          },
          "id": {
            "type": "string",
            "pattern": "^evt_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An event ID, starting with `evt_`."
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened: the `timestamp` it was sent with, else when Lurk recorded it"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "description": "When Lurk recorded it. The history is in this order"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {},
            "description": "What the event carried, as sent. This history shows it to your team, your keys and your agents. Lurky cannot read it. For an onchain.accrual payout without a new earning period, these properties are amount, activation, payout (the payout reference) and earned_until (the proven earning cutoff, also the event time). Period payouts keep the existing properties"
          },
          "source": {
            "type": "string",
            "enum": [
              "trusted",
              "platform",
              "onchain",
              "web_identified",
              "untrusted"
            ],
            "description": "Whose word it is: trusted (your server, an agent or a person in Lurk); platform (a chat platform vouched for it, not available yet); onchain (Lurk's on-chain observation, not available yet); web_identified (server-verified web identification, analytics only, not available yet); or untrusted (a device, not available yet)"
          },
          "session": {
            "type": [
              "string",
              "null"
            ],
            "description": "The event's `session` property, when it is a string: the visit it was part of"
          },
          "seen_as": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for them"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The other person it was recorded under: someone merged into them, or one of their aliases. Null when it was recorded under this person"
          }
        },
        "required": [
          "kind",
          "id",
          "name",
          "at",
          "recorded_at",
          "properties",
          "source",
          "session",
          "seen_as"
        ]
      },
      "HistoryReceipt": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "receipt"
            ],
            "description": "Always `receipt`: this item is a receipt"
          },
          "id": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An activity ID, starting with `act_`."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the receipt was made"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "description": "When Lurk recorded it. The history is in this order"
          },
          "receipt": {
            "$ref": "#/components/schemas/ActivityItem"
          },
          "seen_as": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for them"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The other person it was recorded under: someone merged into them, or one of their aliases. Null when it was recorded under this person"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "recorded_at",
          "receipt",
          "seen_as"
        ]
      },
      "MergedPerson": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The usr_… ID"
          },
          "external_id": {
            "type": "string",
            "description": "Your own identifier for them"
          }
        },
        "required": [
          "id",
          "external_id"
        ],
        "description": "A person in a merge: their `usr_…` ID and your own identifier for them"
      },
      "PersonAlias": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for them"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person whose history reads the alias"
          },
          "alias": {
            "type": "string",
            "description": "The other identifier, as you sent it"
          },
          "person": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for them"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person Lurk knows by that identifier, who keeps what they hold. Null until Lurk hears from them"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the alias was made"
          }
        },
        "required": [
          "user",
          "alias",
          "person",
          "created_at"
        ]
      },
      "MergeUsersOutput": {
        "type": "object",
        "properties": {
          "from": {
            "$ref": "#/components/schemas/MergedPerson"
          },
          "into": {
            "$ref": "#/components/schemas/MergedPerson"
          },
          "moved": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergedUnit"
            },
            "description": "What moved to the person kept, one entry per unit; units at 0 are left out"
          }
        },
        "required": [
          "from",
          "into",
          "moved"
        ],
        "examples": [
          {
            "from": {
              "id": "usr_01m6es2t9refr8kfbt871ed180",
              "external_id": "guest-4417"
            },
            "into": {
              "id": "usr_01m40d9ax0e2vrtmq9mk0z6t00",
              "external_id": "ben@example.com"
            },
            "moved": [
              {
                "unit": "points",
                "amount": 40,
                "transfer": "act_01m6r6has0ex5r3jf0tphf71gg",
                "receipt": "act_01m6r6has0fsg8temb2z29abr0"
              }
            ]
          }
        ]
      },
      "MergedUnit": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "How much moved to the person kept"
          },
          "transfer": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receipt of the person merged away, also on the other"
          },
          "receipt": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receipt of the person kept"
          }
        },
        "required": [
          "unit",
          "amount",
          "transfer",
          "receipt"
        ]
      },
      "MergeUsersInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The person to merge away: a usr_… ID or your own identifier"
          },
          "into": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The person to keep: a usr_… ID or your own identifier. Both must already exist"
          }
        },
        "required": [
          "from",
          "into"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "from": "guest-4417",
            "into": "ben@example.com"
          }
        ]
      },
      "UnmergeUsersOutput": {
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/MergedPerson"
          },
          "was_merged_into": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for them"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person they were merged into until now"
          },
          "moved_back": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergedUnit"
            },
            "description": "What went back to them, one entry per unit the merge had moved"
          },
          "block_copied": {
            "type": "boolean",
            "description": "True when the person they were merged into is blocked and that block was copied onto them: they stay blocked until an owner or admin unblocks them. False when there was no block to copy, or they already had their own"
          }
        },
        "required": [
          "user",
          "was_merged_into",
          "moved_back",
          "block_copied"
        ]
      },
      "UnmergeUsersInput": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The person who was merged away: a usr_… ID or your own identifier"
          }
        },
        "required": [
          "user"
        ],
        "additionalProperties": false
      },
      "BlockState": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The canonical person the block applies to."
          },
          "blocked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a member blocked this person; null when not blocked. Blocks apply where device sign-in is switched on."
          },
          "blocked_by": {
            "$ref": "#/components/schemas/MemberRef"
          }
        },
        "required": [
          "user",
          "blocked_at",
          "blocked_by"
        ],
        "additionalProperties": false
      },
      "MemberRef": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^mem_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A member ID, starting with `mem_`."
          },
          "name": {
            "type": "string",
            "description": "The member's display name."
          }
        },
        "required": [
          "id",
          "name"
        ],
        "description": "A member of the team: their ID and display name."
      },
      "FeedbackReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^fb_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The fb_… ID of the feedback; the same ID for the same message within 24 hours"
          },
          "status": {
            "type": "string",
            "enum": [
              "received"
            ],
            "description": "Always `received`: Lurk has stored it. It does not mean a person has read it yet, and no reply is promised"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "description": "When Lurk first received this message"
          }
        },
        "required": [
          "id",
          "status",
          "received_at"
        ],
        "examples": [
          {
            "id": "fb_01m6r6gz20ewx8yrcy9g5jyd8t",
            "status": "received",
            "received_at": "2026-11-06T10:30:00.000Z"
          }
        ]
      },
      "SendFeedbackInput": {
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/FeedbackKind"
          },
          "impact": {
            "$ref": "#/components/schemas/FeedbackImpact"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000,
            "description": "What happened or what you need, in plain words: 1 to 2,000 characters after trimming. Never include secrets, keys or your users' data. Before the message is stored, Lurk replaces the credentials and personal data it recognises with `[redacted]` and keeps only the origin of links; this is best effort, works best in English and is not a guarantee (text in another language may keep a credential or personal data). A message that is mostly redacted is refused. Lurk staff read the message before it is shared in Lurk's issue tracker and may remove parts of it first"
          },
          "operation": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "The operation it is about, such as `units.give`, if any: at most 100 characters. An id that is not one of Lurk's operations is not stored (the feedback is)"
          },
          "request_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_=-]{1,64}$",
              "description": "A `Request-Id` from a response: 1 to 64 letters, digits or `_=-`"
            },
            "maxItems": 5,
            "description": "Up to 5 `Request-Id` values of the calls it is about, if any"
          },
          "docs_path": {
            "type": "string",
            "pattern": "^\\/[A-Za-z0-9/_.#-]{0,199}$",
            "description": "The docs page it is about, such as `/guides/rules`, if any: starts with `/`, at most 200 characters"
          },
          "client": {
            "type": "object",
            "properties": {
              "sdk": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9@/._+-]{1,64}$",
                    "description": "The SDK's package name, such as `@getlurk/sdk`: 1 to 64 letters, digits or `@/._+-`"
                  },
                  "version": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._+-]{1,32}$",
                    "description": "Its version, such as `0.7.1`: 1 to 32 letters, digits or `._+-`"
                  }
                },
                "required": [
                  "name",
                  "version"
                ],
                "additionalProperties": false,
                "description": "The SDK that sent it, when one did"
              },
              "agent": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9@/._+ -]{1,64}$",
                    "description": "The agent's name, such as `Claude Code`: 1 to 64 letters, digits, spaces or `@/._+-`"
                  },
                  "version": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9._+-]{1,32}$",
                    "description": "Its version: 1 to 32 letters, digits or `._+-`"
                  }
                },
                "required": [
                  "name",
                  "version"
                ],
                "additionalProperties": false,
                "description": "The AI agent that sent it, when one did"
              }
            },
            "additionalProperties": false,
            "description": "Which SDK and which agent sent it, if you know"
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "A key you make up for this message, 1 to 255 characters: a retry with the same key and body returns the first answer and sends nothing twice"
          }
        },
        "required": [
          "kind",
          "impact",
          "message",
          "idempotency_key"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "kind": "docs",
            "impact": "minor",
            "message": "The units page says a reference is used once per unit, but not whether a refused use keeps it. One sentence would save me a test.",
            "operation": "units.use",
            "docs_path": "/units",
            "request_ids": [
              "req_8f3a1c52d7e04b69a1f0c3d85e2b7a46"
            ],
            "client": {
              "sdk": {
                "name": "@getlurk/sdk",
                "version": "0.7.1"
              },
              "agent": {
                "name": "Claude Code",
                "version": "2.1.0"
              }
            },
            "idempotency_key": "feedback-units-use-reference"
          }
        ],
        "description": "Feedback for the Lurk team. The project, its environment and who sent it are added by Lurk; you cannot set them."
      },
      "FeedbackKind": {
        "type": "string",
        "enum": [
          "bug",
          "gap",
          "idea",
          "docs",
          "question"
        ],
        "description": "What it is: `bug` (something is wrong), `gap` (something is missing), `idea`, `docs` (the docs are wrong or unclear) or `question`"
      },
      "FeedbackImpact": {
        "type": "string",
        "enum": [
          "blocked",
          "annoying",
          "minor"
        ],
        "description": "How much it gets in the way: `blocked` (you cannot go on), `annoying` (you can, with a workaround) or `minor`"
      },
      "UnitList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Unit"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "counts": {
            "type": "object",
            "properties": {
              "all": {
                "type": "integer",
                "minimum": 0,
                "description": "Units in all groups"
              },
              "points": {
                "type": "integer",
                "minimum": 0,
                "description": "Units in the points group"
              },
              "progress": {
                "type": "integer",
                "minimum": 0,
                "description": "Units in the progress group"
              },
              "badge": {
                "type": "integer",
                "minimum": 0,
                "description": "Units in the badge group"
              },
              "perk": {
                "type": "integer",
                "minimum": 0,
                "description": "Units in the perk group"
              }
            },
            "required": [
              "all",
              "points",
              "progress",
              "badge",
              "perk"
            ],
            "description": "How many units there are, in all and in each group. Not limited to this page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor",
          "counts"
        ],
        "examples": [
          {
            "data": [
              {
                "id": "unit_01m5ch6kp0eps8v3rprkhtfdwj",
                "key": "coffee-voucher",
                "name": "Coffee vouchers",
                "singular": "Coffee voucher",
                "group": "perk",
                "shows_as": "amount",
                "color": "teal",
                "switches": {
                  "goes_up": true,
                  "goes_down": true,
                  "spendable": true,
                  "usable": true,
                  "sendable": false,
                  "send_cap_per_day": 100,
                  "resets": false,
                  "starts_at": 0,
                  "held_by": null,
                  "cap": 5,
                  "min_balance": 0,
                  "visible": true,
                  "supply": null,
                  "expires_after_days": null,
                  "expires_at": null
                },
                "stats": {
                  "held": 0,
                  "holders": 0,
                  "given_30d": 0,
                  "spent_30d": 0,
                  "issued": 0
                },
                "created_at": "2026-10-20T11:30:00.000Z",
                "updated_at": "2026-10-20T11:30:00.000Z"
              },
              {
                "id": "unit_01m1e34qm0ejgrs7g7pf9fb9m1",
                "key": "points",
                "name": "Points",
                "singular": "Point",
                "group": "points",
                "shows_as": "amount",
                "color": "amber",
                "switches": {
                  "goes_up": true,
                  "goes_down": true,
                  "spendable": true,
                  "usable": false,
                  "sendable": true,
                  "send_cap_per_day": 100,
                  "resets": false,
                  "starts_at": 0,
                  "held_by": null,
                  "cap": null,
                  "min_balance": 0,
                  "visible": true,
                  "supply": null,
                  "expires_after_days": null,
                  "expires_at": null
                },
                "stats": {
                  "held": 294,
                  "holders": 3,
                  "given_30d": 294,
                  "spent_30d": 0,
                  "issued": 0
                },
                "created_at": "2026-09-01T09:00:00.000Z",
                "updated_at": "2026-10-15T08:00:00.000Z"
              }
            ],
            "has_more": false,
            "next_cursor": null,
            "counts": {
              "all": 2,
              "points": 1,
              "progress": 0,
              "badge": 0,
              "perk": 1
            }
          }
        ]
      },
      "Unit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unit_… ID"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key: lowercase letters, numbers, - and _, starting with a letter, up to 64 characters. Rules and calls name the unit by it"
          },
          "name": {
            "type": "string",
            "description": "The unit's name, as people see it: Beans, XP"
          },
          "singular": {
            "type": "string",
            "description": "One of it: Bean, day, Free drink"
          },
          "group": {
            "$ref": "#/components/schemas/UnitGroup"
          },
          "shows_as": {
            "type": "string",
            "enum": [
              "amount",
              "thing",
              "level"
            ],
            "description": "amount: a token and a number. thing: its own art, like a badge. level: a hexagon with the level in it"
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "blue",
              "green",
              "amber",
              "red",
              "purple",
              "pink",
              "teal",
              "gray",
              null
            ],
            "description": "The color apps draw it in (a level's hexagon, a chart's line). Null until one is chosen: the app picks its own"
          },
          "switches": {
            "$ref": "#/components/schemas/UnitSwitches"
          },
          "stats": {
            "$ref": "#/components/schemas/UnitStats"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "singular",
          "group",
          "shows_as",
          "color",
          "switches",
          "stats",
          "created_at",
          "updated_at"
        ],
        "examples": [
          {
            "id": "unit_01m1e34qm0ejgrs7g7pf9fb9m1",
            "key": "points",
            "name": "Points",
            "singular": "Point",
            "group": "points",
            "shows_as": "amount",
            "color": "amber",
            "switches": {
              "goes_up": true,
              "goes_down": true,
              "spendable": true,
              "usable": false,
              "sendable": true,
              "send_cap_per_day": 100,
              "resets": false,
              "starts_at": 0,
              "held_by": null,
              "cap": null,
              "min_balance": 0,
              "visible": true,
              "supply": null,
              "expires_after_days": null,
              "expires_at": null
            },
            "stats": {
              "held": 294,
              "holders": 3,
              "given_30d": 294,
              "spent_30d": 0,
              "issued": 0
            },
            "created_at": "2026-09-01T09:00:00.000Z",
            "updated_at": "2026-10-15T08:00:00.000Z"
          }
        ]
      },
      "UnitGroup": {
        "type": "string",
        "enum": [
          "points",
          "progress",
          "badge",
          "perk"
        ],
        "description": "The tab the unit sits in: points, progress, badge or perk. A label for how people think of it; what it can do comes from its switches"
      },
      "UnitSwitches": {
        "type": "object",
        "properties": {
          "goes_up": {
            "type": "boolean",
            "description": "Rules can add to it"
          },
          "goes_down": {
            "type": "boolean",
            "description": "Rules can take from it. Off makes it earn-only"
          },
          "spendable": {
            "type": "boolean",
            "description": "`units.spend` can take from it: a brand's server taking value for a reward. On by default for a unit that goes down; an earn-only unit is never spendable"
          },
          "usable": {
            "type": "boolean",
            "description": "`units.use` can take one: a person redeeming the thing itself, a coupon or a ticket, which fires the `unit.used` webhook. Off by default; a unit that cannot go down is never usable"
          },
          "sendable": {
            "type": "boolean",
            "description": "`units.send` can move it from one person to another. Off by default; a unit that cannot go down is never sendable. Units cannot be bought, cashed out or given a money value"
          },
          "send_cap_per_day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "description": "The most one person may send of it in a day, in the project's time zone. Always a number: a send is never unlimited. 100 by default"
          },
          "resets": {
            "type": "boolean",
            "description": "A rule's `reset` action can set it back to 0: a season's XP, a monthly count. Works for a unit that only goes up. Off by default"
          },
          "starts_at": {
            "type": "integer",
            "minimum": 0,
            "description": "What a person first heard of from now on begins with, as a receipt written when they are first seen: a level starts at 1. People Lurk has already heard of keep what they hold. 0 for nothing. Not with a supply"
          },
          "held_by": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100,
            "description": "The key of an audience to follow: a person holds exactly 1 while they are in it and 0 when they are not, kept by Lurk within minutes, as a pass or a role. Rules and gives cannot change it by hand. Needs a cap of 1 (set for you), and not an expiry, a supply or a start. Null for an ordinary unit"
          },
          "cap": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Never more than this per person; a change that would pass it is refused whole. A badge is 1"
          },
          "min_balance": {
            "type": "integer",
            "maximum": 0,
            "description": "The lowest a balance may go. 0 normally; below 0 lets it be overdrawn"
          },
          "visible": {
            "type": "boolean",
            "description": "The brand's app shows it to people. A label: Lurk does not act on it"
          },
          "supply": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The most that can ever be given in all, across everyone: 40 in all. When it has run out a rule that would give it is skipped (`supply_gone`). Counted from when it is set; null for no limit"
          },
          "expires_after_days": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 3650,
            "description": "What is given expires this many days later, and is taken back; spending uses what expires first. Applies to what is given from now on; null for never"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Everything of it ends at this moment: nothing is given after it, and what is held then expires and is taken back, whatever `expires_after_days` says. A ticket for an event on a date. Must be in the future when set; null for no end date"
          }
        },
        "required": [
          "goes_up",
          "goes_down",
          "spendable",
          "usable",
          "sendable",
          "send_cap_per_day",
          "resets",
          "starts_at",
          "held_by",
          "cap",
          "min_balance",
          "visible",
          "supply",
          "expires_after_days",
          "expires_at"
        ],
        "additionalProperties": false,
        "description": "What the unit allows. Each setting is checked on every change to a balance"
      },
      "UnitStats": {
        "type": "object",
        "properties": {
          "held": {
            "type": "integer",
            "description": "The total across everyone right now"
          },
          "holders": {
            "type": "integer",
            "minimum": 0,
            "description": "People with a balance above 0"
          },
          "given_30d": {
            "type": "integer",
            "minimum": 0,
            "description": "Added in the last 30 days"
          },
          "spent_30d": {
            "type": "integer",
            "minimum": 0,
            "description": "Taken in the last 30 days"
          },
          "issued": {
            "type": "integer",
            "minimum": 0,
            "description": "Given so far against the supply, counted from when the supply was set; 0 without one"
          }
        },
        "required": [
          "held",
          "holders",
          "given_30d",
          "spent_30d",
          "issued"
        ],
        "description": "Totals across everyone, kept up to date by Lurk"
      },
      "UnitLeaderboard": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit's key"
              },
              "name": {
                "type": "string",
                "description": "The unit's name"
              }
            },
            "required": [
              "key",
              "name"
            ],
            "description": "The unit the board is for"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "1 for the most; people with the same amount share a rank"
                },
                "user": {
                  "type": "string",
                  "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "The person's usr_… ID: never the brand's own identifier"
                },
                "amount": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How much of the unit they hold"
                }
              },
              "required": [
                "rank",
                "user",
                "amount"
              ]
            },
            "description": "Most first, then by ID. Only people with more than 0; people merged into another are left out"
          }
        },
        "required": [
          "unit",
          "rows"
        ]
      },
      "CreateUnitInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The unit's name, 1 to 80 characters: Beans, XP"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "Lowercase letters, numbers, - and _, starting with a letter, up to 64 characters. Defaults to a slug of the name. Must not be taken by another unit"
          },
          "singular": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "One of it, 1 to 80 characters. Defaults to the name"
          },
          "group": {
            "$ref": "#/components/schemas/UnitGroup"
          },
          "shows_as": {
            "type": "string",
            "enum": [
              "amount",
              "thing",
              "level"
            ],
            "description": "Defaults to amount"
          },
          "color": {
            "type": "string",
            "enum": [
              "blue",
              "green",
              "amber",
              "red",
              "purple",
              "pink",
              "teal",
              "gray"
            ],
            "description": "Defaults to none: the app picks its own"
          },
          "switches": {
            "type": "object",
            "properties": {
              "goes_up": {
                "type": "boolean",
                "description": "Rules can add to it"
              },
              "goes_down": {
                "type": "boolean",
                "description": "Rules can take from it. Off makes it earn-only"
              },
              "spendable": {
                "type": "boolean",
                "description": "`units.spend` can take from it: a brand's server taking value for a reward. On by default for a unit that goes down; an earn-only unit is never spendable"
              },
              "usable": {
                "type": "boolean",
                "description": "`units.use` can take one: a person redeeming the thing itself, a coupon or a ticket, which fires the `unit.used` webhook. Off by default; a unit that cannot go down is never usable"
              },
              "sendable": {
                "type": "boolean",
                "description": "`units.send` can move it from one person to another. Off by default; a unit that cannot go down is never sendable. Units cannot be bought, cashed out or given a money value"
              },
              "send_cap_per_day": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000000,
                "description": "The most one person may send of it in a day, in the project's time zone. Always a number: a send is never unlimited. 100 by default"
              },
              "resets": {
                "type": "boolean",
                "description": "A rule's `reset` action can set it back to 0: a season's XP, a monthly count. Works for a unit that only goes up. Off by default"
              },
              "starts_at": {
                "type": "integer",
                "minimum": 0,
                "description": "What a person first heard of from now on begins with, as a receipt written when they are first seen: a level starts at 1. People Lurk has already heard of keep what they hold. 0 for nothing. Not with a supply"
              },
              "held_by": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100,
                "description": "The key of an audience to follow: a person holds exactly 1 while they are in it and 0 when they are not, kept by Lurk within minutes, as a pass or a role. Rules and gives cannot change it by hand. Needs a cap of 1 (set for you), and not an expiry, a supply or a start. Null for an ordinary unit"
              },
              "cap": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0,
                "description": "Never more than this per person; a change that would pass it is refused whole. A badge is 1"
              },
              "min_balance": {
                "type": "integer",
                "maximum": 0,
                "description": "The lowest a balance may go. 0 normally; below 0 lets it be overdrawn"
              },
              "visible": {
                "type": "boolean",
                "description": "The brand's app shows it to people. A label: Lurk does not act on it"
              },
              "supply": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0,
                "description": "The most that can ever be given in all, across everyone: 40 in all. When it has run out a rule that would give it is skipped (`supply_gone`). Counted from when it is set; null for no limit"
              },
              "expires_after_days": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 3650,
                "description": "What is given expires this many days later, and is taken back; spending uses what expires first. Applies to what is given from now on; null for never"
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Everything of it ends at this moment: nothing is given after it, and what is held then expires and is taken back, whatever `expires_after_days` says. A ticket for an event on a date. Must be in the future when set; null for no end date"
              }
            },
            "additionalProperties": false,
            "description": "Anything left out is the default: up and down, no cap, floor 0, no supply, no expiry, not usable, not sendable (100 a day if it is made so), no reset"
          }
        },
        "required": [
          "name",
          "group"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "name": "Coffee vouchers",
            "key": "coffee-voucher",
            "singular": "Coffee voucher",
            "group": "perk",
            "color": "teal",
            "switches": {
              "usable": true,
              "cap": 5
            }
          }
        ]
      },
      "UnitShowsAs": {
        "type": "string",
        "enum": [
          "amount",
          "thing",
          "level"
        ],
        "description": "How an app draws the unit. amount: a token and a number. thing: its own art, like a badge. level: a hexagon with the level in it"
      },
      "Rule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A rule ID, starting with `rule_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The rule's key, which other rules and Activity call it by: lowercase letters, digits and dashes, starting with a letter, up to 64 characters"
          },
          "name": {
            "type": "string",
            "description": "What people call the rule, 1 to 80 characters"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live",
              "paused"
            ],
            "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The newest version"
          },
          "live_version": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The version running now; null if the rule has never been live"
          },
          "definition": {
            "type": "object",
            "properties": {
              "when": {
                "$ref": "#/components/schemas/RuleWhen"
              },
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "maxItems": 20,
                "default": [],
                "description": "Conditions that must all hold, up to 20. Leave out for none"
              },
              "limit": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limit"
                },
                "maxItems": 5,
                "default": [],
                "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
              },
              "do": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Action"
                },
                "maxItems": 10,
                "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
              },
              "budget": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleBudget"
                },
                "maxItems": 5,
                "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
              },
              "modify": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredModifier"
                },
                "maxItems": 5,
                "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
              },
              "effects": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleEffect"
                },
                "maxItems": 3,
                "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
              }
            },
            "required": [
              "when",
              "do"
            ],
            "additionalProperties": false,
            "description": "What the newest version does: when it starts, the conditions, limits and changes"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "status",
          "version",
          "live_version",
          "definition"
        ]
      },
      "RuleWhen": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "event": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "event"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "schedule": {
                "$ref": "#/components/schemas/Schedule"
              }
            },
            "required": [
              "schedule"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit whose balance is watched"
              },
              "reaches": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000000000,
                "description": "Fires when a change takes the balance from below this to this or more"
              }
            },
            "required": [
              "unit",
              "reaches"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit whose balance is watched"
              },
              "every": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000000000,
                "description": "Fires each time a change takes the balance up across a multiple of this: every 100 XP. A change that crosses several multiples fires it once for each, up to 10"
              }
            },
            "required": [
              "unit",
              "every"
            ],
            "additionalProperties": false
          }
        ],
        "description": "What starts the rule: an event, a schedule, or a unit's balance reaching a number or crossing multiples of it. Give one"
      },
      "Schedule": {
        "type": "object",
        "properties": {
          "every": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ],
            "description": "How often it comes round"
          },
          "at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "description": "The time of day in the project's time zone: 09:00"
          },
          "on": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "mon",
                  "tue",
                  "wed",
                  "thu",
                  "fri",
                  "sat",
                  "sun"
                ]
              },
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 28
              }
            ],
            "description": "For every week, the day (mon to sun); for every month, the day of the month (1 to 28). Leave out for every day"
          }
        },
        "required": [
          "every",
          "at"
        ],
        "additionalProperties": false,
        "description": "Starts the rule on the clock, in the project's time zone, for each person it covers"
      },
      "StoredCondition": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "audience": {
                "type": "string",
                "minLength": 1,
                "description": "The person must be in the audience with this key. The audience must exist"
              }
            },
            "required": [
              "audience"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "time": {
                "type": "object",
                "properties": {
                  "between": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      }
                    ],
                    "description": "Start and end as 24-hour HH:MM, read in the person's time zone. The start counts, the end does not; 22:00 to 02:00 runs past midnight"
                  }
                },
                "required": [
                  "between"
                ],
                "additionalProperties": false,
                "description": "The event must happen at a time of day in a window"
              }
            },
            "required": [
              "time"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The event property to read, by its flat name: channel"
                  },
                  "equals": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ],
                    "description": "The value it must match exactly, with the same type: text, number or true/false"
                  }
                },
                "required": [
                  "name",
                  "equals"
                ],
                "additionalProperties": false,
                "description": "An event property must have an exact value"
              }
            },
            "required": [
              "property"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property_range": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The event property to read, by its flat name: messages, minutes, total_cents"
                  },
                  "gte": {
                    "type": "number",
                    "description": "The property must be a number that is at least this: gte 5 on messages is five or more"
                  },
                  "lte": {
                    "type": "number",
                    "description": "The property must be a number that is at most this. With gte, it must be in between, both ends included"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "description": "An event property must be a number in a range. A missing or non-number property never passes"
              }
            },
            "required": [
              "property_range"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "balance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                    "description": "The unit whose balance is read"
                  },
                  "gte": {
                    "type": "integer",
                    "description": "The person must hold at least this much of the unit"
                  }
                },
                "required": [
                  "unit",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "The person's balance of a unit must be at least a number"
              }
            },
            "required": [
              "balance"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "trusted",
                  "platform",
                  "onchain",
                  "any"
                ],
                "description": "Whose word this rule takes. trusted: your server, an agent or a person in Lurk. platform: trusted and chat platform events (chat is not available yet). onchain: only Lurk's on-chain observations (not available yet). any: all sources; devices and on-chain observations are not available yet. Web identification never qualifies rewards"
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "held_for": {
                "type": "object",
                "properties": {
                  "activation": {
                    "type": "string",
                    "pattern": "^oac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The on-chain activation whose contract must be held; a display-only activation may be used"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "Whole days of continuous holding, 1 to 3650; each day is exactly 86,400 seconds, ending at the scan's finalized horizon"
                  },
                  "min": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$",
                    "description": "Minimum held throughout: a positive decimal integer in smallest token units, or an NFT count across the person's counting wallets. Omit to use the activation's minimum"
                  }
                },
                "required": [
                  "activation",
                  "days"
                ],
                "additionalProperties": false,
                "description": "Continuous holding for an activation; no history before a wallet link becomes effective is counted"
              }
            },
            "required": [
              "held_for"
            ],
            "additionalProperties": false
          }
        ],
        "description": "One IF clause. It has exactly one key, and every clause in a list must hold"
      },
      "Limit": {
        "type": "object",
        "properties": {
          "max": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "How many times the rule may apply to one person in the window"
          },
          "per": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "ever"
            ],
            "description": "The window, in the person's time zone. ever: it never resets"
          },
          "by": {
            "type": "string",
            "enum": [
              "user"
            ],
            "default": "user",
            "description": "What the limit counts per. Only user, the default"
          }
        },
        "required": [
          "max",
          "per"
        ],
        "additionalProperties": false,
        "description": "At most this many times per person in a window; past it the rule is skipped"
      },
      "Action": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit to change"
              },
              "add": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  {
                    "$ref": "#/components/schemas/AmountFrom"
                  }
                ],
                "description": "How much to give: a whole number, or one read from an event property"
              },
              "hold_over": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "If this action changes more than this, all of the rule's changes wait for a person to give or refuse them (a hold)"
              }
            },
            "required": [
              "unit",
              "add"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit to change"
              },
              "remove": {
                "anyOf": [
                  {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  {
                    "$ref": "#/components/schemas/AmountFrom"
                  }
                ],
                "description": "How much to take: a whole number, or one read from an event property"
              },
              "hold_over": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "If this action changes more than this, all of the rule's changes wait for a person to give or refuse them (a hold)"
              }
            },
            "required": [
              "unit",
              "remove"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit to change"
              },
              "reset": {
                "type": "boolean",
                "enum": [
                  true
                ],
                "description": "Back to 0: takes what the person holds of the unit, all of it, as one change (or gives it back to 0 from below). The unit must allow it (`resets`); it works for a unit that only goes up, like a season's XP"
              },
              "hold_over": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "If this action changes more than this, all of the rule's changes wait for a person to give or refuse them (a hold)"
              }
            },
            "required": [
              "unit",
              "reset"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit to change"
              },
              "streak": {
                "type": "string",
                "enum": [
                  "extend",
                  "reset"
                ],
                "description": "extend: count today in the streak (1 after a missed day). reset: back to 0 if a whole day was missed"
              },
              "hold_over": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "description": "If this action changes more than this, all of the rule's changes wait for a person to give or refuse them (a hold)"
              }
            },
            "required": [
              "unit",
              "streak"
            ],
            "additionalProperties": false
          }
        ],
        "description": "One change to a unit. It has exactly one of add, remove, reset or streak"
      },
      "AmountFrom": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "The event property to read, by its flat name: total_cents"
          },
          "per": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000000,
            "description": "Divide by this and round down. 100 turns cents into whole dollars. Default 1"
          },
          "max": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "Never more than this"
          }
        },
        "required": [
          "from"
        ],
        "additionalProperties": false
      },
      "RuleBudget": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit the cap counts"
          },
          "max": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The most the rule may give of this unit in one window"
          },
          "per": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ],
            "description": "The window, in the project's time zone"
          }
        },
        "required": [
          "unit",
          "max",
          "per"
        ],
        "additionalProperties": false,
        "description": "A cap on what the rule gives everyone in a window"
      },
      "StoredModifier": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "minItems": 1,
                "maxItems": 5,
                "description": "Who it applies to: every clause must hold for the person"
              },
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "Only the amount of this unit. Leave out for every unit the rule adds"
              },
              "times": {
                "type": "integer",
                "minimum": 2,
                "maximum": 100,
                "description": "Multiplies what the rule gives: 2 is double"
              }
            },
            "required": [
              "if",
              "times"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "minItems": 1,
                "maxItems": 5,
                "description": "Who it applies to: every clause must hold for the person"
              },
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "Only the amount of this unit. Leave out for every unit the rule adds"
              },
              "bonus": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000000000,
                "description": "Adds this much more to what the rule gives"
              }
            },
            "required": [
              "if",
              "bonus"
            ],
            "additionalProperties": false
          }
        ]
      },
      "RuleEffect": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "post": {
                "$ref": "#/components/schemas/PostEffect"
              }
            },
            "required": [
              "post"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "dm": {
                "$ref": "#/components/schemas/DmEffect"
              }
            },
            "required": [
              "dm"
            ],
            "additionalProperties": false
          }
        ]
      },
      "PostEffect": {
        "type": "object",
        "properties": {
          "community": {
            "type": "string",
            "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The community to act in: the intg_… ID of a Discord server, Slack workspace or Telegram group connected to this project (Integrations). It must belong to this project"
          },
          "channel": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
            "description": "The channel's own ID on the platform (Discord and Slack channel ID; for a Telegram group, the group's chat ID). Lurky must be allowed to post there"
          },
          "channel_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[^\\u0000-\\u001f<>@]*$",
            "description": "The channel's name as people read it (general), shown in words and previews. Only a label: posting uses `channel`"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What to say, up to 500 characters of plain text: no mentions, no markup. Placeholders: {count} is how many times the rule fired in the batch (a digest of 12 firings says 12), {rule} is the rule's name. \"{count} people earned today's bonus\""
          },
          "every": {
            "type": "string",
            "enum": [
              "hour",
              "day"
            ],
            "default": "hour",
            "description": "A rule never posts once per event: it posts at most once an hour (or a day) a digest of everything that fired in that time. Default hour"
          },
          "max_per_day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "description": "The most posts this effect makes in a day (the project's time zone). Default 24 for hour and 1 for day. Past it the firings are skipped, never queued for tomorrow"
          }
        },
        "required": [
          "community",
          "channel",
          "text"
        ],
        "additionalProperties": false,
        "description": "Not available yet. Posts a digest line in a channel of a connected community"
      },
      "DmEffect": {
        "type": "object",
        "properties": {
          "community": {
            "type": "string",
            "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The community to act in: the intg_… ID of a Discord server, Slack workspace or Telegram group connected to this project (Integrations). It must belong to this project"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "What to say to the person the event is about, up to 500 characters of plain text: no mentions, no markup. Placeholder: {rule} is the rule's name"
          }
        },
        "required": [
          "community",
          "text"
        ],
        "additionalProperties": false,
        "description": "Not available yet. Messages the person the event is about"
      },
      "CreateRuleInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "What people call the rule, 1 to 80 characters"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The rule's key, which other rules and Activity call it by: lowercase letters, digits and dashes, starting with a letter, up to 64 characters. Defaults to a slug of the name"
          },
          "when": {
            "$ref": "#/components/schemas/RuleWhen"
          },
          "if": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Condition"
            },
            "maxItems": 20,
            "default": [],
            "description": "Conditions that must all hold, up to 20. Leave out for none"
          },
          "limit": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Limit"
            },
            "maxItems": 5,
            "default": [],
            "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
          },
          "do": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            },
            "maxItems": 10,
            "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
          },
          "budget": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleBudget"
            },
            "maxItems": 5,
            "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
          },
          "modify": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Modifier"
            },
            "maxItems": 5,
            "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
          },
          "effects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleEffect"
            },
            "maxItems": 3,
            "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
          }
        },
        "required": [
          "name",
          "when",
          "do"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "name": "Points for orders",
            "key": "order-points",
            "when": {
              "event": "order.paid"
            },
            "if": [
              {
                "property": {
                  "name": "currency",
                  "equals": "USD"
                }
              }
            ],
            "limit": [
              {
                "max": 5,
                "per": "day"
              }
            ],
            "do": [
              {
                "unit": "points",
                "add": {
                  "from": "total_cents",
                  "per": 100
                }
              }
            ]
          }
        ]
      },
      "Condition": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "audience": {
                "type": "string",
                "minLength": 1,
                "description": "The person must be in the audience with this key. The audience must exist"
              }
            },
            "required": [
              "audience"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "time": {
                "type": "object",
                "properties": {
                  "between": {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      },
                      {
                        "type": "string",
                        "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                      }
                    ],
                    "description": "Start and end as 24-hour HH:MM, read in the person's time zone. The start counts, the end does not; 22:00 to 02:00 runs past midnight"
                  }
                },
                "required": [
                  "between"
                ],
                "additionalProperties": false,
                "description": "The event must happen at a time of day in a window"
              }
            },
            "required": [
              "time"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The event property to read, by its flat name: channel"
                  },
                  "equals": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ],
                    "description": "The value it must match exactly, with the same type: text, number or true/false"
                  }
                },
                "required": [
                  "name",
                  "equals"
                ],
                "additionalProperties": false,
                "description": "An event property must have an exact value"
              }
            },
            "required": [
              "property"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property_range": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The event property to read, by its flat name: messages, minutes, total_cents"
                  },
                  "gte": {
                    "type": "number",
                    "description": "The property must be a number that is at least this: gte 5 on messages is five or more"
                  },
                  "lte": {
                    "type": "number",
                    "description": "The property must be a number that is at most this. With gte, it must be in between, both ends included"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "description": "An event property must be a number in a range. A missing or non-number property never passes"
              }
            },
            "required": [
              "property_range"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "balance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                    "description": "The unit whose balance is read"
                  },
                  "gte": {
                    "type": "integer",
                    "description": "The person must hold at least this much of the unit"
                  }
                },
                "required": [
                  "unit",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "The person's balance of a unit must be at least a number"
              }
            },
            "required": [
              "balance"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "trusted",
                  "platform",
                  "onchain",
                  "any"
                ],
                "description": "Whose word this rule takes. trusted: your server, an agent or a person in Lurk. platform: trusted and chat platform events (chat is not available yet). onchain: only Lurk's on-chain observations (not available yet). any: all sources; devices and on-chain observations are not available yet. Web identification never qualifies rewards"
              }
            },
            "required": [
              "source"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "held_for": {
                "type": "object",
                "properties": {
                  "activation": {
                    "type": "string",
                    "pattern": "^oac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The on-chain activation whose contract must be held; a display-only activation may be used"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "Whole days of continuous holding, 1 to 3650; each day is exactly 86,400 seconds, ending at the scan's finalized horizon"
                  },
                  "min": {
                    "type": "string",
                    "maxLength": 78,
                    "pattern": "^[1-9][0-9]*$",
                    "description": "Minimum held throughout: a positive decimal integer of at most 78 digits in smallest token units, or an NFT count across the person's counting wallets. Omit to use the activation's minimum"
                  }
                },
                "required": [
                  "activation",
                  "days"
                ],
                "additionalProperties": false,
                "description": "Continuous holding for an activation; no history before a wallet link becomes effective is counted"
              }
            },
            "required": [
              "held_for"
            ],
            "additionalProperties": false
          }
        ],
        "description": "One IF clause. It has exactly one key, and every clause in a list must hold"
      },
      "Modifier": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition"
                },
                "minItems": 1,
                "maxItems": 5,
                "description": "Who it applies to: every clause must hold for the person"
              },
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "Only the amount of this unit. Leave out for every unit the rule adds"
              },
              "times": {
                "type": "integer",
                "minimum": 2,
                "maximum": 100,
                "description": "Multiplies what the rule gives: 2 is double"
              }
            },
            "required": [
              "if",
              "times"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Condition"
                },
                "minItems": 1,
                "maxItems": 5,
                "description": "Who it applies to: every clause must hold for the person"
              },
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "Only the amount of this unit. Leave out for every unit the rule adds"
              },
              "bonus": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 1000000000,
                "description": "Adds this much more to what the rule gives"
              }
            },
            "required": [
              "if",
              "bonus"
            ],
            "additionalProperties": false
          }
        ]
      },
      "RuleList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleListItem"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "counts": {
            "$ref": "#/components/schemas/RuleCounts"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor",
          "counts"
        ],
        "examples": [
          {
            "data": [
              {
                "id": "rule_01m6nezem0ftv843at2zrp452g",
                "key": "welcome-points",
                "name": "Welcome points",
                "status": "draft",
                "version": 1,
                "live_version": null,
                "definition": {
                  "when": {
                    "event": "account.created"
                  },
                  "if": [],
                  "limit": [
                    {
                      "max": 1,
                      "per": "ever",
                      "by": "user"
                    }
                  ],
                  "do": [
                    {
                      "unit": "points",
                      "add": 50
                    }
                  ]
                },
                "units": [
                  "points"
                ],
                "created_at": "2026-11-05T09:00:00.000Z",
                "updated_at": "2026-11-05T09:00:00.000Z"
              },
              {
                "id": "rule_01m2z44880ev18z457tkgkpp00",
                "key": "order-points",
                "name": "Points for orders",
                "status": "live",
                "version": 2,
                "live_version": 1,
                "definition": {
                  "when": {
                    "event": "order.paid"
                  },
                  "if": [
                    {
                      "property": {
                        "name": "currency",
                        "equals": "USD"
                      }
                    }
                  ],
                  "limit": [
                    {
                      "max": 3,
                      "per": "day",
                      "by": "user"
                    }
                  ],
                  "do": [
                    {
                      "unit": "points",
                      "add": {
                        "from": "total_cents",
                        "per": 100
                      }
                    }
                  ]
                },
                "units": [
                  "points"
                ],
                "created_at": "2026-09-20T10:00:00.000Z",
                "updated_at": "2026-11-06T15:30:00.000Z"
              }
            ],
            "has_more": false,
            "next_cursor": null,
            "counts": {
              "all": 2,
              "live": 1,
              "paused": 0,
              "draft": 1
            }
          }
        ]
      },
      "RuleListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A rule ID, starting with `rule_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The rule's key, which other rules and Activity call it by: lowercase letters, digits and dashes, starting with a letter, up to 64 characters"
          },
          "name": {
            "type": "string",
            "description": "What people call the rule, 1 to 80 characters"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live",
              "paused"
            ],
            "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The newest version"
          },
          "live_version": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The version running now; null if the rule has never been live"
          },
          "definition": {
            "type": "object",
            "properties": {
              "when": {
                "$ref": "#/components/schemas/RuleWhen"
              },
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "maxItems": 20,
                "default": [],
                "description": "Conditions that must all hold, up to 20. Leave out for none"
              },
              "limit": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limit"
                },
                "maxItems": 5,
                "default": [],
                "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
              },
              "do": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Action"
                },
                "maxItems": 10,
                "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
              },
              "budget": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleBudget"
                },
                "maxItems": 5,
                "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
              },
              "modify": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredModifier"
                },
                "maxItems": 5,
                "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
              },
              "effects": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleEffect"
                },
                "maxItems": 3,
                "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
              }
            },
            "required": [
              "when",
              "do"
            ],
            "additionalProperties": false,
            "description": "What the newest version does: when it starts, the conditions, limits and changes"
          },
          "units": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$"
            },
            "description": "The units its actions change"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "status",
          "version",
          "live_version",
          "definition",
          "units",
          "created_at",
          "updated_at"
        ]
      },
      "RuleCounts": {
        "type": "object",
        "properties": {
          "all": {
            "type": "integer",
            "minimum": 0,
            "description": "Rules in any status"
          },
          "live": {
            "type": "integer",
            "minimum": 0,
            "description": "Rules that are live"
          },
          "paused": {
            "type": "integer",
            "minimum": 0,
            "description": "Rules that are paused"
          },
          "draft": {
            "type": "integer",
            "minimum": 0,
            "description": "Rules that are drafts"
          }
        },
        "required": [
          "all",
          "live",
          "paused",
          "draft"
        ],
        "description": "How many rules each status has, with the other filters applied and the status filter ignored"
      },
      "RuleDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A rule ID, starting with `rule_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The rule's key, which other rules and Activity call it by: lowercase letters, digits and dashes, starting with a letter, up to 64 characters"
          },
          "name": {
            "type": "string",
            "description": "What people call the rule, 1 to 80 characters"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "live",
              "paused"
            ],
            "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "The newest version"
          },
          "live_version": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The version running now; null if the rule has never been live"
          },
          "definition": {
            "type": "object",
            "properties": {
              "when": {
                "$ref": "#/components/schemas/RuleWhen"
              },
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "maxItems": 20,
                "default": [],
                "description": "Conditions that must all hold, up to 20. Leave out for none"
              },
              "limit": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limit"
                },
                "maxItems": 5,
                "default": [],
                "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
              },
              "do": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Action"
                },
                "maxItems": 10,
                "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
              },
              "budget": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleBudget"
                },
                "maxItems": 5,
                "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
              },
              "modify": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredModifier"
                },
                "maxItems": 5,
                "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
              },
              "effects": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleEffect"
                },
                "maxItems": 3,
                "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
              }
            },
            "required": [
              "when",
              "do"
            ],
            "additionalProperties": false,
            "description": "What the newest version does: when it starts, the conditions, limits and changes"
          },
          "units": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$"
            },
            "description": "The units its actions change"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          },
          "live_definition": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "when": {
                "$ref": "#/components/schemas/RuleWhen"
              },
              "if": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredCondition"
                },
                "maxItems": 20,
                "default": [],
                "description": "Conditions that must all hold, up to 20. Leave out for none"
              },
              "limit": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Limit"
                },
                "maxItems": 5,
                "default": [],
                "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
              },
              "do": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Action"
                },
                "maxItems": 10,
                "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
              },
              "budget": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleBudget"
                },
                "maxItems": 5,
                "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
              },
              "modify": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StoredModifier"
                },
                "maxItems": 5,
                "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
              },
              "effects": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RuleEffect"
                },
                "maxItems": 3,
                "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
              }
            },
            "required": [
              "when",
              "do"
            ],
            "additionalProperties": false,
            "description": "What is running now; null if the rule has never been live. Differs from `definition` while an edit waits"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "status",
          "version",
          "live_version",
          "definition",
          "units",
          "created_at",
          "updated_at",
          "live_definition"
        ],
        "examples": [
          {
            "id": "rule_01m2z44880ev18z457tkgkpp00",
            "key": "order-points",
            "name": "Points for orders",
            "status": "live",
            "version": 2,
            "live_version": 1,
            "definition": {
              "when": {
                "event": "order.paid"
              },
              "if": [
                {
                  "property": {
                    "name": "currency",
                    "equals": "USD"
                  }
                }
              ],
              "limit": [
                {
                  "max": 3,
                  "per": "day",
                  "by": "user"
                }
              ],
              "do": [
                {
                  "unit": "points",
                  "add": {
                    "from": "total_cents",
                    "per": 100
                  }
                }
              ]
            },
            "units": [
              "points"
            ],
            "created_at": "2026-09-20T10:00:00.000Z",
            "updated_at": "2026-11-06T15:30:00.000Z",
            "live_definition": {
              "when": {
                "event": "order.paid"
              },
              "if": [
                {
                  "property": {
                    "name": "currency",
                    "equals": "USD"
                  }
                }
              ],
              "limit": [
                {
                  "max": 5,
                  "per": "day",
                  "by": "user"
                }
              ],
              "do": [
                {
                  "unit": "points",
                  "add": {
                    "from": "total_cents",
                    "per": 100
                  }
                }
              ]
            }
          }
        ]
      },
      "PreviewRuleOutput": {
        "type": "object",
        "properties": {
          "trigger": {
            "type": "string",
            "enum": [
              "event",
              "schedule",
              "balance"
            ],
            "description": "What starts the rule. Only an event rule has a replay: for the others the replay numbers are zero and `schedule` or `balance` says what can be known"
          },
          "schedule": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "timezone": {
                "type": "string",
                "description": "The project's time zone, which the times are read in"
              },
              "next": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "date-time"
                },
                "description": "The next times it would run, soonest first, as instants"
              },
              "people": {
                "type": "integer",
                "minimum": 0,
                "description": "How many people each run would go through: the audience it reads, or everyone"
              },
              "audience": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The key of the audience it walks, or null when it walks everyone in the project"
              }
            },
            "required": [
              "timezone",
              "next",
              "people",
              "audience"
            ],
            "description": "Set for a rule that starts on a schedule"
          },
          "balance": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit whose balance starts the rule"
              },
              "reaches": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The balance it starts at, for `reaches`"
              },
              "every": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The step it repeats at, for `every`"
              },
              "fed_by": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "The other rule's key"
                    },
                    "name": {
                      "type": "string",
                      "description": "The other rule's name"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "live",
                        "paused"
                      ],
                      "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed"
                    }
                  },
                  "required": [
                    "key",
                    "name",
                    "status"
                  ],
                  "additionalProperties": false
                },
                "description": "The other rules that change this unit, which are what starts this one. Empty when nothing does"
              },
              "already_there": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "description": "For `reaches`, how many people already hold that much (it starts for them only when a rule next changes the balance). Null for `every`"
              }
            },
            "required": [
              "unit",
              "reaches",
              "every",
              "fed_by",
              "already_there"
            ],
            "description": "Set for a rule that starts when a balance moves"
          },
          "rule": {
            "type": "string",
            "description": "The rule's key"
          },
          "version": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "The version previewed: the newest. Null when a definition was sent"
          },
          "period": {
            "$ref": "#/components/schemas/RulePeriod"
          },
          "events": {
            "type": "integer",
            "minimum": 0,
            "description": "Events the rule listens for that were replayed"
          },
          "users": {
            "type": "integer",
            "minimum": 0,
            "description": "People it would have reached"
          },
          "receipts": {
            "type": "integer",
            "minimum": 0,
            "description": "Times it would have changed something"
          },
          "held": {
            "type": "integer",
            "minimum": 0,
            "description": "Times it would have waited for a person (a hold); these change nothing until given"
          },
          "given": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitTotal"
            },
            "description": "What it would have given, per unit. Negative for taking"
          },
          "effects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreviewEffect"
            },
            "description": "Not available yet. What its effects would have done, as counts. Never sent. Empty for a rule with no effects"
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkipCount"
            },
            "description": "Times it would not have applied, by reason"
          },
          "top_users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreviewUserTotal"
            },
            "maxItems": 10,
            "description": "The people it would have changed the most for, largest first, up to 10"
          },
          "truncated": {
            "type": "boolean",
            "description": "True when there were more events than a preview reads; it replayed the earliest ones"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the preview does not know, so its numbers are read as an estimate"
          }
        },
        "required": [
          "trigger",
          "schedule",
          "balance",
          "rule",
          "version",
          "period",
          "events",
          "users",
          "receipts",
          "held",
          "given",
          "effects",
          "skipped",
          "top_users",
          "truncated",
          "notes"
        ],
        "description": "Nothing is given. The engine replays recorded events in memory",
        "examples": [
          {
            "trigger": "event",
            "schedule": null,
            "balance": null,
            "rule": "order-points",
            "version": 2,
            "period": {
              "from": "2026-10-08T12:00:00.000Z",
              "to": "2026-11-07T12:00:00.000Z"
            },
            "events": 2,
            "users": 1,
            "receipts": 2,
            "held": 0,
            "given": [
              {
                "unit": "points",
                "amount": 169
              }
            ],
            "effects": [],
            "skipped": [],
            "top_users": [
              {
                "user": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
                "given": [
                  {
                    "unit": "points",
                    "amount": 169
                  }
                ]
              }
            ],
            "truncated": false,
            "notes": [
              "Every person starts with nothing at the start of the period, so balance conditions only see what this rule gave.",
              "Audiences are applied as they are now: nothing keeps a history of who was in one.",
              "Limits count from the start of the period; a limit of once ever counts from there too."
            ]
          }
        ]
      },
      "RulePeriod": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the period, as an instant"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "The end of the period, as an instant"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "description": "The days a preview or the statistics looked at"
      },
      "UnitTotal": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "The total: positive for given, negative for taken"
          }
        },
        "required": [
          "unit",
          "amount"
        ]
      },
      "PreviewEffect": {
        "type": "object",
        "properties": {
          "effect": {
            "type": "string",
            "enum": [
              "post",
              "dm"
            ],
            "description": "Not available yet. post: a digest in a channel. dm: a message to the person"
          },
          "words": {
            "type": "string",
            "description": "In words: \"Would post in #general, at most once an hour\""
          },
          "firings": {
            "type": "integer",
            "minimum": 0,
            "description": "Times the rule would have fired it"
          },
          "messages": {
            "type": "integer",
            "minimum": 0,
            "description": "How many posts or messages that would have been: a post is one digest per window however many firings it holds, a message is one per firing"
          }
        },
        "required": [
          "effect",
          "words",
          "firings",
          "messages"
        ]
      },
      "SkipCount": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "condition_failed",
              "condition_unknown",
              "limit_reached",
              "insufficient_balance",
              "unit_setting",
              "hold_refused",
              "budget_reached",
              "supply_gone"
            ],
            "description": "condition_unknown: the holding could not be confirmed, so the rule does not fire and is not retried. unit_setting: a unit's own setting stopped it (it cannot go up or down, or the change would pass its cap). hold_refused: a person refused the change a rule had held. budget_reached: the rule has given all its budget for this window. supply_gone: a unit with a limited supply has none left for the change"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many times the rule was skipped for this reason"
          }
        },
        "required": [
          "reason",
          "count"
        ]
      },
      "PreviewUserTotal": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "description": "The usr_… ID"
          },
          "given": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitTotal"
            },
            "description": "What they would have got, per unit; negative for taking"
          }
        },
        "required": [
          "user",
          "given"
        ]
      },
      "RuleStatsOutput": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "string",
            "description": "The rule's key"
          },
          "period": {
            "$ref": "#/components/schemas/RulePeriod"
          },
          "receipts": {
            "type": "integer",
            "minimum": 0,
            "description": "Times it changed something"
          },
          "users": {
            "type": "integer",
            "minimum": 0,
            "description": "People it reached"
          },
          "given": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitTotal"
            },
            "description": "What it gave, per unit. Negative for taking"
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkipCount"
            },
            "description": "Times it did not apply. Skips are kept for 30 days, so a longer period shows the last 30"
          },
          "top_users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleStatsUser"
            },
            "maxItems": 10,
            "description": "The people it reached most in the period, by number of receipts, then by amount, then by ID"
          }
        },
        "required": [
          "rule",
          "period",
          "receipts",
          "users",
          "given",
          "skipped",
          "top_users"
        ],
        "description": "What the rule actually did, from the receipts"
      },
      "RuleStatsUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The usr_… ID"
          },
          "external_id": {
            "type": "string",
            "description": "The brand's own identifier for the person"
          },
          "receipts": {
            "type": "integer",
            "minimum": 1,
            "description": "Times the rule changed something for them in the period"
          },
          "given": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitTotal"
            },
            "description": "What they got in the period, per unit; negative for taking"
          }
        },
        "required": [
          "id",
          "external_id",
          "receipts",
          "given"
        ]
      },
      "ApiKeyClaimSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The kcl_… claim ID"
          },
          "name": {
            "type": "string",
            "description": "What the key is for"
          },
          "status": {
            "$ref": "#/components/schemas/ApiKeyClaimStatus"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the claim window closes"
          },
          "pkce_required": {
            "type": "boolean",
            "description": "Whether redeeming requires the local PKCE verifier"
          },
          "code_issue_count": {
            "type": "integer",
            "minimum": 0,
            "description": "How many one-time claim codes have been issued for this claim"
          },
          "api_key_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The minted key_… ID once claimed; null before"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "expires_at",
          "pkce_required",
          "api_key_id"
        ]
      },
      "ApiKeyClaimStatus": {
        "type": "string",
        "enum": [
          "pending",
          "claimed",
          "cancelled",
          "expired"
        ],
        "description": "`pending`: waiting to be claimed; `claimed`: exchanged for a key; `cancelled`: cancelled before redemption; `expired`: claim window closed."
      },
      "CreatedWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's `whe_…` ID"
          },
          "url": {
            "type": "string",
            "description": "Where Lurk sends the events"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "activity.created",
                "rule.live",
                "unit.used"
              ]
            },
            "description": "The events it receives"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your note for the team; null if there is none"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ],
            "description": "`disabled` endpoints get nothing and do not count toward the limit of 25 active ones"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "failing",
              "manual",
              null
            ],
            "description": "Why it was switched off: `failing` after 15 failed attempts in a row, `manual` when the person who added it can no longer change the project. Null while it is active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "secret": {
            "type": "string",
            "description": "Verifies the signature on each delivery. Shown once; Lurk cannot show it again"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "status",
          "disabled_reason",
          "created_at",
          "secret"
        ],
        "examples": [
          {
            "id": "whe_01m6nezem0emc8tkvw5bmgt4zr",
            "url": "https://example.com/hooks/lurk",
            "events": [
              "activity.created",
              "unit.used"
            ],
            "description": "Orders service",
            "status": "active",
            "disabled_reason": null,
            "created_at": "2026-11-05T09:00:00.000Z",
            "secret": "whsec_EXAMPLE_NOT_A_REAL_SECRET"
          }
        ]
      },
      "CreateWebhookEndpointInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Where Lurk sends events. HTTPS only, on the public internet"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "activity.created",
                "rule.live",
                "unit.used"
              ]
            },
            "minItems": 1,
            "maxItems": 3,
            "default": [
              "activity.created",
              "rule.live",
              "unit.used"
            ],
            "description": "Which events to send; all of them by default"
          },
          "description": {
            "type": "string",
            "maxLength": 200,
            "description": "A note for your team"
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "url": "https://example.com/hooks/lurk",
            "events": [
              "activity.created",
              "unit.used"
            ],
            "description": "Orders service"
          }
        ]
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ],
        "examples": [
          {
            "data": [
              {
                "id": "whe_01m6nezem0emc8tkvw5bmgt4zr",
                "url": "https://example.com/hooks/lurk",
                "events": [
                  "activity.created",
                  "unit.used"
                ],
                "description": "Orders service",
                "status": "active",
                "disabled_reason": null,
                "created_at": "2026-11-05T09:00:00.000Z"
              },
              {
                "id": "whe_01m3y1rb50eg3rrfkb37cfr0q7",
                "url": "https://hooks.example.org/lurk",
                "events": [
                  "activity.created",
                  "rule.live",
                  "unit.used"
                ],
                "description": null,
                "status": "disabled",
                "disabled_reason": "failing",
                "created_at": "2026-10-02T10:15:00.000Z"
              }
            ],
            "has_more": false,
            "next_cursor": null
          }
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's `whe_…` ID"
          },
          "url": {
            "type": "string",
            "description": "Where Lurk sends the events"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "activity.created",
                "rule.live",
                "unit.used"
              ]
            },
            "description": "The events it receives"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Your note for the team; null if there is none"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ],
            "description": "`disabled` endpoints get nothing and do not count toward the limit of 25 active ones"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "failing",
              "manual",
              null
            ],
            "description": "Why it was switched off: `failing` after 15 failed attempts in a row, `manual` when the person who added it can no longer change the project. Null while it is active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "status",
          "disabled_reason",
          "created_at"
        ]
      },
      "DeletedWebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The `whe_…` ID of the endpoint that was deleted"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always true"
          }
        },
        "required": [
          "id",
          "deleted"
        ]
      },
      "AnnotationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Annotation"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Annotation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ann_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An annotation ID, starting with `ann_`."
          },
          "day": {
            "type": "string",
            "format": "date",
            "description": "The calendar day, such as `2026-11-12`. No time and no time zone."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140,
            "description": "One short sentence, 1 to 140 characters, such as “Version 2.4 released”. Don’t put personal data in it."
          },
          "created_by": {
            "type": "string",
            "pattern": "^(member|key):.+$",
            "description": "Who wrote it: `member:` or `key:` followed by an ID, never a name."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "day",
          "text",
          "created_by",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "A short note on one day, shown on charts."
      },
      "CreateAnnotationInput": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "description": "The calendar day, such as `2026-11-12`. No time and no time zone."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140,
            "description": "One short sentence, 1 to 140 characters, such as “Version 2.4 released”. Don’t put personal data in it."
          }
        },
        "required": [
          "day",
          "text"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "day": "2026-11-12",
            "text": "Version 2.4 released"
          }
        ]
      },
      "DeletedAnnotation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ann_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An annotation ID, starting with `ann_`."
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "Always true: the annotation is gone."
          }
        },
        "required": [
          "id",
          "deleted"
        ],
        "additionalProperties": false
      },
      "TrustedIssuer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^iss_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A trusted issuer ID, starting with `iss_`."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "A name to tell issuers apart, 1 to 80 characters. Renaming is the only edit an issuer allows."
          },
          "profile": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "supabase"
                    ],
                    "description": "Supabase Auth, on its default supabase.co address."
                  },
                  "project_ref": {
                    "type": "string",
                    "pattern": "^[a-z]{20}$",
                    "description": "The default supabase.co issuer. A token must carry is_anonymous as a boolean set to false: true is refused with anonymous_session, and a missing or non-boolean value is refused as invalid_token. A later opt-in may change that. This profile takes only the project ref and always means https://<ref>.supabase.co/auth/v1: it cannot take a custom auth domain yet. Whether a custom auth domain changes a token's iss is not settled; if you use one and need it supported, contact us."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "default": [
                      "authenticated"
                    ],
                    "description": "Accepted values of a token's `aud` claim, 1 to 20. A token must carry exactly one audience, and it must be one of these."
                  },
                  "algorithms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "RS256",
                        "ES256"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "default": [
                      "RS256",
                      "ES256"
                    ],
                    "description": "Signature algorithms a token may use: RS256, ES256 or both."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "project_ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "clerk"
                    ],
                    "description": "Clerk session tokens."
                  },
                  "issuer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The exact Clerk Frontend API origin; verification uses RS256 only."
                  },
                  "authorized_parties": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048,
                      "description": "Shape only, not the SSRF defence: the server resolves, pins and revalidates public DNS on every fetch."
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "description": "Require an azp claim matching an exact allowed HTTPS origin. Only Clerk session tokens (version 2: sid, v 2, sts active) are accepted; a missing azp, a pending session, a JWT-template token and a version 1 token are refused. A development instance (issuer https://<name>.clerk.accounts.dev) may also list http://localhost or http://127.0.0.1, with an optional port."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "maxItems": 20,
                    "default": [],
                    "description": "Optional for Clerk's default session-token profile. An empty list does not disable azp validation."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "issuer",
                  "authorized_parties"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "oidc"
                    ],
                    "description": "Any other OpenID Connect provider."
                  },
                  "issuer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The exact issuer claim. This profile checks the signature, issuer, audience, expiry and lifetime, and refuses a token with is_anonymous: true (anonymous_session). It applies no other provider rule: it does not require is_anonymous to be present, does not check role, and cannot tell a Clerk session token from a Clerk JWT-template token. A Supabase project on its supabase.co address or a Clerk development instance (*.clerk.accounts.dev) is refused here: use the supabase or clerk profile. Whether a Supabase custom auth domain changes a token's iss is not settled; the supabase profile cannot take a custom issuer yet, so with a custom domain contact us before relying on this profile."
                  },
                  "jwks_url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "Expected to share the issuer's origin. A different origin is allowed (Google and Firebase publish keys elsewhere), but the issuer reports key_origin_differs: true."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "description": "Accepted values of a token's `aud` claim, 1 to 20. A token must carry exactly one audience, and it must be one of these."
                  },
                  "algorithms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "RS256",
                        "ES256"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "description": "Signature algorithms a token may use: RS256, ES256 or both."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "issuer",
                  "jwks_url",
                  "audiences",
                  "algorithms"
                ],
                "additionalProperties": false
              }
            ],
            "description": "How this provider's tokens are checked: its rules and settings. Fixed once saved: a different profile is a new issuer."
          },
          "issuer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "Exact verified issuer claim; immutable for this identity namespace."
          },
          "jwks_url": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "description": "Where the issuer's public signing keys are fetched from. Worked out from the profile. Shape only, not the SSRF defence: the server resolves, pins and revalidates public DNS on every fetch."
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "Version of the issuer's trust settings. It goes up when the issuer is activated, paused or archived, not on a rename or a check."
          },
          "status": {
            "type": "string",
            "enum": [
              "paused",
              "active",
              "archived"
            ],
            "description": "Human trust decision, independent of signing-key health or provider availability."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          },
          "key_origin_differs": {
            "type": "boolean",
            "description": "True when the key address is on a different origin than the issuer address, which is worth a look before trusting it. Worked out by Lurk, never sent by a client."
          },
          "key_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 20,
            "description": "Usable public keys allowed by this profile."
          },
          "key_ids_hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{12}$",
            "description": "What the last check found, as a fingerprint of the key ids (`kid`) of the `key_count` usable keys: the first 12 hex characters of the SHA-256 of the ids, sorted, as a JSON array (`[\"a\",\"b\"]`). Key ids are public. It changes when one key is swapped for another, which `key_count` and `algorithms` do not show, so compare it before and after a rotation. Null with no usable key, and for a check made before Lurk recorded it."
          },
          "algorithms": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "RS256",
                "ES256"
              ]
            },
            "maxItems": 2,
            "description": "Algorithms of the usable keys the last check found; if the provider could not be reached, the last known ones stay. Empty before the first check, and after a pause or archive, which clear the check."
          },
          "problem": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "unavailable",
              "invalid_keys",
              "no_supported_key",
              "configuration_changed",
              null
            ],
            "description": "What the last check found wrong, or null. unavailable: the key address could not be reached. invalid_keys: it answered, but not with a usable key set. no_supported_key: it holds no RS256 or ES256 key."
          },
          "can_activate": {
            "type": "boolean",
            "description": "True when the issuer could be activated now: paused, healthy, and checked at its current revision within the last 24 hours. Always false where sign-in is switched off. Worked out by Lurk, never sent by a client."
          }
        },
        "required": [
          "id",
          "name",
          "profile",
          "issuer",
          "jwks_url",
          "revision",
          "status",
          "created_at",
          "checked_at",
          "last_used_at",
          "key_origin_differs",
          "key_count",
          "key_ids_hash",
          "algorithms",
          "problem",
          "can_activate"
        ],
        "additionalProperties": false
      },
      "CreateTrustedIssuerInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "A name to tell issuers apart, 1 to 80 characters. Renaming is the only edit an issuer allows."
          },
          "profile": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "supabase"
                    ],
                    "description": "Supabase Auth, on its default supabase.co address."
                  },
                  "project_ref": {
                    "type": "string",
                    "pattern": "^[a-z]{20}$",
                    "description": "The default supabase.co issuer. A token must carry is_anonymous as a boolean set to false: true is refused with anonymous_session, and a missing or non-boolean value is refused as invalid_token. A later opt-in may change that. This profile takes only the project ref and always means https://<ref>.supabase.co/auth/v1: it cannot take a custom auth domain yet. Whether a custom auth domain changes a token's iss is not settled; if you use one and need it supported, contact us."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "default": [
                      "authenticated"
                    ],
                    "description": "Accepted values of a token's `aud` claim, 1 to 20. A token must carry exactly one audience, and it must be one of these."
                  },
                  "algorithms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "RS256",
                        "ES256"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "default": [
                      "RS256",
                      "ES256"
                    ],
                    "description": "Signature algorithms a token may use: RS256, ES256 or both."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "project_ref"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "clerk"
                    ],
                    "description": "Clerk session tokens."
                  },
                  "issuer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The exact Clerk Frontend API origin; verification uses RS256 only."
                  },
                  "authorized_parties": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048,
                      "description": "Shape only, not the SSRF defence: the server resolves, pins and revalidates public DNS on every fetch."
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "description": "Require an azp claim matching an exact allowed HTTPS origin. Only Clerk session tokens (version 2: sid, v 2, sts active) are accepted; a missing azp, a pending session, a JWT-template token and a version 1 token are refused. A development instance (issuer https://<name>.clerk.accounts.dev) may also list http://localhost or http://127.0.0.1, with an optional port."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "maxItems": 20,
                    "default": [],
                    "description": "Optional for Clerk's default session-token profile. An empty list does not disable azp validation."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "issuer",
                  "authorized_parties"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "oidc"
                    ],
                    "description": "Any other OpenID Connect provider."
                  },
                  "issuer": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The exact issuer claim. This profile checks the signature, issuer, audience, expiry and lifetime, and refuses a token with is_anonymous: true (anonymous_session). It applies no other provider rule: it does not require is_anonymous to be present, does not check role, and cannot tell a Clerk session token from a Clerk JWT-template token. A Supabase project on its supabase.co address or a Clerk development instance (*.clerk.accounts.dev) is refused here: use the supabase or clerk profile. Whether a Supabase custom auth domain changes a token's iss is not settled; the supabase profile cannot take a custom issuer yet, so with a custom domain contact us before relying on this profile."
                  },
                  "jwks_url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "Expected to share the issuer's origin. A different origin is allowed (Google and Firebase publish keys elsewhere), but the issuer reports key_origin_differs: true."
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "description": "Accepted values of a token's `aud` claim, 1 to 20. A token must carry exactly one audience, and it must be one of these."
                  },
                  "algorithms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "RS256",
                        "ES256"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "description": "Signature algorithms a token may use: RS256, ES256 or both."
                  },
                  "max_token_lifetime_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400,
                    "default": 3600,
                    "description": "Bounds exp minus iat, in addition to current expiry and token age."
                  }
                },
                "required": [
                  "provider",
                  "issuer",
                  "jwks_url",
                  "audiences",
                  "algorithms"
                ],
                "additionalProperties": false
              }
            ],
            "description": "How this provider's tokens are checked: its rules and settings. Fixed once saved: a different profile is a new issuer."
          }
        },
        "required": [
          "name",
          "profile"
        ],
        "additionalProperties": false,
        "description": "Owner or admin only. An API key or an agent gets approval_required: a person saves it in Lurk. Saved paused."
      },
      "ClientEventsSetting": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0,
            "description": "0 until the first save: the defaults, no row."
          },
          "daily_cap_per_person": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "description": "Most device events one person may send a day, across all names, 1 to 10,000. Default 200. Past it a device is answered rate_limited with the time to wait. The day is the project's."
          },
          "daily_cap_project": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 1000000,
            "description": "Most device events a day across all people, 1 to 1,000,000. Null: off, the default. Past it every device is answered rate_limited until the next day. It bounds the harm of many identities, each under its own per-person cap, but it is shared: one actor can use it up for every device."
          },
          "new_people_per_hour": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 1000,
            "description": "Most new people a device's first sign-in may create in each UTC clock hour, 1 to 1,000. Null, the default: a first sign-in is refused, so only people already known can sign in. Past the limit a new identity is refused with rate_limited and nothing is created. It applies whether or not any event is allowed. Each new person starts with the project's starting units, so keep it low."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientEventAllow"
            },
            "maxItems": 50,
            "description": "Empty by default: a name not here is refused as forbidden."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          },
          "updated_by": {
            "$ref": "#/components/schemas/MemberRef"
          }
        },
        "required": [
          "revision",
          "daily_cap_per_person",
          "daily_cap_project",
          "new_people_per_hour",
          "events",
          "updated_at",
          "updated_by"
        ],
        "additionalProperties": false,
        "description": "What a device may send: the event names allowed and the caps, with the revision to quote when changing it."
      },
      "ClientEventAllow": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 10000,
            "default": null,
            "description": "Most per person per day for this name, counted inside the default cap, so the lower of the two applies. Null: only the default cap."
          },
          "properties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientEventPropertyRule"
            },
            "maxItems": 50,
            "default": [],
            "description": "The properties this event may carry, each with its clamp (up to 50). There is no \"any property\" mode: the default is an empty list, so a device sends the name and nothing else. A property not listed, a null, or a list value refuses the event. 4096 bytes of properties in all is a separate limit that always applies."
          }
        },
        "required": [
          "event"
        ],
        "additionalProperties": false
      },
      "ClientEventPropertyRule": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The property's name, 1 to 64 characters. A device must send it exactly as written."
              },
              "type": {
                "type": "string",
                "enum": [
                  "string"
                ],
                "description": "The value must be text."
              },
              "max_length": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1024,
                "description": "Longest value, in characters, 1 to 1024. A longer value refuses the event."
              }
            },
            "required": [
              "name",
              "type",
              "max_length"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The property's name, 1 to 64 characters. A device must send it exactly as written."
              },
              "type": {
                "type": "string",
                "enum": [
                  "number"
                ],
                "description": "The value must be a finite number."
              },
              "min": {
                "type": "number",
                "description": "Smallest value allowed, inclusive."
              },
              "max": {
                "type": "number",
                "description": "Largest value allowed, inclusive. Not below `min`."
              }
            },
            "required": [
              "name",
              "type",
              "min",
              "max"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The property's name, 1 to 64 characters. A device must send it exactly as written."
              },
              "type": {
                "type": "string",
                "enum": [
                  "boolean"
                ],
                "description": "The value must be true or false."
              }
            },
            "required": [
              "name",
              "type"
            ],
            "additionalProperties": false
          }
        ]
      },
      "IssuerIdentity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^iid_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An issuer identity ID, starting with `iid_`."
          },
          "issuer_id": {
            "type": "string",
            "pattern": "^iss_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A trusted issuer ID, starting with `iss_`."
          },
          "person_id": {
            "type": "string",
            "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The person the binding was made for. If they were merged into someone, a credential reaches the person kept, and unmerging them gives the binding back."
          },
          "origin": {
            "type": "string",
            "enum": [
              "first_sight",
              "mapping"
            ],
            "description": "first_sight: created on the subject's first verified sign-in, as a new person in the issuer's namespace. mapping: bound by a person to an existing person."
          },
          "mapped_by": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^mem_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "description": "A member ID, starting with `mem_`."
              },
              "name": {
                "type": "string",
                "description": "The member's display name."
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The member who made a mapping; null for first_sight."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "A moment in time: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "issuer_id",
          "person_id",
          "origin",
          "mapped_by",
          "created_at",
          "last_used_at"
        ],
        "additionalProperties": false
      },
      "Proposal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The prop_… ID"
          },
          "status": {
            "$ref": "#/components/schemas/ProposalStatus"
          },
          "title": {
            "type": "string",
            "description": "A headline: Morning regular goes live"
          },
          "summary": {
            "type": "string",
            "description": "Why, as the one who asked wrote it; empty if they gave no reason"
          },
          "by": {
            "type": "string",
            "description": "Who asked: \"agent:<key id>\", \"key:<id>\", \"member:<id>\""
          },
          "via": {
            "type": "string",
            "enum": [
              "api",
              "agent",
              "lurky",
              "dashboard",
              "system"
            ],
            "description": "How it was asked for: `api`, `agent`, `lurky` or `dashboard` (`system` is not produced today)"
          },
          "agent": {
            "type": [
              "string",
              "null"
            ],
            "description": "The agent's name: Claude Code"
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProposalChange"
            },
            "minItems": 1,
            "description": "What approving runs, in order"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it stops being open if nobody decides: 7 days after it was asked for"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a person decided it: UTC, ISO 8601; null while it is open or expired"
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"member:<id>\" of the person who decided"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The person's note on their decision"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where a person decides it; null where the dashboard's address is not known"
          },
          "included_changes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "description": "0-based indices of changes that ran when approved; absent until approved"
          },
          "applied": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Target IDs of each change that ran when approved, matching included_changes in order; absent until approved"
          },
          "key_claims": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyClaimSummary"
            },
            "description": "One-time key claims created when api_keys.create was approved; absent when none"
          }
        },
        "required": [
          "id",
          "status",
          "title",
          "summary",
          "by",
          "via",
          "agent",
          "changes",
          "created_at",
          "expires_at",
          "decided_at",
          "decided_by",
          "note",
          "url"
        ],
        "description": "A change someone asked for and a person decides. Nothing in it has run until a person approves it."
      },
      "ProposalStatus": {
        "type": "string",
        "enum": [
          "open",
          "approved",
          "declined",
          "expired"
        ],
        "description": "`open` waits for a person. `approved`: a person approved it and its changes ran. `declined`: a person declined it and nothing ran. `expired`: nobody decided it within 7 days, so it can no longer be decided."
      },
      "ProposalChange": {
        "type": "object",
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/ProposableOperation"
          },
          "target": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "What kind of thing it is: rule, unit, template, audience, person or people"
              },
              "id": {
                "type": "string",
                "description": "Its ID. A template, or a unit, rule or audience that is not created yet, is named by its key or name instead"
              },
              "name": {
                "type": "string",
                "description": "Its name"
              }
            },
            "required": [
              "type",
              "id",
              "name"
            ],
            "description": "What it changes, with its ID and name"
          },
          "summary": {
            "type": "string",
            "description": "The change in words: Morning regular goes live"
          },
          "input": {
            "type": "object",
            "additionalProperties": {},
            "description": "The operation's input, as it will run"
          },
          "before": {
            "type": "object",
            "additionalProperties": {},
            "description": "The parts of the target that differ, as they are now; empty when it is new"
          },
          "after": {
            "type": "object",
            "additionalProperties": {},
            "description": "The same parts as they will be once it is approved"
          },
          "effect": {
            "type": [
              "string",
              "null"
            ],
            "description": "What approving does and does not do, said plainly: a live rule keeps running its live version until a person takes the new one live. Absent on proposals made before it existed"
          }
        },
        "required": [
          "operation",
          "target",
          "summary",
          "input",
          "before",
          "after"
        ]
      },
      "ProposableOperation": {
        "type": "string",
        "enum": [
          "rules.publish",
          "rules.resume",
          "rules.pause",
          "units.create",
          "units.update",
          "rules.create",
          "rules.update",
          "templates.install",
          "templates.remove",
          "units.give",
          "audiences.create",
          "audiences.add_users",
          "api_keys.create"
        ],
        "description": "What approving a proposal can run: taking a rule live, pausing or resuming it, creating or updating a rule, adding or taking back a template, creating or changing a unit, creating an audience, adding people to a list audience, requesting a one-time project API key claim, or giving a unit by hand (only Lurky or a member's assistant may ask for a give)."
      },
      "CreateProposalInput": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Up to 120 characters. Defaults to the first change's summary"
          },
          "summary": {
            "type": "string",
            "maxLength": 1000,
            "description": "Why, for the person who decides. Up to 1,000 characters"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "operation": {
                  "$ref": "#/components/schemas/ProposableOperation"
                },
                "input": {
                  "type": "object",
                  "additionalProperties": {},
                  "description": "That operation's input"
                }
              },
              "required": [
                "operation",
                "input"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 10,
            "description": "What to ask for: 1 to 10 changes, run in this order when a person approves. A later change can refer to a unit or rule key created by an earlier `units.create`, `rules.create` or `templates.install` in the same request (`units.create` requires `name` and `group`: `points`, `progress`, `badge` or `perk`)"
          }
        },
        "required": [
          "changes"
        ],
        "additionalProperties": false
      },
      "ProposalList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Proposal"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "waiting": {
            "type": "integer",
            "minimum": 0,
            "description": "Open proposals, for the sidebar"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor",
          "waiting"
        ]
      },
      "WaitForProposalOutput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "declined",
              "still_waiting"
            ],
            "description": "The decision, or still_waiting if the wait ended before a decision."
          },
          "included_changes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0
            },
            "description": "0-based indices of changes that ran when approved; absent unless approved."
          },
          "applied": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Target IDs of each change that ran when approved, matching included_changes in order; absent unless approved."
          },
          "key_claims": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyClaimSummary"
            },
            "description": "One-time key claims created when api_keys.create was approved; absent when none."
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": false
      },
      "HoldList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hold"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          },
          "waiting": {
            "type": "integer",
            "minimum": 0,
            "description": "Holds waiting for a person"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor",
          "waiting"
        ]
      },
      "Hold": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^hold_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A hold ID, starting with `hold_`."
          },
          "status": {
            "$ref": "#/components/schemas/HoldStatus"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it would happen to"
          },
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule_… ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule that parked it"
          },
          "event": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event that made the rule fire"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "unit": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                  "description": "The key of the unit that would change"
                },
                "change": {
                  "type": "integer",
                  "description": "Positive to give, negative to take"
                }
              },
              "required": [
                "unit",
                "change"
              ]
            },
            "description": "What the rule would do, all of it or none of it"
          },
          "reason": {
            "type": "string",
            "description": "Why it waits: 900 beans is over 500, so a person decides"
          },
          "held_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the rule parked it: UTC, ISO 8601"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a person decided it: UTC, ISO 8601; null while it waits"
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who decided: \"member:<id>\""
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The note the person left with their decision; null if none"
          },
          "activity": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receipt written when it was given"
          }
        },
        "required": [
          "id",
          "status",
          "user",
          "rule",
          "event",
          "changes",
          "reason",
          "held_at",
          "decided_at",
          "decided_by",
          "note",
          "activity"
        ],
        "description": "A firing a rule parked for a person to give or refuse. Nothing has changed for the person until it is given."
      },
      "HoldStatus": {
        "type": "string",
        "enum": [
          "held",
          "given",
          "refused"
        ],
        "description": "`held` waits for a person. `given`: a person gave it and its changes were made. `refused`: a person refused it and nothing changed. A decided hold never changes again."
      },
      "AudienceList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Audience"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Audience": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^aud_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An audience ID, starting with `aud_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The audience's key: lowercase words joined by dashes, starting with a letter, up to 64 characters. A rule or view can name the audience by it"
          },
          "name": {
            "type": "string",
            "description": "The audience's name"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the audience is for. Null when none was given"
          },
          "kind": {
            "$ref": "#/components/schemas/AudienceKind"
          },
          "conditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoredAudienceCondition"
            },
            "description": "Empty for a list audience"
          },
          "summary": {
            "type": "string",
            "description": "The conditions in words: Active on 2 or more days of the last 21, seen in the last 7 days"
          },
          "status": {
            "$ref": "#/components/schemas/AudienceStatus"
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AudienceProblem"
            },
            "description": "What is wrong with a condition, if anything. Empty when `status` is ok"
          },
          "users": {
            "type": "integer",
            "minimum": 0,
            "description": "Members now (a condition audience: as of its last refresh)"
          },
          "unknown": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "People excluded by uncertain holding evidence at the last full refresh. Null before the first refresh of a holding audience"
          },
          "refreshed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a condition audience's members were last worked out; rules see it as it stood then. Null for a list, and before the first run"
          },
          "used_by": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AudienceReader"
            },
            "description": "The rules that read it"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "description",
          "kind",
          "conditions",
          "summary",
          "status",
          "problems",
          "users",
          "refreshed_at",
          "used_by",
          "created_at"
        ]
      },
      "AudienceKind": {
        "type": "string",
        "enum": [
          "list",
          "condition"
        ],
        "description": "list: people added by hand or over the API. condition: kept up to date by its conditions"
      },
      "StoredAudienceCondition": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "active": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365,
                    "description": "At least this many different days with an event, 1 to 365"
                  },
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "Counted over this many days back from now, 1 to 730"
                  }
                },
                "required": [
                  "days",
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "Has events on at least `days` different days within the last `within_days` days"
              }
            },
            "required": [
              "active"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "first_seen": {
                "type": "object",
                "properties": {
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "How many days back, 1 to 730"
                  }
                },
                "required": [
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "Lurk first heard of the person within the last `within_days` days"
              }
            },
            "required": [
              "first_seen"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "inactive": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "For this many days, 1 to 730"
                  }
                },
                "required": [
                  "days"
                ],
                "additionalProperties": false,
                "description": "Known for longer than `days` days and without an event in the last `days` days"
              }
            },
            "required": [
              "inactive"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "balance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                    "description": "The unit's key"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "At least this much, 1 or more"
                  }
                },
                "required": [
                  "unit",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "Holds at least `gte` of a unit"
              }
            },
            "required": [
              "balance"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property_total": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                    "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
                  },
                  "property": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The name of the number property to add up, up to 64 characters"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "At least this total, 1 or more"
                  },
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "Over events in this many days back from now, 1 to 730"
                  }
                },
                "required": [
                  "event",
                  "property",
                  "gte",
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "The sum of a number property over the person's events of that name in the last `within_days` days is at least `gte`. Events without a number there add nothing. Money is in cents"
              }
            },
            "required": [
              "property_total"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_role": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "role": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The platform's ID for the role (Discord: the role's ID)"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The name to show for it (a role's or group's name). Only a label: the ID is what is matched"
                  }
                },
                "required": [
                  "community",
                  "role"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has this role in a chat community. Matched by the role's ID. A person whose roles Lurk does not know is not in the audience"
              }
            },
            "required": [
              "chat_role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_group": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "group": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The platform's ID for the group (Slack: the user group's ID)"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The name to show for it (a role's or group's name). Only a label: the ID is what is matched"
                  }
                },
                "required": [
                  "community",
                  "group"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Is in this group of a chat community. Matched by the group's ID. A person whose groups Lurk does not know is not in the audience"
              }
            },
            "required": [
              "chat_group"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_tag": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "tag": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The tag, exactly as Lurky set it (Telegram's member tag)"
                  }
                },
                "required": [
                  "community",
                  "tag"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has this tag in a chat community, as Lurky set it. A person with no known tag is not in the audience"
              }
            },
            "required": [
              "chat_tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_admin": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  }
                },
                "required": [
                  "community"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Administers a chat community (an owner or administrator). Unknown is not an admin"
              }
            },
            "required": [
              "chat_admin"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_booster": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  }
                },
                "required": [
                  "community"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Boosts a chat community. Unknown is not a booster"
              }
            },
            "required": [
              "chat_booster"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_tenure": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "At least this many days"
                  }
                },
                "required": [
                  "community",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has been in a chat community for at least N days. Counted from the date the platform gives for when they joined; where it gives none (Slack, Telegram), from when Lurky first saw them there. With neither, not in the audience"
              }
            },
            "required": [
              "chat_tenure"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "held_for": {
                "type": "object",
                "properties": {
                  "activation": {
                    "type": "string",
                    "pattern": "^oac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The on-chain activation whose contract must be held; a display-only activation may be used"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "Whole days of continuous holding, 1 to 3650; each day is exactly 86,400 seconds, ending at the scan's finalized horizon"
                  },
                  "min": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$",
                    "description": "Minimum held throughout: a positive decimal integer in smallest token units, or an NFT count across the person's counting wallets. Omit to use the activation's minimum"
                  }
                },
                "required": [
                  "activation",
                  "days"
                ],
                "additionalProperties": false,
                "description": "Continuous holding for an activation; no history before a wallet link becomes effective is counted"
              }
            },
            "required": [
              "held_for"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AudienceStatus": {
        "type": "string",
        "enum": [
          "ok",
          "broken",
          "not_synced"
        ],
        "description": "ok: nothing wrong. broken: a condition names something that is gone, so it can match nobody until it is fixed. not_synced: a chat condition's community has no state yet, so nobody can be in it yet (chat conditions are not available yet)"
      },
      "AudienceProblem": {
        "type": "object",
        "properties": {
          "condition": {
            "type": "integer",
            "minimum": 0,
            "description": "Which condition: its place in `conditions`, from 0"
          },
          "code": {
            "type": "string",
            "enum": [
              "community_removed",
              "role_gone",
              "group_gone",
              "tag_gone",
              "not_synced"
            ],
            "description": "Not available yet (chat conditions). community_removed: Lurky was taken out of the community. role_gone, group_gone, tag_gone: the platform no longer has it. not_synced: Lurk has not learned anyone's state in the community yet"
          },
          "message": {
            "type": "string",
            "description": "In words: Role no longer exists"
          }
        },
        "required": [
          "condition",
          "code",
          "message"
        ]
      },
      "AudienceReader": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "rule",
              "view"
            ],
            "description": "Whether a rule or a view reads it"
          },
          "id": {
            "type": "string",
            "description": "The rule's or view's ID"
          },
          "name": {
            "type": "string",
            "description": "The rule's or view's name"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "draft",
              "live",
              "paused",
              null
            ],
            "description": "A rule's status; null for a view"
          }
        },
        "required": [
          "type",
          "id",
          "name",
          "status"
        ]
      },
      "CreateAudienceInput": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "description": "The audience's name, 1 to 80 characters"
              },
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "Lowercase words joined by dashes, starting with a letter, up to 64 characters. Defaults to a slug of the name. Must not be taken by another audience"
              },
              "description": {
                "type": "string",
                "maxLength": 280,
                "description": "What the audience is for, up to 280 characters"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "list"
                ],
                "description": "A list: people you add by hand or over the API"
              }
            },
            "required": [
              "name",
              "kind"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "description": "The audience's name, 1 to 80 characters"
              },
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,63}$",
                "description": "Lowercase words joined by dashes, starting with a letter, up to 64 characters. Defaults to a slug of the name. Must not be taken by another audience"
              },
              "description": {
                "type": "string",
                "maxLength": 280,
                "description": "What the audience is for, up to 280 characters"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "condition"
                ],
                "description": "A condition audience: kept up to date by its conditions"
              },
              "conditions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AudienceCondition"
                },
                "minItems": 1,
                "maxItems": 10,
                "description": "1 to 10 conditions. A person is in the audience when all of them hold"
              }
            },
            "required": [
              "name",
              "kind",
              "conditions"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AudienceCondition": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "active": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365,
                    "description": "At least this many different days with an event, 1 to 365"
                  },
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "Counted over this many days back from now, 1 to 730"
                  }
                },
                "required": [
                  "days",
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "Has events on at least `days` different days within the last `within_days` days"
              }
            },
            "required": [
              "active"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "first_seen": {
                "type": "object",
                "properties": {
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "How many days back, 1 to 730"
                  }
                },
                "required": [
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "Lurk first heard of the person within the last `within_days` days"
              }
            },
            "required": [
              "first_seen"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "inactive": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "For this many days, 1 to 730"
                  }
                },
                "required": [
                  "days"
                ],
                "additionalProperties": false,
                "description": "Known for longer than `days` days and without an event in the last `days` days"
              }
            },
            "required": [
              "inactive"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "balance": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                    "description": "The unit's key"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "At least this much, 1 or more"
                  }
                },
                "required": [
                  "unit",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "Holds at least `gte` of a unit"
              }
            },
            "required": [
              "balance"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "property_total": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                    "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
                  },
                  "property": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The name of the number property to add up, up to 64 characters"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "At least this total, 1 or more"
                  },
                  "within_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 730,
                    "description": "Over events in this many days back from now, 1 to 730"
                  }
                },
                "required": [
                  "event",
                  "property",
                  "gte",
                  "within_days"
                ],
                "additionalProperties": false,
                "description": "The sum of a number property over the person's events of that name in the last `within_days` days is at least `gte`. Events without a number there add nothing. Money is in cents"
              }
            },
            "required": [
              "property_total"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_role": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "role": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The platform's ID for the role (Discord: the role's ID)"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The name to show for it (a role's or group's name). Only a label: the ID is what is matched"
                  }
                },
                "required": [
                  "community",
                  "role"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has this role in a chat community. Matched by the role's ID. A person whose roles Lurk does not know is not in the audience"
              }
            },
            "required": [
              "chat_role"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_group": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "group": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The platform's ID for the group (Slack: the user group's ID)"
                  },
                  "label": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The name to show for it (a role's or group's name). Only a label: the ID is what is matched"
                  }
                },
                "required": [
                  "community",
                  "group"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Is in this group of a chat community. Matched by the group's ID. A person whose groups Lurk does not know is not in the audience"
              }
            },
            "required": [
              "chat_group"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_tag": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "tag": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The tag, exactly as Lurky set it (Telegram's member tag)"
                  }
                },
                "required": [
                  "community",
                  "tag"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has this tag in a chat community, as Lurky set it. A person with no known tag is not in the audience"
              }
            },
            "required": [
              "chat_tag"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_admin": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  }
                },
                "required": [
                  "community"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Administers a chat community (an owner or administrator). Unknown is not an admin"
              }
            },
            "required": [
              "chat_admin"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_booster": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  }
                },
                "required": [
                  "community"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Boosts a chat community. Unknown is not a booster"
              }
            },
            "required": [
              "chat_booster"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "chat_tenure": {
                "type": "object",
                "properties": {
                  "community": {
                    "type": "string",
                    "pattern": "^intg_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The community the clause is about: the intg_… ID of the installed Discord server, Slack workspace or Telegram group"
                  },
                  "gte": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "At least this many days"
                  }
                },
                "required": [
                  "community",
                  "gte"
                ],
                "additionalProperties": false,
                "description": "Not available yet. Has been in a chat community for at least N days. Counted from the date the platform gives for when they joined; where it gives none (Slack, Telegram), from when Lurky first saw them there. With neither, not in the audience"
              }
            },
            "required": [
              "chat_tenure"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "held_for": {
                "type": "object",
                "properties": {
                  "activation": {
                    "type": "string",
                    "pattern": "^oac_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The on-chain activation whose contract must be held; a display-only activation may be used"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650,
                    "description": "Whole days of continuous holding, 1 to 3650; each day is exactly 86,400 seconds, ending at the scan's finalized horizon"
                  },
                  "min": {
                    "type": "string",
                    "maxLength": 78,
                    "pattern": "^[1-9][0-9]*$",
                    "description": "Minimum held throughout: a positive decimal integer of at most 78 digits in smallest token units, or an NFT count across the person's counting wallets. Omit to use the activation's minimum"
                  }
                },
                "required": [
                  "activation",
                  "days"
                ],
                "additionalProperties": false,
                "description": "Continuous holding for an activation; no history before a wallet link becomes effective is counted"
              }
            },
            "required": [
              "held_for"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AddAudienceUsersOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^aud_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "An audience ID, starting with `aud_`."
          },
          "added": {
            "type": "integer",
            "minimum": 0,
            "description": "How many people this call added"
          },
          "already_in": {
            "type": "integer",
            "minimum": 0,
            "description": "How many of the people sent were already in it"
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs that matched no user. Nothing is created for them"
          },
          "users": {
            "type": "integer",
            "minimum": 0,
            "description": "The audience's size now"
          }
        },
        "required": [
          "id",
          "added",
          "already_in",
          "not_found",
          "users"
        ]
      },
      "BudgetList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Budget"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Budget": {
        "type": "object",
        "properties": {
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule_… ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule the budget belongs to"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The key of the unit the budget caps"
          },
          "amount": {
            "type": "integer",
            "description": "The cap for one window"
          },
          "per": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ],
            "description": "How long a window lasts"
          },
          "used": {
            "type": "integer",
            "minimum": 0,
            "description": "Given so far in this window"
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "description": "The window the numbers are for, in the project's time zone"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "description": "When the window the numbers are for ends"
          }
        },
        "required": [
          "rule",
          "unit",
          "amount",
          "per",
          "used",
          "window_start",
          "window_end"
        ]
      },
      "FeedList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedItem"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "FeedItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FeedGiven"
          },
          {
            "$ref": "#/components/schemas/FeedSkipped"
          },
          {
            "$ref": "#/components/schemas/FeedHeld"
          },
          {
            "$ref": "#/components/schemas/FeedEffect"
          },
          {
            "$ref": "#/components/schemas/FeedMirror"
          }
        ],
        "discriminator": {
          "propertyName": "kind",
          "mapping": {
            "given": "#/components/schemas/FeedGiven",
            "skipped": "#/components/schemas/FeedSkipped",
            "held": "#/components/schemas/FeedHeld",
            "effect": "#/components/schemas/FeedEffect",
            "mirror": "#/components/schemas/FeedMirror"
          }
        }
      },
      "FeedGiven": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The act_… ID"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was made: ISO 8601, UTC"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person: an email, a user ID"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it happened to"
          },
          "by": {
            "type": "string",
            "description": "Who acted: \"rule:<key>\" for rules"
          },
          "via": {
            "type": "string",
            "enum": [
              "api",
              "agent",
              "lurky",
              "dashboard",
              "system",
              "chat",
              "device"
            ],
            "description": "How the change arrived: `api` (a project key), `agent`, `lurky`, `dashboard` (a signed-in member) or `system` (Lurk itself, such as an expiry or a schedule), `device` (a person signing in, where device sign-in is switched on) or `chat` (not available yet)"
          },
          "agent": {
            "type": [
              "string",
              "null"
            ],
            "description": "The agent's name when an agent or Lurky acted"
          },
          "event": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event it came from; null for a change made by hand or by a schedule"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityLine"
            },
            "description": "One for each unit the receipt changed"
          },
          "reverses": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receipt this one undoes"
          },
          "reversed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receipt that undid this one"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the person wrote when they gave by hand, or the reason on a spend; null otherwise"
          },
          "cause": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "spend",
              "use",
              "send",
              "receive",
              null
            ],
            "description": "`spend` for value a brand took in exchange for something, `use` for something a person redeemed, `send` and `receive` for the two sides of one unit moving between people; null for a rule's change, a give or an undo"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand's own redemption or order ID on a spend; null otherwise"
          },
          "transfer": {
            "type": [
              "string",
              "null"
            ],
            "description": "On the two receipts of one `units.send`: the same ID on both, the sender's receipt ID. Null otherwise"
          },
          "kind": {
            "type": "string",
            "enum": [
              "given"
            ],
            "description": "Always `given`: a receipt"
          }
        },
        "required": [
          "id",
          "at",
          "user",
          "by",
          "via",
          "agent",
          "event",
          "lines",
          "reverses",
          "reversed_by",
          "note",
          "cause",
          "reference",
          "transfer",
          "kind"
        ]
      },
      "FeedSkipped": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "skipped"
            ],
            "description": "Always `skipped`: a rule heard an event and did nothing"
          },
          "id": {
            "type": "string",
            "pattern": "^skip_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A skip ID, starting with `skip_`."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the rule heard the event"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it happened to"
          },
          "by": {
            "type": "string",
            "description": "The rule: \"rule:<key>\""
          },
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule_… ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule that acted"
          },
          "event": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event it came from"
          },
          "reason": {
            "type": "string",
            "enum": [
              "condition_failed",
              "condition_unknown",
              "limit_reached",
              "insufficient_balance",
              "unit_setting",
              "hold_refused",
              "budget_reached",
              "supply_gone"
            ],
            "description": "condition_unknown: the holding could not be confirmed, so the rule does not fire and is not retried. unit_setting: a unit's own setting stopped it (it cannot go up or down, or the change would pass its cap). hold_refused: a person refused the change a rule had held. budget_reached: the rule has given all its budget for this window. supply_gone: a unit with a limited supply has none left for the change"
          },
          "check": {
            "type": "string",
            "description": "The check that stopped it: limit, budget, audience, unit…"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "user",
          "by",
          "rule",
          "event",
          "reason",
          "check"
        ]
      },
      "FeedHeld": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "held"
            ],
            "description": "Always `held`: a change waiting for a person"
          },
          "id": {
            "type": "string",
            "pattern": "^hold_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A hold ID, starting with `hold_`."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was held"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it happened to"
          },
          "by": {
            "type": "string",
            "description": "The rule: \"rule:<key>\""
          },
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule_… ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule that acted"
          },
          "event": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event it came from"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "unit": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                  "description": "The key of the unit that would change"
                },
                "change": {
                  "type": "integer",
                  "description": "Positive for giving, negative for taking"
                }
              },
              "required": [
                "unit",
                "change"
              ]
            },
            "description": "What would change once a person gives it"
          },
          "reason": {
            "type": "string",
            "description": "Why it waits: 900 beans is over 500, so a person decides"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "user",
          "by",
          "rule",
          "event",
          "changes",
          "reason"
        ]
      },
      "FeedEffect": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "effect"
            ],
            "description": "Not available yet. Always `effect`: what a rule did in a chat platform"
          },
          "id": {
            "type": "string",
            "pattern": "^eff_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The effect's ID; for a digest, its first firing's"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the first firing in it happened"
          },
          "user": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it is about, for a message; null for a post (a digest has many people)"
          },
          "by": {
            "type": "string",
            "description": "The rule: \"rule:<key>\""
          },
          "rule": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule_… ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule that acted"
          },
          "event": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The evt_… ID"
              },
              "name": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "The event of the first firing; null for a schedule"
          },
          "effect": {
            "type": "string",
            "enum": [
              "post",
              "dm"
            ],
            "description": "`post`: one message in a channel for everything the rule fired in a window. `dm`: a message to one person"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "held",
              "sent",
              "failed",
              "skipped"
            ],
            "description": "pending: waiting for its window to close or its turn. held: waits for a person to give the hold. sent. failed: Lurky could not do it (see `detail`). skipped: never done on purpose (see `detail`)"
          },
          "firings": {
            "type": "integer",
            "minimum": 1,
            "description": "How many times the rule fired into this one post (the `{count}`)"
          },
          "summary": {
            "type": "string",
            "description": "In words: \"Posted in #general by Daily thanks\""
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed or was skipped, in a sentence a person can act on; null otherwise. A post or message cannot be recalled once sent"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "user",
          "by",
          "rule",
          "event",
          "effect",
          "status",
          "firings",
          "summary",
          "detail"
        ]
      },
      "FeedMirror": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "mirror"
            ],
            "description": "Not available yet. Always `mirror`: a role, group or tag Lurky gave or took back"
          },
          "id": {
            "type": "string",
            "pattern": "^mch_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The change's ID"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the change was made"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person who got it or lost it"
          },
          "by": {
            "type": "string",
            "description": "The mirror: \"mirror:<mir_… ID>\""
          },
          "mirror": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^mir_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "description": "A mirror ID, starting with `mir_`."
              },
              "label": {
                "type": "string",
                "description": "The mirror's name, such as the role it keeps true"
              }
            },
            "required": [
              "id",
              "label"
            ],
            "description": "The mirror that made the change"
          },
          "connector": {
            "type": "string",
            "description": "The platform: discord, slack or telegram"
          },
          "action": {
            "type": "string",
            "enum": [
              "given",
              "taken"
            ],
            "description": "given: Lurky gave it. taken: Lurky took it back"
          },
          "summary": {
            "type": "string",
            "description": "In words: \"Role Regular removed on Discord\""
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why: what the person holds, against the threshold"
          }
        },
        "required": [
          "kind",
          "id",
          "at",
          "user",
          "by",
          "mirror",
          "connector",
          "action",
          "summary",
          "detail"
        ]
      },
      "TemplateList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSummary"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "TemplateSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The template's key, which you can use in place of its ID"
          },
          "name": {
            "type": "string",
            "description": "The name people see"
          },
          "tagline": {
            "type": "string",
            "description": "One line: A reason to come back every day."
          },
          "for": {
            "type": "string",
            "description": "Who it suits, in words: Cafés, gyms, habit apps"
          },
          "category": {
            "$ref": "#/components/schemas/TemplateCategory"
          },
          "status": {
            "$ref": "#/components/schemas/TemplateStatus"
          },
          "counts": {
            "type": "object",
            "properties": {
              "units": {
                "type": "integer",
                "minimum": 0,
                "description": "Units it adds"
              },
              "rules": {
                "type": "integer",
                "minimum": 0,
                "description": "Rules it adds"
              },
              "views": {
                "type": "integer",
                "minimum": 0,
                "description": "Views it adds"
              }
            },
            "required": [
              "units",
              "rules",
              "views"
            ],
            "description": "How much it adds"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "tagline",
          "for",
          "category",
          "status",
          "counts"
        ]
      },
      "TemplateCategory": {
        "type": "string",
        "enum": [
          "earn_and_spend",
          "progress",
          "growth_and_community"
        ],
        "description": "The group the catalog shows the template in"
      },
      "TemplateStatus": {
        "type": "string",
        "enum": [
          "available",
          "in_use",
          "later"
        ],
        "description": "available: can be added. in_use: already added to this project"
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The template's key, which you can use in place of its ID"
          },
          "name": {
            "type": "string",
            "description": "The name people see"
          },
          "tagline": {
            "type": "string",
            "description": "One line: A reason to come back every day."
          },
          "for": {
            "type": "string",
            "description": "Who it suits, in words: Cafés, gyms, habit apps"
          },
          "category": {
            "$ref": "#/components/schemas/TemplateCategory"
          },
          "status": {
            "$ref": "#/components/schemas/TemplateStatus"
          },
          "counts": {
            "type": "object",
            "properties": {
              "units": {
                "type": "integer",
                "minimum": 0,
                "description": "Units it adds"
              },
              "rules": {
                "type": "integer",
                "minimum": 0,
                "description": "Rules it adds"
              },
              "views": {
                "type": "integer",
                "minimum": 0,
                "description": "Views it adds"
              }
            },
            "required": [
              "units",
              "rules",
              "views"
            ],
            "description": "How much it adds"
          },
          "description": {
            "type": "string",
            "description": "What it sets up, in words"
          },
          "adds": {
            "type": "object",
            "properties": {
              "units": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                      "description": "The key it will have"
                    },
                    "name": {
                      "type": "string",
                      "description": "The name people see"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ]
                },
                "description": "Units it adds"
              },
              "rules": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                      "description": "The key it will have"
                    },
                    "name": {
                      "type": "string",
                      "description": "The name people see"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ]
                },
                "description": "Rules it adds. They arrive as drafts"
              },
              "views": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,63}$",
                      "description": "The key it will have"
                    },
                    "name": {
                      "type": "string",
                      "description": "The name people see"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ]
                },
                "description": "Views it adds"
              }
            },
            "required": [
              "units",
              "rules",
              "views"
            ],
            "description": "What adding it creates"
          },
          "settings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TemplateSetting"
            },
            "description": "The settings you can change when you add it"
          },
          "installed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was added to this project, as an instant; null if it has not been"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "tagline",
          "for",
          "category",
          "status",
          "counts",
          "description",
          "adds",
          "settings",
          "installed_at"
        ]
      },
      "TemplateSetting": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The key to send in `settings`"
          },
          "label": {
            "type": "string",
            "description": "What the setting is called, in words"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "integer",
              "unit"
            ],
            "description": "text: 1 to 40 characters. integer: a whole number, 1 to 1,000,000. unit: the key of a unit, 1 to 40 characters"
          },
          "default": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": "The value used when you send none"
          }
        },
        "required": [
          "key",
          "label",
          "type",
          "default"
        ]
      },
      "PlanTemplateOutput": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The key it would have"
                },
                "name": {
                  "type": "string",
                  "description": "The name people would see"
                },
                "exists": {
                  "type": "boolean",
                  "description": "Already in the project: it's reused, not added again"
                }
              },
              "required": [
                "key",
                "name",
                "exists"
              ]
            },
            "description": "Units it would add or reuse"
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The key it would have"
                },
                "name": {
                  "type": "string",
                  "description": "The name people would see"
                },
                "exists": {
                  "type": "boolean",
                  "description": "Already in the project: it's reused, not added again"
                },
                "conflict": {
                  "type": "boolean",
                  "description": "A different rule already has this key, so the template can't be added. False when the rule is new, or is the same one another template added"
                }
              },
              "required": [
                "key",
                "name",
                "exists",
                "conflict"
              ]
            },
            "description": "Rules it would add as drafts, reuse, or refuse"
          },
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The key it would have"
                },
                "name": {
                  "type": "string",
                  "description": "The name people would see"
                },
                "exists": {
                  "type": "boolean",
                  "description": "Already in the project: it's reused, not added again"
                }
              },
              "required": [
                "key",
                "name",
                "exists"
              ]
            },
            "description": "Views it would add or reuse"
          },
          "test_week": {
            "type": "object",
            "properties": {
              "users": {
                "type": "integer",
                "minimum": 0,
                "description": "Made-up users the week ran with"
              },
              "events": {
                "type": "integer",
                "minimum": 0,
                "description": "Events the made-up users sent"
              },
              "receipts": {
                "type": "integer",
                "minimum": 0,
                "description": "Events that changed a balance. A change that waits for a person is not counted"
              },
              "given": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "unit": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                      "description": "The unit's key"
                    },
                    "amount": {
                      "type": "integer",
                      "description": "The total given"
                    }
                  },
                  "required": [
                    "unit",
                    "amount"
                  ]
                },
                "description": "What the rules gave, per unit. Takes are not counted"
              },
              "skipped": {
                "type": "integer",
                "minimum": 0,
                "description": "Times a rule heard an event and did nothing"
              }
            },
            "required": [
              "users",
              "events",
              "receipts",
              "given",
              "skipped"
            ],
            "description": "A simulated week through the real engine. Nothing is written"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What a person should check, in words"
          }
        },
        "required": [
          "template",
          "units",
          "rules",
          "views",
          "test_week",
          "notes"
        ]
      },
      "InstallTemplateOutput": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "installed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was added, as an instant"
          },
          "units": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^unit_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A unit ID, starting with `unit_`."
                },
                "key": {
                  "type": "string",
                  "description": "Its key"
                },
                "name": {
                  "type": "string",
                  "description": "The name people see"
                }
              },
              "required": [
                "id",
                "key",
                "name"
              ]
            },
            "description": "Its units, added or reused"
          },
          "rules": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^rule_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A rule ID, starting with `rule_`."
                },
                "key": {
                  "type": "string",
                  "description": "Its key"
                },
                "name": {
                  "type": "string",
                  "description": "The name people see"
                }
              },
              "required": [
                "id",
                "key",
                "name"
              ]
            },
            "description": "Drafts: a person takes them live. A rule another template already added, with exactly the same definition, is listed as it is and may be live"
          },
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^view_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A view ID, starting with `view_`."
                },
                "key": {
                  "type": "string",
                  "description": "Its key"
                },
                "name": {
                  "type": "string",
                  "description": "The name people see"
                }
              },
              "required": [
                "id",
                "key",
                "name"
              ]
            },
            "description": "Its views, added or reused"
          },
          "dashboards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^dash_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A dashboard ID, starting with `dash_`."
                },
                "name": {
                  "type": "string",
                  "description": "The dashboard's name"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "The template's dashboard when it brought new views or Home was empty (placed on Home when the project had no Home dashboard yet)"
          }
        },
        "required": [
          "template",
          "installed_at",
          "units",
          "rules",
          "views",
          "dashboards"
        ]
      },
      "RemoveTemplateOutput": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "removed_rules": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^rule_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "A rule ID, starting with `rule_`."
            },
            "description": "Its draft rules, removed with it"
          },
          "kept": {
            "type": "object",
            "properties": {
              "rules": {
                "type": "integer",
                "minimum": 0,
                "description": "Rules kept"
              },
              "units": {
                "type": "integer",
                "minimum": 0,
                "description": "Units kept"
              },
              "views": {
                "type": "integer",
                "minimum": 0,
                "description": "Views kept"
              }
            },
            "required": [
              "rules",
              "units",
              "views"
            ],
            "description": "Live rules, units and views stay, and so does everything users earned"
          }
        },
        "required": [
          "template",
          "removed_rules",
          "kept"
        ]
      },
      "GivePreview": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "What each person gets (or would get)"
          },
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GiveLine"
            },
            "description": "One line for each person found, in ID order"
          },
          "not_found": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "IDs that matched nobody. Nothing is created for them"
          },
          "totals": {
            "type": "object",
            "properties": {
              "people": {
                "type": "integer",
                "minimum": 0,
                "description": "Who gets it (or would)"
              },
              "skipped": {
                "type": "integer",
                "minimum": 0,
                "description": "Who the unit's settings stop"
              },
              "units": {
                "type": "integer",
                "minimum": 0,
                "description": "The total given (or that would be)"
              }
            },
            "required": [
              "people",
              "skipped",
              "units"
            ],
            "description": "Counts for the whole give"
          },
          "budget": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "rule": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The rule's rule_… ID"
                  },
                  "key": {
                    "type": "string",
                    "description": "The rule's key"
                  },
                  "name": {
                    "type": "string",
                    "description": "The rule's name"
                  }
                },
                "required": [
                  "id",
                  "key",
                  "name"
                ],
                "description": "The rule whose budget the give is counted in"
              },
              "per": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month"
                ],
                "description": "How long the budget lasts before it starts again, in the project's time zone"
              },
              "max": {
                "type": "integer",
                "description": "The most the budget allows in that time"
              },
              "used_before": {
                "type": "integer",
                "minimum": 0,
                "description": "Already used in the current period"
              },
              "used_after": {
                "type": "integer",
                "minimum": 0,
                "description": "With this give counted"
              }
            },
            "required": [
              "rule",
              "per",
              "max",
              "used_before",
              "used_after"
            ],
            "description": "Set when the give is counted against a rule's budget"
          }
        },
        "required": [
          "unit",
          "amount",
          "people",
          "not_found",
          "totals",
          "budget"
        ]
      },
      "GiveLine": {
        "type": "object",
        "properties": {
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person"
          },
          "status": {
            "type": "string",
            "enum": [
              "given",
              "would_give",
              "skipped"
            ],
            "description": "given: they got it. would_give: they would get it (a preview). skipped: the unit's settings stop it, and `reason` says why"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why they were skipped: beans would be 1,100, past its cap of 1,000"
          },
          "balance_after": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What they hold after, or would hold in a preview. Null when skipped"
          },
          "activity": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "Their receipt, once given"
          }
        },
        "required": [
          "user",
          "status",
          "reason",
          "balance_after",
          "activity"
        ]
      },
      "GiveUnitsInput": {
        "type": "object",
        "properties": {
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit to give: its key"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "description": "What each person gets"
          },
          "users": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "minItems": 1,
            "maxItems": 200,
            "description": "usr_… IDs or the brand's own IDs, up to 200 at a time"
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "Written on every receipt"
          },
          "count_against": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "A rule (ID or key) with a budget in this unit: the give is counted in it and refused if it would pass it"
          }
        },
        "required": [
          "unit",
          "amount",
          "users"
        ],
        "additionalProperties": false
      },
      "SpendUnitsOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receipt's act_… ID, as the audit log names it"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it was taken from"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "What was taken"
          },
          "balance_after": {
            "type": "integer",
            "description": "What the person holds now"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reference it was spent under"
          }
        },
        "required": [
          "id",
          "user",
          "unit",
          "amount",
          "balance_after",
          "reference"
        ],
        "examples": [
          {
            "id": "act_01m6p4qj0gev1rx6h7tqtbhj53",
            "user": {
              "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
              "external_id": "ana@example.com"
            },
            "unit": "points",
            "amount": 100,
            "balance_after": 69,
            "reference": "redeem-5521"
          }
        ]
      },
      "SpendUnitsInput": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The person: a usr_… ID or the brand's own ID"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit to take: its key"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "description": "How much to take"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "What it was for, written on the receipt: Free coffee"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The brand's own redemption or order ID. It can be used once per unit: a second spend with it is refused with `reference_used`. Matching is exact and case-sensitive (`ORD-1` and `ord-1` are two), after the text is put in Unicode NFC form"
          }
        },
        "required": [
          "user",
          "unit",
          "amount",
          "reason"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "user": "ana@example.com",
            "unit": "points",
            "amount": 100,
            "reason": "Free coffee",
            "reference": "redeem-5521"
          }
        ]
      },
      "SendUnitsOutput": {
        "type": "object",
        "properties": {
          "transfer": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The sender's receipt ID, also on the receiver's receipt"
          },
          "receipt": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receiver's receipt ID"
          },
          "from": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              },
              "balance_after": {
                "type": "integer",
                "description": "What they hold now"
              }
            },
            "required": [
              "id",
              "external_id",
              "balance_after"
            ],
            "description": "The sender"
          },
          "to": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              },
              "balance_after": {
                "type": "integer",
                "description": "What they hold now"
              }
            },
            "required": [
              "id",
              "external_id",
              "balance_after"
            ],
            "description": "The receiver"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "What was sent"
          },
          "sent_today": {
            "type": "integer",
            "description": "What the sender has sent of this unit today, with this send"
          },
          "daily_limit": {
            "type": "integer",
            "description": "What one person may send of it in a day"
          }
        },
        "required": [
          "transfer",
          "receipt",
          "from",
          "to",
          "unit",
          "amount",
          "sent_today",
          "daily_limit"
        ],
        "examples": [
          {
            "transfer": "act_01m6pajz2re7a8y2srwtjwkpdm",
            "receipt": "act_01m6pajz2rebjrm729yyvdnr65",
            "from": {
              "id": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
              "external_id": "ana@example.com",
              "balance_after": 144
            },
            "to": {
              "id": "usr_01m40d9ax0e2vrtmq9mk0z6t00",
              "external_id": "ben@example.com",
              "balance_after": 110
            },
            "unit": "points",
            "amount": 25,
            "sent_today": 25,
            "daily_limit": 100
          }
        ]
      },
      "SendUnitsInput": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The sender: a usr_… ID or the brand's own ID"
          },
          "to": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The receiver: a usr_… ID or the brand's own ID"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit to send: its key"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "description": "How much to send"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "A note both receipts carry: A thank-you"
          }
        },
        "required": [
          "from",
          "to",
          "unit",
          "amount"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "from": "ana@example.com",
            "to": "ben@example.com",
            "unit": "points",
            "amount": 25,
            "reason": "Thanks"
          }
        ]
      },
      "UseUnitsOutput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "The receipt's act_… ID, as the audit log names it"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The usr_… ID"
              },
              "external_id": {
                "type": "string",
                "description": "The brand's own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person it was taken from"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key"
          },
          "amount": {
            "type": "integer",
            "description": "How many were used"
          },
          "balance_after": {
            "type": "integer",
            "description": "What the person holds now"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reference it was spent under"
          }
        },
        "required": [
          "id",
          "user",
          "unit",
          "amount",
          "balance_after",
          "reference"
        ],
        "examples": [
          {
            "id": "act_01m6rdz548efv8pbat133yqwep",
            "user": {
              "id": "usr_01m40d9ax0e2vrtmq9mk0z6t00",
              "external_id": "ben@example.com"
            },
            "unit": "coffee-voucher",
            "amount": 1,
            "balance_after": 1,
            "reference": "scan-20931"
          }
        ]
      },
      "UseUnitsInput": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "The person: a usr_… ID or the brand's own ID"
          },
          "unit": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit to use: its key"
          },
          "amount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 1000000,
            "default": 1,
            "description": "How many to use. One by default"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 280,
            "description": "Where or why, written on the receipt: Table 4. `Used` when left out"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "The brand's own scan or redemption ID. It can be used once per unit: a second use with it is refused with `reference_used`. Matching is exact and case-sensitive, after the text is put in Unicode NFC form"
          }
        },
        "required": [
          "user",
          "unit"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "user": "ben@example.com",
            "unit": "coffee-voucher",
            "amount": 1,
            "reason": "Table 4",
            "reference": "scan-20931"
          }
        ]
      },
      "ViewList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewSummary"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "ViewSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^view_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A view ID, starting with `view_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The view's key, unique in the project: lowercase words joined by dashes. It stands in for the ID in paths"
          },
          "name": {
            "type": "string",
            "description": "The view's name"
          },
          "shape": {
            "type": "string",
            "enum": [
              "number",
              "over_time",
              "list"
            ],
            "description": "How its answer comes back, the type of its `definition.shape`"
          },
          "visibility": {
            "$ref": "#/components/schemas/ViewVisibility"
          },
          "conversion": {
            "type": "boolean",
            "description": "Whether this view is a conversion: something you want people to do. Only a view that counts one named event can be one."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "shape",
          "visibility",
          "conversion",
          "updated_at"
        ],
        "description": "A saved view without its definition"
      },
      "ViewVisibility": {
        "type": "string",
        "enum": [
          "team"
        ],
        "description": "Who can see the view. Only `team` exists: the project's members"
      },
      "ViewWithAnswer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^view_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A view ID, starting with `view_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The view's key, unique in the project: lowercase words joined by dashes. It stands in for the ID in paths"
          },
          "name": {
            "type": "string",
            "description": "The view's name"
          },
          "shape": {
            "type": "string",
            "enum": [
              "number",
              "over_time",
              "list"
            ],
            "description": "How its answer comes back, the type of its `definition.shape`"
          },
          "visibility": {
            "$ref": "#/components/schemas/ViewVisibility"
          },
          "conversion": {
            "type": "boolean",
            "description": "Whether this view is a conversion: something you want people to do. Only a view that counts one named event can be one."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A note about the view; null if it has none"
          },
          "definition": {
            "$ref": "#/components/schemas/ViewDefinition"
          },
          "endpoint": {
            "type": "string",
            "description": "Where it answers: /v1/views/returning-users"
          },
          "made_by": {
            "type": "string",
            "enum": [
              "template",
              "member",
              "key",
              "agent"
            ],
            "description": "Who saved it: a `template` installed, a `member` in the dashboard, a project `key`, or an `agent`"
          },
          "template": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "dashboards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^dash_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A dashboard ID, starting with `dash_`."
                },
                "name": {
                  "type": "string",
                  "description": "The dashboard's name"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "The dashboards that show this view"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          },
          "answer": {
            "$ref": "#/components/schemas/ViewAnswer"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "shape",
          "visibility",
          "conversion",
          "updated_at",
          "description",
          "definition",
          "endpoint",
          "made_by",
          "template",
          "dashboards",
          "created_at",
          "answer"
        ]
      },
      "ViewDefinition": {
        "type": "object",
        "properties": {
          "who": {
            "$ref": "#/components/schemas/ViewWho"
          },
          "what": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewMeasure"
            },
            "minItems": 1,
            "maxItems": 4,
            "description": "What to count: 1 to 4 measures. A list ranks by the first and shows the others as columns"
          },
          "over": {
            "$ref": "#/components/schemas/ViewRange"
          },
          "shape": {
            "$ref": "#/components/schemas/ViewShape"
          },
          "source": {
            "type": "string",
            "enum": [
              "trusted",
              "platform",
              "onchain",
              "web_identified",
              "any"
            ],
            "description": "Whose events this view counts. Left out is the same as platform: trusted and chat platform events (chat is not available yet). trusted: only your server, an agent or a person in Lurk. onchain: only Lurk's on-chain observations (not available yet). web_identified: server-verified web identification (not available yet). any: all sources; devices, on-chain observations and web identification are not available yet. Units given, spent and held, and new people are counted whatever this says"
          }
        },
        "required": [
          "who",
          "what",
          "over",
          "shape"
        ],
        "additionalProperties": false,
        "description": "The question: whose numbers, what to count, over which range, as which shape"
      },
      "ViewWho": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "everyone"
            ]
          },
          {
            "type": "object",
            "properties": {
              "audience": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "description": "An aud_… ID or the audience's key"
              }
            },
            "required": [
              "audience"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Whose numbers: `everyone`, or the people of one audience"
      },
      "ViewMeasure": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "measure": {
                "type": "string",
                "enum": [
                  "active_users",
                  "returning_users",
                  "new_users"
                ],
                "description": "`active_users`: people with an event in the range. `returning_users`: those of them first seen before the range. `new_users`: people first seen in the range"
              }
            },
            "required": [
              "measure"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "measure": {
                "type": "string",
                "enum": [
                  "events"
                ],
                "description": "Count events"
              },
              "event": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
                "description": "Leave it out to count every event"
              },
              "where": {
                "type": "object",
                "properties": {
                  "property": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "description": "The property's name, as the event carries it (`plan`)"
                  },
                  "equals": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 256
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      }
                    ],
                    "description": "The value it must have, compared exactly as text: 5 and `\"5\"` match each other, `Pro` and `pro` do not"
                  }
                },
                "required": [
                  "property",
                  "equals"
                ],
                "additionalProperties": false,
                "description": "Only the events whose property has this value. Needs a named event."
              }
            },
            "required": [
              "measure"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "measure": {
                "type": "string",
                "enum": [
                  "given",
                  "spent",
                  "held"
                ],
                "description": "`given`: units added in the range. `spent`: units taken, as a positive number. `held`: what everyone holds at the end of the range"
              },
              "unit": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{0,63}$",
                "description": "The unit's key"
              }
            },
            "required": [
              "measure",
              "unit"
            ],
            "additionalProperties": false
          }
        ],
        "description": "One thing to count. Each becomes one series in the answer"
      },
      "ViewRange": {
        "type": "string",
        "enum": [
          "now",
          "today",
          "this_week",
          "last_week",
          "last_7_days",
          "last_14_days",
          "last_30_days",
          "last_90_days",
          "this_month",
          "all_time"
        ],
        "description": "The span a view covers, in the project's time zone; a week is Monday to Sunday. `now` is a moment, so only `held` can be read for it"
      },
      "ViewShape": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "number"
                ],
                "description": "One number for each measure"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "over_time"
                ],
                "description": "A series for each measure, one point per `every`"
              },
              "every": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month"
                ],
                "description": "How long each point covers"
              }
            },
            "required": [
              "type",
              "every"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "list"
                ],
                "description": "A ranked list, best first"
              },
              "by": {
                "type": "string",
                "enum": [
                  "user",
                  "rule",
                  "property"
                ],
                "description": "Rank users, rank rules, or rank the values of one property of the event counted"
              },
              "property": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "With `by: property`: the property's name, as the event carries it (`path`, `target`). A value that looks personal is counted under one row, Hidden (a best-effort check, not a guarantee: ranked values are as readable as a person's history)"
              },
              "size": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "How many rows"
              }
            },
            "required": [
              "type",
              "by",
              "size"
            ],
            "additionalProperties": false
          }
        ],
        "description": "How the answer comes back: a number, a series over time, or a ranked list"
      },
      "ViewAnswer": {
        "type": "object",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/Period"
          },
          "compared_with": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Period"
              },
              {
                "type": [
                  "object",
                  "null"
                ]
              }
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewSeries"
            },
            "description": "One entry for each measure, in the order asked"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewRow"
            },
            "description": "Empty unless the shape is list"
          },
          "total_rows": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "How many rows a list has in all"
          },
          "computed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this answer was computed"
          }
        },
        "required": [
          "period",
          "compared_with",
          "series",
          "rows",
          "total_rows",
          "computed_at"
        ],
        "description": "The view's numbers for a span, computed from the project's data when asked. `compared_with` is the span of the same length just before `period`, or null when the call did not ask for it or the view reads over now"
      },
      "Period": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the span, included"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "The end of the span, not included"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "description": "A date range: from is inclusive, to is exclusive"
      },
      "ViewSeries": {
        "type": "object",
        "properties": {
          "measure": {
            "$ref": "#/components/schemas/ViewMeasure"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z][a-z0-9_-]{0,63}$",
            "description": "The unit's key for given, spent and held; null for the rest"
          },
          "total": {
            "type": "integer",
            "description": "The whole range: a sum for flows, what is held at its end, unique people for people"
          },
          "previous_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The same over the compared range; null unless `compare` was asked for and the range is not `now`"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewPoint"
            },
            "description": "Empty unless the shape is over_time"
          },
          "previous_points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewPoint"
            },
            "description": "The compared range, aligned to points"
          }
        },
        "required": [
          "measure",
          "unit",
          "total",
          "previous_total",
          "points",
          "previous_points"
        ]
      },
      "ViewPoint": {
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the bucket starts"
          },
          "value": {
            "type": "integer",
            "description": "The measure's value for the bucket"
          }
        },
        "required": [
          "at",
          "value"
        ]
      },
      "ViewRow": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "description": "1 for the top row. In a list by property, rows with equal values share a rank"
          },
          "label": {
            "type": "string",
            "description": "What a person reads: a user's identifier, a rule's name, a property's value"
          },
          "user": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The person's `usr_…` ID"
              },
              "external_id": {
                "type": "string",
                "description": "Your own identifier for the person"
              }
            },
            "required": [
              "id",
              "external_id"
            ],
            "description": "The person, in a list of people; null otherwise"
          },
          "rule": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The rule's `rule_…` ID"
              },
              "key": {
                "type": "string",
                "description": "The rule's key"
              },
              "name": {
                "type": "string",
                "description": "The rule's name"
              }
            },
            "required": [
              "id",
              "key",
              "name"
            ],
            "description": "The rule, in a list of rules; null otherwise"
          },
          "property": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "value": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The value, as text; null for the row that counts the hidden ones"
              }
            },
            "required": [
              "value"
            ],
            "description": "Set in a list by property"
          },
          "value": {
            "type": "integer",
            "description": "The first measure"
          },
          "previous_rank": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Rank in the compared range"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "One per measure"
          }
        },
        "required": [
          "rank",
          "label",
          "user",
          "rule",
          "property",
          "value",
          "previous_rank",
          "values"
        ]
      },
      "PreviewViewAnswer": {
        "type": "object",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/Period"
          },
          "compared_with": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Period"
              },
              {
                "type": [
                  "object",
                  "null"
                ]
              }
            ]
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewSeries"
            },
            "description": "One entry for each measure, in the order asked"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewRow"
            },
            "description": "Empty unless the shape is list"
          },
          "total_rows": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "How many rows a list has in all"
          },
          "computed_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this answer was computed"
          },
          "steps": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/FunnelStepAnswer"
            },
            "description": "Set for a funnel"
          }
        },
        "required": [
          "period",
          "compared_with",
          "series",
          "rows",
          "total_rows",
          "computed_at",
          "steps"
        ]
      },
      "FunnelStepAnswer": {
        "type": "object",
        "properties": {
          "step": {
            "$ref": "#/components/schemas/FunnelStep"
          },
          "people": {
            "type": "integer",
            "minimum": 0,
            "description": "People who did this step and every one before it, in order, in time"
          },
          "previous_people": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "The same over the compared range; null without compare"
          },
          "median_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Typical time from the step before, in whole seconds rounded down; null for the first step and when nobody reached this one"
          }
        },
        "required": [
          "step",
          "people",
          "previous_people",
          "median_seconds"
        ]
      },
      "FunnelStep": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ViewStep"
          },
          {
            "$ref": "#/components/schemas/RewardStep"
          }
        ],
        "description": "One step: an event, optionally narrowed by one property, or the first reward as the last step"
      },
      "ViewStep": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string",
            "maxLength": 100,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
            "description": "An event's name: lowercase words joined by dots, thing first, such as `checkin.scanned`"
          },
          "where": {
            "type": "object",
            "properties": {
              "property": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "The property's name, as the event carries it (`plan`)"
              },
              "equals": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 256
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ],
                "description": "The value it must have, compared exactly as text: 5 and `\"5\"` match each other, `Pro` and `pro` do not"
              }
            },
            "required": [
              "property",
              "equals"
            ],
            "additionalProperties": false,
            "description": "Only the events whose property has this value"
          }
        },
        "required": [
          "event"
        ],
        "additionalProperties": false,
        "description": "One step: an event, optionally narrowed by one property"
      },
      "RewardStep": {
        "type": "object",
        "properties": {
          "reward": {
            "type": "string",
            "enum": [
              "first"
            ],
            "description": "Always `first`: the person's first reward"
          }
        },
        "required": [
          "reward"
        ],
        "additionalProperties": false,
        "description": "The first time a person receives units of any unit, from a rule or by hand. A reward that was undone does not count, and units sent by another person do not count. Only as the last step."
      },
      "PreviewViewInput": {
        "type": "object",
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/PreviewViewDefinition"
          },
          "compare": {
            "type": "boolean",
            "description": "Also answer for the span of the same length just before"
          }
        },
        "required": [
          "definition"
        ],
        "additionalProperties": false
      },
      "PreviewViewDefinition": {
        "type": "object",
        "properties": {
          "who": {
            "$ref": "#/components/schemas/ViewWho"
          },
          "what": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ViewMeasure"
            },
            "minItems": 1,
            "maxItems": 4,
            "description": "What to count: 1 to 4 measures. A list ranks by the first and shows the others as columns"
          },
          "over": {
            "$ref": "#/components/schemas/ViewRange"
          },
          "shape": {
            "$ref": "#/components/schemas/PreviewViewShape"
          },
          "source": {
            "type": "string",
            "enum": [
              "trusted",
              "platform",
              "onchain",
              "web_identified",
              "any"
            ],
            "description": "Whose events this view counts. Left out is the same as platform: trusted and chat platform events (chat is not available yet). trusted: only your server, an agent or a person in Lurk. onchain: only Lurk's on-chain observations (not available yet). web_identified: server-verified web identification (not available yet). any: all sources; devices, on-chain observations and web identification are not available yet. Units given, spent and held, and new people are counted whatever this says"
          }
        },
        "required": [
          "who",
          "what",
          "over",
          "shape"
        ],
        "additionalProperties": false,
        "description": "The question: whose numbers, what to count, over which range, as which shape"
      },
      "PreviewViewShape": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "number"
                ],
                "description": "One number for each measure"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "over_time"
                ],
                "description": "A series for each measure, one point per `every`"
              },
              "every": {
                "type": "string",
                "enum": [
                  "day",
                  "week",
                  "month"
                ],
                "description": "How long each point covers"
              }
            },
            "required": [
              "type",
              "every"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "list"
                ],
                "description": "A ranked list, best first"
              },
              "by": {
                "type": "string",
                "enum": [
                  "user",
                  "rule",
                  "property"
                ],
                "description": "Rank users, rank rules, or rank the values of one property of the event counted"
              },
              "property": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "With `by: property`: the property's name, as the event carries it (`path`, `target`). A value that looks personal is counted under one row, Hidden (a best-effort check, not a guarantee: ranked values are as readable as a person's history)"
              },
              "size": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "description": "How many rows"
              }
            },
            "required": [
              "type",
              "by",
              "size"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/FunnelShape"
          }
        ],
        "description": "How the answer comes back: a number, a series over time, a ranked list, or a funnel (a preview only; a saved view cannot be a funnel yet)"
      },
      "FunnelShape": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "funnel"
            ],
            "description": "A funnel: how many people take each step in order"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FunnelStep"
            },
            "minItems": 2,
            "maxItems": 5,
            "description": "In order: a person counts at a step once they did every step before it"
          },
          "within": {
            "$ref": "#/components/schemas/FunnelWithin"
          }
        },
        "required": [
          "type",
          "steps",
          "within"
        ],
        "additionalProperties": false,
        "description": "People who took each step in order, each strictly after the one before and within `within` of their first step. Each person has one try, from their first step one in the range: someone whose first try runs out of time is not counted, even if a later try finishes"
      },
      "FunnelWithin": {
        "type": "string",
        "enum": [
          "1h",
          "1d",
          "7d",
          "30d"
        ],
        "description": "How long a person has, from their first step, to take every other step: an hour, a day, 7 days or 30 days. A step exactly at the end still counts"
      },
      "View": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^view_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A view ID, starting with `view_`."
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "The view's key, unique in the project: lowercase words joined by dashes. It stands in for the ID in paths"
          },
          "name": {
            "type": "string",
            "description": "The view's name"
          },
          "shape": {
            "type": "string",
            "enum": [
              "number",
              "over_time",
              "list"
            ],
            "description": "How its answer comes back, the type of its `definition.shape`"
          },
          "visibility": {
            "$ref": "#/components/schemas/ViewVisibility"
          },
          "conversion": {
            "type": "boolean",
            "description": "Whether this view is a conversion: something you want people to do. Only a view that counts one named event can be one."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it last changed: UTC, ISO 8601"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "A note about the view; null if it has none"
          },
          "definition": {
            "$ref": "#/components/schemas/ViewDefinition"
          },
          "endpoint": {
            "type": "string",
            "description": "Where it answers: /v1/views/returning-users"
          },
          "made_by": {
            "type": "string",
            "enum": [
              "template",
              "member",
              "key",
              "agent"
            ],
            "description": "Who saved it: a `template` installed, a `member` in the dashboard, a project `key`, or an `agent`"
          },
          "template": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^tpl_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "description": "A template ID, starting with `tpl_`."
          },
          "dashboards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^dash_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                  "description": "A dashboard ID, starting with `dash_`."
                },
                "name": {
                  "type": "string",
                  "description": "The dashboard's name"
                }
              },
              "required": [
                "id",
                "name"
              ]
            },
            "description": "The dashboards that show this view"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was created: UTC, ISO 8601"
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "shape",
          "visibility",
          "conversion",
          "updated_at",
          "description",
          "definition",
          "endpoint",
          "made_by",
          "template",
          "dashboards",
          "created_at"
        ],
        "examples": [
          {
            "id": "view_01m6gqxf40ermrwm4d7fx1w909",
            "key": "top-earners",
            "name": "Top earners",
            "shape": "list",
            "visibility": "team",
            "conversion": false,
            "updated_at": "2026-11-03T13:00:00.000Z",
            "description": "Who earned the most points this month",
            "definition": {
              "who": "everyone",
              "what": [
                {
                  "measure": "given",
                  "unit": "points"
                }
              ],
              "over": "this_month",
              "shape": {
                "type": "list",
                "by": "user",
                "size": 10
              }
            },
            "endpoint": "/v1/views/top-earners",
            "made_by": "key",
            "template": null,
            "dashboards": [],
            "created_at": "2026-11-03T13:00:00.000Z"
          }
        ]
      },
      "CreateViewInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "description": "The view's name, 1 to 80 characters"
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$",
            "description": "Defaults to a slug of the name, with `view-` in front if a digit leads"
          },
          "description": {
            "type": "string",
            "maxLength": 280,
            "description": "A note about the view, up to 280 characters"
          },
          "definition": {
            "$ref": "#/components/schemas/ViewDefinition"
          },
          "conversion": {
            "type": "boolean",
            "description": "Mark the view as a conversion. Left out: not one"
          }
        },
        "required": [
          "name",
          "definition"
        ],
        "additionalProperties": false,
        "examples": [
          {
            "name": "Top earners",
            "key": "top-earners",
            "description": "Who earned the most points this month",
            "definition": {
              "who": "everyone",
              "what": [
                {
                  "measure": "given",
                  "unit": "points"
                }
              ],
              "over": "this_month",
              "shape": {
                "type": "list",
                "by": "user",
                "size": 10
              }
            }
          }
        ]
      },
      "IntegrationList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Integration"
            },
            "description": "The items on this page"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are older items after this page"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass it as `cursor` to get the next page; null on the last page"
          }
        },
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Integration": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "The connector: your_app, mcp, webhooks, shopify, or a chat platform (discord, slack, telegram: not available yet)"
          },
          "name": {
            "type": "string",
            "description": "What a person calls it: Your app, MCP, Webhooks, Web, On-chain, or a chat platform (not available yet)"
          },
          "description": {
            "type": "string",
            "description": "What it does, in a few words"
          },
          "directions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "events_in",
                "mirrored_out",
                "agents"
              ],
              "description": "events_in: events come in. mirrored_out: Lurk pushes state out. agents: agents act"
            },
            "description": "Which ways it works: events in, state out, agents"
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus"
          },
          "stat": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "value": {
                "type": "integer",
                "minimum": 0,
                "description": "The number to show"
              },
              "label": {
                "type": "string",
                "description": "The word that goes with it: today, agents, endpoints, hits in 24 hours"
              }
            },
            "required": [
              "value",
              "label"
            ],
            "description": "A number worth showing, with its words: 2,200 \"today\", 3 \"agents\""
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProblem"
            },
            "description": "What is wrong with it; empty when nothing is"
          },
          "connected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the project first had what makes it connected; null if it is not"
          }
        },
        "required": [
          "key",
          "name",
          "description",
          "directions",
          "status",
          "stat",
          "problems",
          "connected_at"
        ]
      },
      "IntegrationStatus": {
        "type": "string",
        "enum": [
          "connected",
          "needs_attention",
          "not_connected",
          "later"
        ],
        "description": "connected: the project has what makes it work (for your_app, an active API key that has been used). needs_attention: connected, but something is wrong (see `problems`). not_connected: nothing yet. later: listed, but not available yet"
      },
      "IntegrationProblem": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable, for code: endpoint_failing"
          },
          "message": {
            "type": "string",
            "description": "For a person: 2 endpoints stopped after repeated failures"
          },
          "fix": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do, in words"
          },
          "fix_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Where to do it, when it is in the other app"
          }
        },
        "required": [
          "code",
          "message",
          "fix",
          "fix_url"
        ]
      },
      "IntegrationHealthOutput": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationHealth"
            },
            "description": "One entry per connector asked about (see `key` on the request)"
          },
          "needs_attention": {
            "type": "integer",
            "minimum": 0,
            "description": "How many connectors need attention in all, for the sidebar"
          }
        },
        "required": [
          "data",
          "needs_attention"
        ]
      },
      "IntegrationHealth": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "The connector: your_app, mcp, webhooks, shopify, or a chat platform (discord, slack, telegram: not available yet)"
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus"
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationProblem"
            },
            "description": "What is wrong with it; empty when nothing is"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this answer was worked out"
          }
        },
        "required": [
          "key",
          "status",
          "problems",
          "checked_at"
        ]
      },
      "ProjectSetup": {
        "type": "object",
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetupStep"
            },
            "description": "In the order to do them"
          },
          "areas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetupAreaState"
            },
            "description": "Every area, in the sidebar's order"
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `id` of the first step that is not done; null when all are"
          },
          "complete": {
            "type": "boolean",
            "description": "Every step is done"
          },
          "live": {
            "type": "boolean",
            "description": "A rule is or has been live: the project is past setup and nothing is locked, for anyone who joins it"
          },
          "pending_key_claim": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "The kcl_… claim ID"
              },
              "name": {
                "type": "string",
                "description": "What the key is for"
              },
              "status": {
                "$ref": "#/components/schemas/ApiKeyClaimStatus"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the claim window closes"
              },
              "pkce_required": {
                "type": "boolean",
                "description": "Whether redeeming requires the local PKCE verifier"
              },
              "code_issue_count": {
                "type": "integer",
                "minimum": 0,
                "description": "How many one-time claim codes have been issued for this claim"
              },
              "api_key_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The minted key_… ID once claimed; null before"
              }
            },
            "required": [
              "id",
              "name",
              "status",
              "expires_at",
              "pkce_required",
              "api_key_id"
            ],
            "description": "Newest pending approved API key claim waiting for redemption, if any"
          }
        },
        "required": [
          "steps",
          "areas",
          "next",
          "complete",
          "live"
        ]
      },
      "SetupStep": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A short word for the step: `unit`, `rule`, `dashboard`, `live`, `key` or `event`. More steps can be added, so an app shows one it does not know by its title"
          },
          "title": {
            "type": "string",
            "description": "What the step is, in a few words"
          },
          "line": {
            "type": "string",
            "description": "Why it matters and what to do, in a sentence"
          },
          "ask": {
            "type": "string",
            "description": "What to ask Lurky to be helped with this step"
          },
          "done": {
            "type": "boolean",
            "description": "Worked out from what the project has, so what an agent did through the API counts"
          },
          "opens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SetupArea"
            },
            "description": "The areas that open when this step is done"
          }
        },
        "required": [
          "id",
          "title",
          "line",
          "ask",
          "done",
          "opens"
        ]
      },
      "SetupArea": {
        "type": "string",
        "enum": [
          "home",
          "dashboards",
          "users",
          "activity",
          "rules",
          "units",
          "audiences",
          "events",
          "promote",
          "templates",
          "integrations",
          "developers",
          "partners",
          "settings"
        ],
        "description": "A part of the dashboard's sidebar"
      },
      "SetupAreaState": {
        "type": "object",
        "properties": {
          "area": {
            "$ref": "#/components/schemas/SetupArea"
          },
          "locked": {
            "type": "boolean",
            "description": "True while the step that opens it is not done and no rule has been live. Advice for the dashboard: no operation is refused"
          },
          "opened_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "The step that opens it (its `id`); null for an area that is always open"
          }
        },
        "required": [
          "area",
          "locked",
          "opened_by"
        ]
      },
      "ProjectClock": {
        "type": "object",
        "properties": {
          "test": {
            "type": "boolean",
            "description": "True when this project's time has been moved from real time"
          },
          "now": {
            "type": "string",
            "format": "date-time",
            "description": "What time it is in this project"
          },
          "real_now": {
            "type": "string",
            "format": "date-time",
            "description": "What time it is outside the project"
          },
          "offset_seconds": {
            "type": "integer",
            "description": "How far ahead of real time the project is"
          }
        },
        "required": [
          "test",
          "now",
          "real_now",
          "offset_seconds"
        ]
      },
      "AdvanceClockInput": {
        "type": "object",
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 366,
            "description": "Days to move forward, 0 to 366"
          },
          "hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 24000,
            "description": "Hours to move forward, 0 to 24,000"
          },
          "minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440000,
            "description": "Minutes to move forward, 0 to 1,440,000. At least one of days, hours and minutes must be above 0"
          }
        },
        "additionalProperties": false
      },
      "SetClockInput": {
        "type": "object",
        "properties": {
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "The time the project should think it is. Not earlier than now"
          }
        },
        "required": [
          "to"
        ],
        "additionalProperties": false
      },
      "ResetClockInput": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      }
    },
    "parameters": {}
  },
  "webhooks": {},
  "tags": [
    {
      "name": "events",
      "description": "Send what your users do. Lurk runs your live rules on each event.",
      "x-group": "Events",
      "x-displayName": "Events"
    },
    {
      "name": "units",
      "description": "What people collect and hold, and their balances.",
      "x-group": "Units",
      "x-displayName": "Units"
    },
    {
      "name": "rules",
      "description": "What Lurk does when an event comes in. A person takes a rule live.",
      "x-group": "Rules",
      "x-displayName": "Rules"
    },
    {
      "name": "activity",
      "description": "A receipt for every change, with why it happened.",
      "x-group": "Receipts",
      "x-displayName": "Receipts"
    },
    {
      "name": "users",
      "description": "The people your events are about.",
      "x-group": "People",
      "x-displayName": "People"
    },
    {
      "name": "webhook_endpoints",
      "description": "Where Lurk sends signed notices of what changed.",
      "x-group": "Webhooks",
      "x-displayName": "Webhooks"
    },
    {
      "name": "known_values",
      "description": "The properties of your own events whose values Lurk remembers.",
      "x-group": "Known values",
      "x-displayName": "Known values"
    },
    {
      "name": "feedback",
      "description": "Tell the Lurk team about a bug, a gap or an idea.",
      "x-group": "Feedback",
      "x-displayName": "Feedback"
    },
    {
      "name": "annotations",
      "description": "Short notes on a day of the project, such as a release or a campaign start.",
      "x-group": "Annotations",
      "x-displayName": "Annotations"
    },
    {
      "name": "trusted_issuers",
      "description": "The sign-in providers a project trusts for its app's users.",
      "x-group": "Trusted issuers",
      "x-displayName": "Trusted issuers"
    },
    {
      "name": "client_events",
      "description": "The events a signed-in device may send, and their caps.",
      "x-group": "Client events",
      "x-displayName": "Client events"
    },
    {
      "name": "issuer_identities",
      "description": "Which person each sign-in subject is bound to.",
      "x-group": "Issuer identities",
      "x-displayName": "Issuer identities"
    },
    {
      "name": "proposals",
      "description": "Changes an agent or Lurky asks for and a person approves or declines.",
      "x-group": "Proposals",
      "x-displayName": "Proposals"
    },
    {
      "name": "holds",
      "description": "Changes a rule parked for a person to give or refuse.",
      "x-group": "Holds",
      "x-displayName": "Holds"
    },
    {
      "name": "audiences",
      "description": "The groups of people that rules can read.",
      "x-group": "Audiences",
      "x-displayName": "Audiences"
    },
    {
      "name": "budgets",
      "description": "What each live rule's budgets have given in the window they are in now.",
      "x-group": "Budgets",
      "x-displayName": "Budgets"
    },
    {
      "name": "templates",
      "description": "Kits that add units and rules to a project in one go.",
      "x-group": "Templates",
      "x-displayName": "Templates"
    },
    {
      "name": "views",
      "description": "Saved questions about a project, with their answers.",
      "x-group": "Views",
      "x-displayName": "Views"
    },
    {
      "name": "integrations",
      "description": "Every way events reach Lurk or state leaves it, and the state of each.",
      "x-group": "Integrations",
      "x-displayName": "Integrations"
    },
    {
      "name": "projects",
      "description": "Where units, rules and events live. An organization can have several.",
      "x-group": "Projects",
      "x-displayName": "Projects"
    },
    {
      "name": "clocks",
      "description": "A test project's clock, which can be moved to try schedules and expiries.",
      "x-group": "Clocks",
      "x-displayName": "Clocks"
    }
  ],
  "paths": {
    "/v1/events": {
      "post": {
        "operationId": "events.send",
        "summary": "Send an event",
        "description": "Sends something a user did. Lurk runs your live rules on it and returns the receipts: what changed and the balance after. A retry with the same `idempotency_key` returns the first answer. `timestamp` may be in the past, not over 5 minutes ahead. `profile` and `alias` ride along. [Events](/events)",
        "tags": [
          "events"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": false,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEventInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Send an event",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendEventOutput"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/catalog": {
      "get": {
        "operationId": "events.catalog",
        "summary": "List the events this project has",
        "description": "Lists the event names your project sent in the last 30 days or that a rule listens for, with counts, property names and types, and the rules listening. Property values are never listed, except where a person turned on remembering them. [Events](/events#the-event-catalog)",
        "tags": [
          "events"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Part of the event name, 1 to 100 characters; only names that contain it",
              "examples": [
                "order"
              ]
            },
            "required": false,
            "description": "Part of the event name, 1 to 100 characters; only names that contain it",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List the events this project has",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsCatalog"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units": {
      "get": {
        "operationId": "units.list",
        "summary": "List units",
        "description": "Newest first, with what each holds across everyone, how many hold it, and what was added and taken in the last 30 days. `counts` says how many units each group has.",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/UnitGroup"
            },
            "required": false,
            "description": "The tab the unit sits in: points, progress, badge or perk. A label for how people think of it; what it can do comes from its switches",
            "name": "group",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List units",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "units.create",
        "summary": "Create a unit",
        "description": "Sets up a unit: a name, a group and switches for what it can do (goes down, cap, supply, expiry, spend, use, send). The key defaults to a slug of the name and must be new. Owners, admins and developers, or a project key. [Units](/units)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUnitInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create a unit",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "unit_01m5ch6kp0eps8v3rprkhtfdwj",
                  "key": "coffee-voucher",
                  "name": "Coffee vouchers",
                  "singular": "Coffee voucher",
                  "group": "perk",
                  "shows_as": "amount",
                  "color": "teal",
                  "switches": {
                    "goes_up": true,
                    "goes_down": true,
                    "spendable": true,
                    "usable": true,
                    "sendable": false,
                    "send_cap_per_day": 100,
                    "resets": false,
                    "starts_at": 0,
                    "held_by": null,
                    "cap": 5,
                    "min_balance": 0,
                    "visible": true,
                    "supply": null,
                    "expires_after_days": null,
                    "expires_at": null
                  },
                  "stats": {
                    "held": 0,
                    "holders": 0,
                    "given_30d": 0,
                    "spent_30d": 0,
                    "issued": 0
                  },
                  "created_at": "2026-10-20T11:30:00.000Z",
                  "updated_at": "2026-10-20T11:30:00.000Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/Unit"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/{id}": {
      "get": {
        "operationId": "units.get",
        "summary": "Get a unit",
        "description": "By ID or key: its settings and what it holds across everyone.",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A unit_… ID or the unit's key",
              "examples": [
                "points"
              ]
            },
            "required": true,
            "description": "A unit_… ID or the unit's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a unit",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unit"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "units.update",
        "summary": "Change a unit",
        "description": "Changes what you send. A setting applies to changes from now on and changes nobody's balance: lowering a cap below what people hold leaves their balances, and stops further additions.",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A unit_… ID or the unit's key"
            },
            "required": true,
            "description": "A unit_… ID or the unit's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "A new name, 1 to 80 characters"
                  },
                  "singular": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "A new singular, 1 to 80 characters"
                  },
                  "group": {
                    "$ref": "#/components/schemas/UnitGroup"
                  },
                  "shows_as": {
                    "$ref": "#/components/schemas/UnitShowsAs"
                  },
                  "color": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "blue",
                      "green",
                      "amber",
                      "red",
                      "purple",
                      "pink",
                      "teal",
                      "gray",
                      null
                    ],
                    "description": "A color, or null to clear it"
                  },
                  "switches": {
                    "type": "object",
                    "properties": {
                      "goes_up": {
                        "type": "boolean",
                        "description": "Rules can add to it"
                      },
                      "goes_down": {
                        "type": "boolean",
                        "description": "Rules can take from it. Off makes it earn-only"
                      },
                      "spendable": {
                        "type": "boolean",
                        "description": "`units.spend` can take from it: a brand's server taking value for a reward. On by default for a unit that goes down; an earn-only unit is never spendable"
                      },
                      "usable": {
                        "type": "boolean",
                        "description": "`units.use` can take one: a person redeeming the thing itself, a coupon or a ticket, which fires the `unit.used` webhook. Off by default; a unit that cannot go down is never usable"
                      },
                      "sendable": {
                        "type": "boolean",
                        "description": "`units.send` can move it from one person to another. Off by default; a unit that cannot go down is never sendable. Units cannot be bought, cashed out or given a money value"
                      },
                      "send_cap_per_day": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000000,
                        "description": "The most one person may send of it in a day, in the project's time zone. Always a number: a send is never unlimited. 100 by default"
                      },
                      "resets": {
                        "type": "boolean",
                        "description": "A rule's `reset` action can set it back to 0: a season's XP, a monthly count. Works for a unit that only goes up. Off by default"
                      },
                      "starts_at": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "What a person first heard of from now on begins with, as a receipt written when they are first seen: a level starts at 1. People Lurk has already heard of keep what they hold. 0 for nothing. Not with a supply"
                      },
                      "held_by": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100,
                        "description": "The key of an audience to follow: a person holds exactly 1 while they are in it and 0 when they are not, kept by Lurk within minutes, as a pass or a role. Rules and gives cannot change it by hand. Needs a cap of 1 (set for you), and not an expiry, a supply or a start. Null for an ordinary unit"
                      },
                      "cap": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "exclusiveMinimum": 0,
                        "description": "Never more than this per person; a change that would pass it is refused whole. A badge is 1"
                      },
                      "min_balance": {
                        "type": "integer",
                        "maximum": 0,
                        "description": "The lowest a balance may go. 0 normally; below 0 lets it be overdrawn"
                      },
                      "visible": {
                        "type": "boolean",
                        "description": "The brand's app shows it to people. A label: Lurk does not act on it"
                      },
                      "supply": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "exclusiveMinimum": 0,
                        "description": "The most that can ever be given in all, across everyone: 40 in all. When it has run out a rule that would give it is skipped (`supply_gone`). Counted from when it is set; null for no limit"
                      },
                      "expires_after_days": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 3650,
                        "description": "What is given expires this many days later, and is taken back; spending uses what expires first. Applies to what is given from now on; null for never"
                      },
                      "expires_at": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time",
                        "description": "Everything of it ends at this moment: nothing is given after it, and what is held then expires and is taken back, whatever `expires_after_days` says. A ticket for an event on a date. Must be in the future when set; null for no end date"
                      }
                    },
                    "additionalProperties": false,
                    "description": "Only the settings to change"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Change a unit",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unit"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/{unit}/leaderboard": {
      "get": {
        "operationId": "units.leaderboard",
        "summary": "Get who holds the most of a unit",
        "description": "The top of one unit: up to 10 people, most first, with rank, `usr_…` ID and amount; equal amounts share a rank. The unit may be left out: the oldest unit someone holds. Never carries your own identifier for a person or an email. [Leaderboard](/units#the-leaderboard)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The unit's key. The agent tool may leave it out (the REST path always names it): then the oldest unit that someone holds, or the oldest unit when nobody holds any"
            },
            "required": true,
            "description": "The unit's key. The agent tool may leave it out (the REST path always names it): then the oldest unit that someone holds, or the oldest unit when nobody holds any",
            "name": "unit",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 10,
              "description": "How many places, 1 to 10"
            },
            "required": false,
            "description": "How many places, 1 to 10",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get who holds the most of a unit",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitLeaderboard"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/give/preview": {
      "post": {
        "operationId": "units.give_preview",
        "summary": "Preview giving a unit by hand",
        "description": "Shows what giving a unit by hand would do, without doing it: who would get it, who is skipped and why, who matched nobody, and what is left of a rule's budget (`count_against`). `users` are `usr_…` or your own IDs, up to 200. Writes nothing. [Giving by hand](/units#giving-by-hand)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiveUnitsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview giving a unit by hand",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GivePreview"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/spend": {
      "post": {
        "operationId": "units.spend",
        "summary": "Take a unit from a person for something",
        "description": "Takes an amount of a unit from a person, all or nothing (`insufficient_balance`). The unit needs `spendable` on. A `reference` is used once per unit (`reference_used`). Unknown person or unit: `not_found`. Owners and admins, or a project key; never an agent. [Spending](/units#spending-and-using)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpendUnitsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Take a unit from a person for something",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpendUnitsOutput"
                }
              }
            }
          },
          "409": {
            "description": "- `insufficient_balance`: Nothing was changed. Check what the person holds and the unit's lowest balance, then send a smaller amount.\n- `reference_used`: That reference was already used, so this was probably done before. Use a new reference for a new thing; do not retry this one.\n- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/send": {
      "post": {
        "operationId": "units.send",
        "summary": "Send a unit from one person to another",
        "description": "Moves an amount of one unit between two people as two receipts, all or nothing. The unit needs `sendable` on and must go down; the daily limit is `rate_limited`. Unknown person or unit: `not_found`. Owners and admins, or a project key; never an agent. [Sending](/units#sending-between-people)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendUnitsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Send a unit from one person to another",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendUnitsOutput"
                }
              }
            }
          },
          "409": {
            "description": "- `insufficient_balance`: Nothing was changed. Check what the person holds and the unit's lowest balance, then send a smaller amount.\n- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.\n\n- `rate_limited`: Wait for the `Retry-After` time, then retry with the same idempotency key. Spread requests out if this keeps happening.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/units/use": {
      "post": {
        "operationId": "units.use",
        "summary": "Use something a person holds",
        "description": "Redeems an amount (one by default) of a unit a person holds, all or nothing. The unit needs `usable` on. A `reference` is used once per unit. Fires `unit.used`. Unknown person or unit: `not_found`. Owners and admins, or a project key; never an agent. [Using](/units#spending-and-using)",
        "tags": [
          "units"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UseUnitsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Use something a person holds",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UseUnitsOutput"
                }
              }
            }
          },
          "409": {
            "description": "- `insufficient_balance`: Nothing was changed. Check what the person holds and the unit's lowest balance, then send a smaller amount.\n- `reference_used`: That reference was already used, so this was probably done before. Use a new reference for a new thing; do not retry this one.\n- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules": {
      "post": {
        "operationId": "rules.create",
        "summary": "Create a rule as a draft",
        "description": "Nothing runs until an owner or admin takes the draft live, in person. Keys and agents can create and preview rules, but saving a rule with `effects` (not available yet) is refused with `approval_required`. `key` defaults to a slug of the name. See [Rules](/rules).",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRuleInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create a rule as a draft",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "rule_01m2z44880ev18z457tkgkpp00",
                  "key": "order-points",
                  "name": "Points for orders",
                  "status": "draft",
                  "version": 1,
                  "live_version": null,
                  "definition": {
                    "when": {
                      "event": "order.paid"
                    },
                    "if": [
                      {
                        "property": {
                          "name": "currency",
                          "equals": "USD"
                        }
                      }
                    ],
                    "limit": [
                      {
                        "max": 5,
                        "per": "day",
                        "by": "user"
                      }
                    ],
                    "do": [
                      {
                        "unit": "points",
                        "add": {
                          "from": "total_cents",
                          "per": 100
                        }
                      }
                    ]
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `unavailable`: This is not available right now (or not set up on this server yet). Retry in a moment with the same idempotency key, and ask us if it stays unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "rules.list",
        "summary": "List rules",
        "description": "Newest first. Filter by status, unit, event or part of the name. `counts` says how many rules each status has under the other filters.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "live",
                "paused"
              ],
              "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed"
            },
            "required": false,
            "description": "draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$",
              "description": "Only rules that change this unit"
            },
            "required": false,
            "description": "Only rules that change this unit",
            "name": "unit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
              "description": "Only rules that hear this event"
            },
            "required": false,
            "description": "Only rules that hear this event",
            "name": "event",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Part of the name or key"
            },
            "required": false,
            "description": "Part of the name or key",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List rules",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}/live": {
      "post": {
        "operationId": "rules.publish",
        "summary": "Take a rule live",
        "description": "Takes the newest version live. Only an owner or admin, in person. Agents and keys get `approval_required` and should create a proposal.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Take a rule live",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "rule_01m2z44880ev18z457tkgkpp00",
                  "key": "order-points",
                  "name": "Points for orders",
                  "status": "live",
                  "version": 2,
                  "live_version": 2,
                  "definition": {
                    "when": {
                      "event": "order.paid"
                    },
                    "if": [
                      {
                        "property": {
                          "name": "currency",
                          "equals": "USD"
                        }
                      }
                    ],
                    "limit": [
                      {
                        "max": 3,
                        "per": "day",
                        "by": "user"
                      }
                    ],
                    "do": [
                      {
                        "unit": "points",
                        "add": {
                          "from": "total_cents",
                          "per": 100
                        }
                      }
                    ]
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "403": {
            "description": "- `approval_required`: A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "status": 403,
                    "code": "approval_required",
                    "message": "This needs a person: an owner or admin approves it in Lurk.",
                    "next_step": "A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
                    "request_id": "req_9f3b1c7ae2d84c0b8a56e1d07f42c9ab",
                    "doc_url": "https://docs.getlurk.com/errors#approval_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `unavailable`: This is not available right now (or not set up on this server yet). Retry in a moment with the same idempotency key, and ask us if it stays unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}": {
      "get": {
        "operationId": "rules.get",
        "summary": "Get a rule",
        "description": "By ID or key. `definition` is the newest version; `live_definition` is what is running now, which differs while an edit waits for a person.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a rule",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDetail"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "rules.update",
        "summary": "Update a rule",
        "description": "Saves a new version of the newest, with the parts you send replaced. A live rule keeps its version until a person takes the new one live. `name` alone renames, no new version. Saving `effects` (not available yet) gets a key `approval_required`, as does renaming a rule with them. [Rules](/rules).",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "What people call the rule, 1 to 80 characters"
                  },
                  "when": {
                    "$ref": "#/components/schemas/RuleWhen"
                  },
                  "if": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Condition"
                    },
                    "maxItems": 20,
                    "description": "Conditions that must all hold, up to 20. Leave out for none. Replaces the list"
                  },
                  "limit": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Limit"
                    },
                    "maxItems": 5,
                    "description": "How often the rule may apply to one person, up to 5. Leave out for no limit. Replaces the list",
                    "examples": [
                      [
                        {
                          "max": 3,
                          "per": "day"
                        }
                      ]
                    ]
                  },
                  "do": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Action"
                    },
                    "maxItems": 10,
                    "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
                  },
                  "budget": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RuleBudget"
                    },
                    "maxItems": 5,
                    "description": "Caps on what the rule gives everyone, up to 5. Leave out for none. An empty list removes them"
                  },
                  "modify": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Modifier"
                    },
                    "maxItems": 5,
                    "description": "Changes to what the rule gives, for some people, up to 5. Leave out for none. An empty list removes them"
                  },
                  "effects": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RuleEffect"
                    },
                    "maxItems": 3,
                    "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a rule",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "example": {
                  "id": "rule_01m2z44880ev18z457tkgkpp00",
                  "key": "order-points",
                  "name": "Points for orders",
                  "status": "live",
                  "version": 2,
                  "live_version": 1,
                  "definition": {
                    "when": {
                      "event": "order.paid"
                    },
                    "if": [
                      {
                        "property": {
                          "name": "currency",
                          "equals": "USD"
                        }
                      }
                    ],
                    "limit": [
                      {
                        "max": 3,
                        "per": "day",
                        "by": "user"
                      }
                    ],
                    "do": [
                      {
                        "unit": "points",
                        "add": {
                          "from": "total_cents",
                          "per": 100
                        }
                      }
                    ]
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `unavailable`: This is not available right now (or not set up on this server yet). Retry in a moment with the same idempotency key, and ask us if it stays unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}/pause": {
      "post": {
        "operationId": "rules.pause",
        "summary": "Pause a rule",
        "description": "Stops a live rule at once: nothing is given or taken while it is paused. Keys and agents can pause. Starting it again needs an owner or admin, in person, with `POST /v1/rules/{id}/resume`. See [Rules](/rules).",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pause a rule",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}/resume": {
      "post": {
        "operationId": "rules.resume",
        "summary": "Start a paused rule again",
        "description": "The rule runs again on the version it was running. A paused rule going live is a go-live, so only an owner or admin, in person.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Start a paused rule again",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}/preview": {
      "post": {
        "operationId": "rules.preview",
        "summary": "Preview a rule",
        "description": "Replays up to 20,000 recorded events from the past `days` (1 to 90, default 30) through the real engine and says what the rule would have given. Nothing is given. Send `definition` to try an unsaved edit. Schedule and balance rules get a forecast, not a replay. An estimate: see `notes`.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90,
                    "default": 30,
                    "description": "How many past days to look at, 1 to 90",
                    "examples": [
                      30
                    ]
                  },
                  "definition": {
                    "type": "object",
                    "properties": {
                      "when": {
                        "$ref": "#/components/schemas/RuleWhen"
                      },
                      "if": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Condition"
                        },
                        "maxItems": 20,
                        "default": [],
                        "description": "Conditions that must all hold, up to 20. Leave out for none"
                      },
                      "limit": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Limit"
                        },
                        "maxItems": 5,
                        "default": [],
                        "description": "How often the rule may apply to one person, up to 5. Leave out for no limit"
                      },
                      "do": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Action"
                        },
                        "maxItems": 10,
                        "description": "What the rule changes: units. Needs at least one action unless the rule has `effects`, which are not available yet"
                      },
                      "budget": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/RuleBudget"
                        },
                        "maxItems": 5,
                        "description": "Caps on what the rule gives everyone, not one person (limit does that). Leave out for none"
                      },
                      "modify": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Modifier"
                        },
                        "maxItems": 5,
                        "description": "Changes to what the rule gives, for some people, in order: VIPs get double. Leave out for none"
                      },
                      "effects": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/RuleEffect"
                        },
                        "maxItems": 3,
                        "description": "Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with `effects` gets `approval_required`. Leave out for none"
                      }
                    },
                    "required": [
                      "when",
                      "do"
                    ],
                    "additionalProperties": false,
                    "description": "Preview this instead of the saved version: an edit that is not saved yet"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview a rule",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewRuleOutput"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/{id}/stats": {
      "get": {
        "operationId": "rules.stats",
        "summary": "Get what a rule did",
        "description": "From the receipts: how many times the rule changed something, for how many people, and how much it gave or took per unit, plus how often it did not apply and why, and the ten people it reached most. Skips are kept for 30 days.",
        "tags": [
          "rules"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A rule_… ID or the rule's key",
              "examples": [
                "order-points"
              ]
            },
            "required": true,
            "description": "A rule_… ID or the rule's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30,
              "description": "How many past days to look at, 1 to 90"
            },
            "required": false,
            "description": "How many past days to look at, 1 to 90",
            "name": "days",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get what a rule did",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleStatsOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activity": {
      "get": {
        "operationId": "activity.list",
        "summary": "List receipts",
        "description": "Newest first. Every receipt says who acted, through what, and each unit it changed with the balance after. Filter by person (a usr_… ID or the brand's own identifier), rule, unit or time.",
        "tags": [
          "activity"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "A usr_… ID, or the brand's own identifier",
              "examples": [
                "ana@example.com"
              ]
            },
            "required": false,
            "description": "A usr_… ID, or the brand's own identifier",
            "name": "user",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "A rule_… ID or the rule's key"
            },
            "required": false,
            "description": "A rule_… ID or the rule's key",
            "name": "rule",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$",
              "description": "Only receipts that changed this unit",
              "examples": [
                "points"
              ]
            },
            "required": false,
            "description": "Only receipts that changed this unit",
            "name": "unit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "spend",
                "use",
                "send",
                "receive"
              ],
              "description": "Only receipts of this kind: `spend`, `use`, `send` or `receive`"
            },
            "required": false,
            "description": "Only receipts of this kind: `spend`, `use`, `send` or `receive`",
            "name": "cause",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^act_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "Only the two receipts of one `units.send`: the `transfer` ID of either receipt (the sender's receipt ID)"
            },
            "required": false,
            "description": "Only the two receipts of one `units.send`: the `transfer` ID of either receipt (the sender's receipt ID)",
            "name": "transfer",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "From this time on, this time included: ISO 8601, UTC"
            },
            "required": false,
            "description": "From this time on, this time included: ISO 8601, UTC",
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Up to this time, this time included: ISO 8601, UTC"
            },
            "required": false,
            "description": "Up to this time, this time included: ISO 8601, UTC",
            "name": "until",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List receipts",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activity/{id}": {
      "get": {
        "operationId": "activity.explain",
        "summary": "Explain a receipt",
        "description": "The receipt and the checks the engine made for it, in order, from the trace stored with it: never reconstructed afterwards. A receipt written before traces were kept has none (`traced: false`).",
        "tags": [
          "activity"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The act_… ID",
              "examples": [
                "act_01m6jxa1q0eq98wwe0n7sr9cb0"
              ]
            },
            "required": true,
            "description": "The act_… ID",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Explain a receipt",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExplainActivityOutput"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/activity-feed": {
      "get": {
        "operationId": "activity.feed",
        "summary": "List what happened and what didn't",
        "description": "Lists, newest first, receipts, rules that heard an event and did nothing (kept at least 30 days) and changes waiting for a person. Filter by `kind` (`given`, `skipped` or `held`), person, rule, unit or time. A unit filter keeps receipts and held changes. [Activity](/activity#the-feed)",
        "tags": [
          "activity"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "given",
                "skipped",
                "held",
                "effect",
                "mirror"
              ],
              "description": "Only this kind of item: `given` (receipts), `skipped` or `held`. `effect` and `mirror` are not available yet. Defaults to `all`"
            },
            "required": false,
            "description": "Only this kind of item: `given` (receipts), `skipped` or `held`. `effect` and `mirror` are not available yet. Defaults to `all`",
            "name": "kind",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "A usr_… ID"
            },
            "required": false,
            "description": "A usr_… ID",
            "name": "user",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "A rule_… ID or the rule's key"
            },
            "required": false,
            "description": "A rule_… ID or the rule's key",
            "name": "rule",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_-]{0,63}$",
              "description": "Receipts and held changes that involve this unit; skips changed none"
            },
            "required": false,
            "description": "Receipts and held changes that involve this unit; skips changed none",
            "name": "unit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "From this time on, this time included: ISO 8601, UTC"
            },
            "required": false,
            "description": "From this time on, this time included: ISO 8601, UTC",
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Up to this time, this time included: ISO 8601, UTC"
            },
            "required": false,
            "description": "Up to this time, this time included: ISO 8601, UTC",
            "name": "until",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List what happened and what didn't",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users": {
      "get": {
        "operationId": "users.list",
        "summary": "List people",
        "description": "Lists people, newest first (`sort`), with holdings, profile and status. `search` takes one whole value: a `usr_…` ID, your identifier, an email or a handle; no partial match. Also `audience`, `signs_in_with` (a provider's `iss_…` ID), `status`, `include=total`. [People](/guides/people)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "One whole value: a usr_… ID, your own identifier, an email, or a handle on any platform (with or without the @). Emails and handles ignore case. They are kept sealed, so there is no partial match, and names are not searched"
            },
            "required": false,
            "description": "One whole value: a usr_… ID, your own identifier, an email, or a handle on any platform (with or without the @). Emails and handles ignore case. They are kept sealed, so there is no partial match, and names are not searched",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "An audience's key or `aud_…` ID: only the people in it"
            },
            "required": false,
            "description": "An audience's key or `aud_…` ID: only the people in it",
            "name": "audience",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^iss_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "Only the people who have an account linked at this sign-in provider (an `iss_…` ID), counting accounts linked to people merged into them. A person with several accounts there counts once; an account that is unlinked no longer counts. An archived provider still works; an unknown one is `not_found`"
            },
            "required": false,
            "description": "Only the people who have an account linked at this sign-in provider (an `iss_…` ID), counting accounts linked to people merged into them. A person with several accounts there counts once; an account that is unlinked no longer counts. An archived provider still works; an unknown one is `not_found`",
            "name": "signs_in_with",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning",
                "lapsing"
              ],
              "description": "Only the people with this status, as the project defines it (`new_for_days`, `lapsing_after_days`)"
            },
            "required": false,
            "description": "Only the people with this status, as the project defines it (`new_for_days`, `lapsing_after_days`)",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "newest",
                "oldest"
              ],
              "default": "newest",
              "description": "By when Lurk first heard of them. `newest` by default"
            },
            "required": false,
            "description": "By when Lurk first heard of them. `newest` by default",
            "name": "sort",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "total"
              ],
              "description": "Send `total` to also get `total`, how many people match the search, the audience and the provider (the whole list, not this page)",
              "examples": [
                "total"
              ]
            },
            "required": false,
            "description": "Send `total` to also get `total`, how many people match the search, the audience and the provider (the whole list, not this page)",
            "name": "include",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List people",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{id}": {
      "get": {
        "operationId": "users.get",
        "summary": "Get a person",
        "description": "Gets one person with holdings, profile, status and receipt count. Members and project keys also receive web acquisition sources and browser counts, starting after consent. A merged-away person returns `not_found`. [People](/guides/people)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A usr_… ID, or the brand's own identifier",
              "examples": [
                "ana@example.com"
              ]
            },
            "required": true,
            "description": "A usr_… ID, or the brand's own identifier",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a person",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The usr_… ID"
                    },
                    "external_id": {
                      "type": "string",
                      "description": "The brand's own identifier: an email, a user ID"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time",
                      "description": "When Lurk first heard of them"
                    },
                    "last_active_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When they last did something, to the hour. Null until an event arrives after Lurk started keeping it"
                    },
                    "status": {
                      "$ref": "#/components/schemas/PersonStatus"
                    },
                    "balances": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UnitBalance"
                      },
                      "description": "What they hold now. Units at 0 are left out"
                    },
                    "profile": {
                      "$ref": "#/components/schemas/PersonProfile"
                    },
                    "blocked_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When a member blocked this person; null when not blocked. Blocks apply where device sign-in is switched on."
                    },
                    "blocked_by": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^mem_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                          "description": "A member ID, starting with `mem_`."
                        },
                        "name": {
                          "type": "string",
                          "description": "The member's display name."
                        }
                      },
                      "required": [
                        "id",
                        "name"
                      ],
                      "description": "The member who blocked them; null when not blocked. Blocks apply where device sign-in is switched on."
                    },
                    "erased_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "Not available yet. When the person was erased. Null for everyone else. From then on external_id is a random value starting erased:, the brand's old identifier means a new person, and nothing can be added to this one"
                    },
                    "timezone": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Their own time zone, when they have one; else the project's applies"
                    },
                    "receipts": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "How many receipts they have"
                    },
                    "last_receipt_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "When their most recent receipt was made. Null when they have none"
                    },
                    "web_acquisition": {
                      "$ref": "#/components/schemas/WebAcquisition"
                    }
                  },
                  "required": [
                    "id",
                    "external_id",
                    "created_at",
                    "last_active_at",
                    "status",
                    "balances",
                    "profile",
                    "blocked_at",
                    "blocked_by",
                    "timezone",
                    "receipts",
                    "last_receipt_at"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "users.update",
        "summary": "Update a person's profile",
        "description": "Sets the profile of an existing person (for a new one, send `profile` with the event): email, name, picture, handles, language. Left out is kept, null clears. In `handles` an entry replaces that platform's, null removes it. `profile: null` erases all. [People](/guides/people#a-persons-profile)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A usr_… ID, or your own identifier for them. The person must exist already: an event makes them (or send `profile` with that event)"
            },
            "required": true,
            "description": "A usr_… ID, or your own identifier for them. The person must exist already: an event makes them (or send `profile` with that event)",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "profile": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "email": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 254,
                        "format": "email",
                        "description": "Lurk keeps it lowercase. Null clears it"
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100,
                        "pattern": "^(?![\\s\\S]*<[A-Za-z!/?])[^\\u0000-\\u001f\\u007f-\\u009f‪-‮⁦-⁩]*$",
                        "description": "Plain text, 1 to 100 characters. Null clears it"
                      },
                      "avatar_url": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 2048,
                        "pattern": "^https:\\/\\/[^/?#@\\s]+(?:[/?#]\\S*)?$",
                        "description": "An https:// link, at most 2048 characters. Null clears it"
                      },
                      "handles": {
                        "type": "object",
                        "additionalProperties": {
                          "$ref": "#/components/schemas/HandleChange"
                        },
                        "description": "By platform: an entry sets that platform's handle, null removes it, and platforms left out are kept. A person has handles on at most 10 platforms"
                      },
                      "locale": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 35,
                        "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8}){0,4}$",
                        "description": "A BCP 47 tag: en, en-GB. Null clears it"
                      }
                    },
                    "additionalProperties": false,
                    "description": "What to change in their profile. `null` erases the whole profile",
                    "examples": [
                      {
                        "email": "ana@example.com",
                        "name": "Ana Lima",
                        "handles": {
                          "x": {
                            "handle": "ana_lima"
                          }
                        },
                        "locale": "pt-BR"
                      }
                    ]
                  }
                },
                "required": [
                  "profile"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a person's profile",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndUserDetail"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "- `conflict`: Nothing was changed. The thing it names is in a state that does not allow this (such as a person merged into another). Do what the message says, then send it again.\n- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{id}/history": {
      "get": {
        "operationId": "users.history",
        "summary": "Get a person's history",
        "description": "A person's events and receipts, newest first, including merged people's and aliases' (`seen_as`). `event` also returns the receipts it caused, and a page filtered by it can hold fewer than `limit` items, even none, and still have `has_more`. [People](/guides/people#a-persons-history)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A usr_… ID, or your own identifier for them"
            },
            "required": true,
            "description": "A usr_… ID, or your own identifier for them",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
              "description": "Only the events with this name, and the receipts they caused. A page then looks through at most 1,000 of each person's events and receipts, so it can hold fewer than `limit` items, even none, with `has_more` and a `next_cursor` to look further"
            },
            "required": false,
            "description": "Only the events with this name, and the receipts they caused. A page then looks through at most 1,000 of each person's events and receipts, so it can hold fewer than `limit` items, even none, with `has_more` and a `next_cursor` to look further",
            "name": "event",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "event",
                "receipt"
              ],
              "description": "Only events, or only receipts. Both when left out"
            },
            "required": false,
            "description": "Only events, or only receipts. Both when left out",
            "name": "kind",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Recorded at or after this time"
            },
            "required": false,
            "description": "Recorded at or after this time",
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Recorded at or before this time"
            },
            "required": false,
            "description": "Recorded at or before this time",
            "name": "until",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a person's history",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserHistory"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/{id}/aliases": {
      "post": {
        "operationId": "users.alias",
        "summary": "Add an alias to a person",
        "description": "Says another identifier, e.g. a pre-sign-in visitor ID, was this person too, so their history shows its events and receipts. It need not have sent events. Repeating an alias answers as it is. No chains, max 20, the shared anonymous ID refused. [Aliases](/guides/people#aliases-who-a-visitor-was)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The person: a usr_… ID or your own identifier for them. They must exist"
            },
            "required": true,
            "description": "The person: a usr_… ID or your own identifier for them. They must exist",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "Another identifier they were known by, such as the anonymous visitor ID they had before signing in. Lurk need not have heard from it yet"
                  }
                },
                "required": [
                  "alias"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add an alias to a person",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonAlias"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "users.unalias",
        "summary": "Remove an alias from a person",
        "description": "Removes an alias: the person's history stops reading that identifier's events and receipts, and nothing else changes. An identifier that is not this person's alias returns `not_found`. [Aliases](/guides/people#aliases-who-a-visitor-was)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The person: a usr_… ID or your own identifier for them"
            },
            "required": true,
            "description": "The person: a usr_… ID or your own identifier for them",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alias": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "The alias to remove, as you sent it"
                  }
                },
                "required": [
                  "alias"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove an alias from a person",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonAlias"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/merge": {
      "post": {
        "operationId": "users.merge",
        "summary": "Merge one person into another",
        "description": "Merges `from` into `into`: what `from` holds moves to `into` as receipts, and `from`'s later events count for `into`. Needs an owner or admin in person; keys and agents get `approval_required`. Looking up `from` afterwards returns `not_found`. [Merging](/guides/people#merging-existing-people)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeUsersInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Merge one person into another",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeUsersOutput"
                }
              }
            }
          },
          "403": {
            "description": "- `approval_required`: A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "status": 403,
                    "code": "approval_required",
                    "message": "This needs a person: an owner or admin approves it in Lurk.",
                    "next_step": "A person has to approve this in the dashboard (an owner or admin). Do not retry and do not try to get around it: ask them.",
                    "request_id": "req_9f3b1c7ae2d84c0b8a56e1d07f42c9ab",
                    "doc_url": "https://docs.getlurk.com/errors#approval_required"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/unmerge": {
      "post": {
        "operationId": "users.unmerge",
        "summary": "Undo a merge",
        "description": "Gives a merged-away person back by reversing the merge's receipts with new ones. Refused if the person kept has spent what came or a cap would break. Needs an owner or admin in person; keys and agents get `approval_required`. [Merging people](/guides/people#merging-existing-people)",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnmergeUsersInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Undo a merge",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnmergeUsersOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/block": {
      "post": {
        "operationId": "users.block",
        "summary": "Block a person's device credentials",
        "description": "Blocks a person's device credentials on their next request. Blocking a merged-away person blocks the person kept. Needs an owner or admin in person; keys and agents get `approval_required`. Applies where device sign-in is switched on.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The person to block, by `usr_…` ID. A person merged into another resolves to the person kept"
                  }
                },
                "required": [
                  "user"
                ],
                "additionalProperties": false,
                "description": "Blocking a merged-away person blocks the person kept."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Block a person's device credentials",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockState"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/unblock": {
      "post": {
        "operationId": "users.unblock",
        "summary": "Unblock a person's device credentials",
        "description": "Lifts the block on a person's device credentials. Unblocking a merged-away person unblocks the person kept. Needs an owner or admin in person; keys and agents get `approval_required`. Applies where device sign-in is switched on.",
        "tags": [
          "users"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user": {
                    "type": "string",
                    "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The person to unblock, by `usr_…` ID. A person merged into another resolves to the person kept"
                  }
                },
                "required": [
                  "user"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Unblock a person's device credentials",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockState"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints": {
      "post": {
        "operationId": "webhook_endpoints.create",
        "summary": "Add a webhook endpoint",
        "description": "Lurk sends the events you pick to this URL, signed with the secret in the response. The secret is shown once. A project can have up to 25 active endpoints; switched-off ones are not counted.",
        "tags": [
          "webhook_endpoints"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Add a webhook endpoint",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedWebhookEndpoint"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "webhook_endpoints.list",
        "summary": "List webhook endpoints",
        "description": "Newest first. Shows where events go and whether each endpoint is still switched on.",
        "tags": [
          "webhook_endpoints"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List webhook endpoints",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhook-endpoints/{id}/delete": {
      "post": {
        "operationId": "webhook_endpoints.delete",
        "summary": "Delete a webhook endpoint",
        "description": "Stops sending to it and removes its delivery history. This can't be undone.",
        "tags": [
          "webhook_endpoints"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A webhook endpoint ID, starting with `whe_`."
            },
            "required": true,
            "description": "A webhook endpoint ID, starting with `whe_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete a webhook endpoint",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedWebhookEndpoint"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/known-values": {
      "get": {
        "operationId": "known_values.list",
        "summary": "List the properties that remember their values",
        "description": "Lists the properties of your own events that a person turned \"remember values\" on for, each with the values Lurk has seen (at most 20) or why it turned itself off. A property nobody turned on is not listed. [Events](/events#remember-values)",
        "tags": [
          "known_values"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$",
              "description": "Only this event's properties"
            },
            "required": false,
            "description": "Only this event's properties",
            "name": "event",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List the properties that remember their values",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnownValuesList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/feedback": {
      "post": {
        "operationId": "feedback.send",
        "summary": "Send feedback to the Lurk team",
        "description": "Sends a bug, gap, idea, docs problem or question to the Lurk team. Staff read it before it is shared in their tracker; no reply is promised. Ask your user first, once per task. Never include secrets, keys or your users' data: removal is best effort, best in English. 5 a minute; 50 a project a day.",
        "tags": [
          "feedback"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": false,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendFeedbackInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Send feedback to the Lurk team",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackReceipt"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.\n\n- `rate_limited`: Wait for the `Retry-After` time, then retry with the same idempotency key. Spread requests out if this keeps happening.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/annotations": {
      "get": {
        "operationId": "annotations.list",
        "summary": "List annotations",
        "description": "Lists the project’s chart annotations between two days, oldest first. An annotation is a short note on one day, shown on charts. [Annotations](/annotations)",
        "tags": [
          "annotations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "date",
              "description": "The first day, inclusive."
            },
            "required": true,
            "description": "The first day, inclusive.",
            "name": "from",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date",
              "description": "The last day, inclusive: the same as `from` for one day, and at most 800 days after it."
            },
            "required": true,
            "description": "The last day, inclusive: the same as `from` for one day, and at most 800 days after it.",
            "name": "to",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List annotations",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnotationList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "annotations.create",
        "summary": "Add an annotation",
        "description": "Adds a chart annotation: a day and one short sentence. An owner, admin or developer, or a project key. Don’t put personal data in the text. [Annotations](/annotations)",
        "tags": [
          "annotations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnnotationInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Add an annotation",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Annotation"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/annotations/{id}": {
      "patch": {
        "operationId": "annotations.update",
        "summary": "Change an annotation",
        "description": "Changes an annotation’s day or text. [Annotations](/annotations)",
        "tags": [
          "annotations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "An annotation ID, starting with `ann_`."
            },
            "required": true,
            "description": "An annotation ID, starting with `ann_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "day": {
                    "type": "string",
                    "format": "date",
                    "description": "The new day; left out, the day stays."
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 140,
                    "description": "The new text; left out, the text stays."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Change an annotation",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Annotation"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "annotations.delete",
        "summary": "Remove an annotation",
        "description": "Removes an annotation from every chart. It can’t be undone. [Annotations](/annotations)",
        "tags": [
          "annotations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "An annotation ID, starting with `ann_`."
            },
            "required": true,
            "description": "An annotation ID, starting with `ann_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove an annotation",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedAnnotation"
                }
              }
            }
          },
          "404": {
            "description": "- `not_found`: Check the ID or key, and that you are in the right project. Each project is separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers": {
      "get": {
        "operationId": "trusted_issuers.list",
        "summary": "List trusted issuers",
        "description": "Newest first. The sign-in providers this project has set up, paused or archived.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "description": "How many to return, 1 to 100. Defaults to 25."
            },
            "required": false,
            "description": "How many to return, 1 to 100. Defaults to 25.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The next_cursor from the previous page. Leave it out for the first page."
            },
            "required": false,
            "description": "The next_cursor from the previous page. Leave it out for the first page.",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List trusted issuers",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TrustedIssuer"
                      },
                      "description": "The items on this page"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as cursor for the next page; null at the end"
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "trusted_issuers.create",
        "summary": "Add a trusted issuer",
        "description": "Saves a paused trusted issuer. Owner or admin in person. A project key or agent key can save it when agent go-live is on for the project and the project does not require approval. Otherwise, keys get `approval_required`. A member's assistant signed in with OAuth always gets `approval_required`.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTrustedIssuerInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Add a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers/{id}": {
      "get": {
        "operationId": "trusted_issuers.get",
        "summary": "Get a trusted issuer",
        "description": "One trusted issuer: profile, addresses, revision, status and the health of its signing keys. `can_activate` says whether it could be activated now.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "trusted_issuers.update",
        "summary": "Rename a trusted issuer",
        "description": "Renames a trusted issuer. Nothing else can be edited: a different address or profile is a new issuer. A rename does not change the revision; a stale `expected_revision` changes nothing.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The `revision` you last read. If the issuer has moved on, nothing changes and the call is refused (`validation_failed` on `expected_revision`): read it again."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "A name to tell issuers apart, 1 to 80 characters. Renaming is the only edit an issuer allows."
                  }
                },
                "required": [
                  "expected_revision",
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rename a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers/{id}/activate": {
      "post": {
        "operationId": "trusted_issuers.activate",
        "summary": "Activate a trusted issuer",
        "description": "Turns a checked, healthy, paused issuer on. Its last check, and for `oidc` a verified token test, must be at the current revision and at most 24 hours old, or it is refused. Owner or admin in person; a key or agent gets `approval_required`.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The `revision` you last read. If the issuer has moved on, nothing changes and the call is refused (`validation_failed` on `expected_revision`): read it again."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Activate a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers/{id}/pause": {
      "post": {
        "operationId": "trusted_issuers.pause",
        "summary": "Pause a trusted issuer",
        "description": "Stops an issuer's tokens from signing anyone in; bindings stay. A saved issuer is paused already. An archived issuer stays archived. Owner or admin in person; a key or agent gets `approval_required`.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The `revision` you last read. If the issuer has moved on, nothing changes and the call is refused (`validation_failed` on `expected_revision`): read it again."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pause a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers/{id}/archive": {
      "post": {
        "operationId": "trusted_issuers.archive",
        "summary": "Archive a trusted issuer",
        "description": "Retires an issuer for good: no credential can use it; bindings and receipts stay, and its address can be set up again as a new issuer. Cannot be undone. Owner or admin in person; a key or agent gets `approval_required`.",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The `revision` you last read. If the issuer has moved on, nothing changes and the call is refused (`validation_failed` on `expected_revision`): read it again."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive a trusted issuer",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trusted-issuers/{id}/check": {
      "post": {
        "operationId": "trusted_issuers.check",
        "summary": "Check a trusted issuer's signing keys",
        "description": "Fetches the issuer's signing keys now and saves what it found: key count, `key_ids_hash`, algorithms, any `problem`. Activation needs a check at the current revision. About 10 a minute per project, one fetch per issuer at a time (`rate_limited`).",
        "tags": [
          "trusted_issuers"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A trusted issuer ID, starting with `iss_`."
            },
            "required": true,
            "description": "A trusted issuer ID, starting with `iss_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expected_revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "description": "The `revision` you last read. If the issuer has moved on, nothing changes and the call is refused (`validation_failed` on `expected_revision`): read it again."
                  }
                },
                "required": [
                  "expected_revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Check a trusted issuer's signing keys",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrustedIssuer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/client-events": {
      "get": {
        "operationId": "client_events.get",
        "summary": "Get what a device may send",
        "description": "The event names a device (a signed-in app user) may send, each with its cap and property limits, plus the per-person, project-wide and new-people caps. Empty until a person saves; any other name is refused. `revision` is 0 before the first save.",
        "tags": [
          "client_events"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get what a device may send",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientEventsSetting"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuer-identities": {
      "get": {
        "operationId": "issuer_identities.list",
        "summary": "List identity bindings",
        "description": "Newest first. Which person each sign-in subject of your trusted issuers is bound to. Filter by `issuer_id` or by `user` (that person and the people merged into them). The subject is never returned.",
        "tags": [
          "issuer_identities"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^iss_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "Only bindings under this trusted issuer."
            },
            "required": false,
            "description": "Only bindings under this trusted issuer.",
            "name": "issuer_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
              "description": "Only this person's bindings and those of the people merged into them."
            },
            "required": false,
            "description": "Only this person's bindings and those of the people merged into them.",
            "name": "user",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "description": "How many to return, 1 to 100. Defaults to 25."
            },
            "required": false,
            "description": "How many to return, 1 to 100. Defaults to 25.",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The next_cursor from the previous page. Leave it out for the first page."
            },
            "required": false,
            "description": "The next_cursor from the previous page. Leave it out for the first page.",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List identity bindings",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IssuerIdentity"
                      },
                      "description": "The items on this page"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass it as cursor for the next page; null at the end"
                    }
                  },
                  "required": [
                    "data",
                    "next_cursor"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "issuer_identities.map",
        "summary": "Bind a sign-in subject to a person",
        "description": "Binds a provider user id (`subject`, write-only, never returned) to an existing person. Refused if already bound (unmap first), or for a merged-away person or archived issuer. Owner or admin in person; a key or agent gets `approval_required`.",
        "tags": [
          "issuer_identities"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "issuer_id": {
                    "type": "string",
                    "pattern": "^iss_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The trusted issuer the subject belongs to. Not archived."
                  },
                  "subject": {
                    "type": "string",
                    "pattern": "^[!-~]{1,255}$",
                    "description": "The provider's own user id (the `sub` of its tokens), exactly as its dashboard shows it: 1 to 255 printable ASCII characters, no spaces. Write-only: sealed, never returned. The same subject under another issuer is a different identity."
                  },
                  "user": {
                    "type": "string",
                    "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                    "description": "The existing person to bind it to. A person merged into someone else is refused: use the person they were merged into."
                  }
                },
                "required": [
                  "issuer_id",
                  "subject",
                  "user"
                ],
                "additionalProperties": false,
                "description": "Refused with validation_failed on param subject when already bound; the same subject under another issuer is allowed."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bind a sign-in subject to a person",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuerIdentity"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/issuer-identities/{id}": {
      "delete": {
        "operationId": "issuer_identities.unmap",
        "summary": "Remove an identity binding",
        "description": "Removes a binding, even a merged-away person's; the person stays. The next sign-in with that subject makes a new person unless it is mapped first or the new-people limit refuses it. Owner or admin in person; a key or agent gets `approval_required`.",
        "tags": [
          "issuer_identities"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "An issuer identity ID, starting with `iid_`."
            },
            "required": true,
            "description": "An issuer identity ID, starting with `iid_`.",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remove an identity binding",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^iid_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                      "description": "An issuer identity ID, starting with `iid_`."
                    },
                    "removed": {
                      "type": "boolean",
                      "enum": [
                        true
                      ],
                      "description": "Always true: the binding is gone."
                    }
                  },
                  "required": [
                    "id",
                    "removed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals": {
      "post": {
        "operationId": "proposals.create",
        "summary": "Propose a change for a person to approve",
        "description": "Asks a person to approve 1 to 10 changes in order, including a starter template or units, rules and taking them live in one request. Later steps may refer to unit or rule keys created earlier in the same request. Nothing runs until an owner or admin approves.",
        "tags": [
          "proposals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProposalInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Propose a change for a person to approve",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proposal"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "proposals.list",
        "summary": "List proposals",
        "description": "Proposals newest first. By default the open ones, the ones waiting for a person; `waiting` counts them. An open proposal past its expiry reads as expired.",
        "tags": [
          "proposals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "approved",
                "declined",
                "expired"
              ],
              "description": "Defaults to open: the ones waiting"
            },
            "required": false,
            "description": "Defaults to open: the ones waiting",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List proposals",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProposalList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals/{id}": {
      "get": {
        "operationId": "proposals.get",
        "summary": "Get a proposal",
        "description": "One proposal with its changes, who asked, and how it was decided.",
        "tags": [
          "proposals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The prop_… ID"
            },
            "required": true,
            "description": "The prop_… ID",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a proposal",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Proposal"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/proposals/{id}/wait": {
      "get": {
        "operationId": "proposals.wait",
        "summary": "Wait for a proposal decision",
        "description": "After sharing the approval link, wait here for the person's decision. Continue when approved, stop when declined, and call again with the same ID when still_waiting.",
        "tags": [
          "proposals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The prop_… ID"
            },
            "required": true,
            "description": "The prop_… ID",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Wait for a proposal decision",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitForProposalOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/holds": {
      "get": {
        "operationId": "holds.list",
        "summary": "List holds",
        "description": "Changes a rule parked for a person, newest first. By default the ones still waiting; `waiting` counts them. Nothing has changed for the person until a hold is given.",
        "tags": [
          "holds"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "held",
                "given",
                "refused"
              ],
              "description": "Defaults to held: the ones waiting"
            },
            "required": false,
            "description": "Defaults to held: the ones waiting",
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "A usr_… ID"
            },
            "required": false,
            "description": "A usr_… ID",
            "name": "user",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "A rule_… ID or the rule's key"
            },
            "required": false,
            "description": "A rule_… ID or the rule's key",
            "name": "rule",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List holds",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HoldList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/holds/{id}": {
      "get": {
        "operationId": "holds.get",
        "summary": "Get a hold",
        "description": "One hold with the changes it would make, why it waits, and how it was decided.",
        "tags": [
          "holds"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "The hold_… ID"
            },
            "required": true,
            "description": "The hold_… ID",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a hold",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Hold"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/audiences": {
      "get": {
        "operationId": "audiences.list",
        "summary": "List audiences",
        "description": "The groups of people rules can read, newest first, with how many are in each, which rules read it and whether a condition is broken (`status`, `problems`). A condition audience's members are worked out every five minutes: `refreshed_at` says when, and a rule sees it as it stood then.",
        "tags": [
          "audiences"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/AudienceKind"
            },
            "required": false,
            "description": "list: people added by hand or over the API. condition: kept up to date by its conditions",
            "name": "kind",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List audiences",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudienceList"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `unavailable`: This is not available right now (or not set up on this server yet). Retry in a moment with the same idempotency key, and ask us if it stays unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "audiences.create",
        "summary": "Create an audience",
        "description": "Makes a list (people you add) or a condition audience (kept up to date by its conditions). A new condition audience starts empty. The worker fills it with people who match. A project can have 100 condition audiences. Rules read it in `if`. [Audiences](/units#audiences)",
        "tags": [
          "audiences"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAudienceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create an audience",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Audience"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "- `unavailable`: This is not available right now (or not set up on this server yet). Retry in a moment with the same idempotency key, and ask us if it stays unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/audiences/{id}/users": {
      "post": {
        "operationId": "audiences.add_users",
        "summary": "Add people to a list audience",
        "description": "Adds up to 1,000 people by `usr_…` ID or by the brand's own ID. People already in it are counted, not added twice. An ID that matches nobody is returned in `not_found` and nothing is created for it. Only a list audience takes people by hand: a condition audience keeps its own members.",
        "tags": [
          "audiences"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A list audience: an aud_… ID or its key"
            },
            "required": true,
            "description": "A list audience: an aud_… ID or its key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Your own identifier for the person: an email, a user ID or a session ID. 1 to 256 characters"
                    },
                    "minItems": 1,
                    "maxItems": 1000,
                    "description": "usr_… IDs or the brand's own IDs. Up to 1,000 at a time"
                  }
                },
                "required": [
                  "users"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add people to a list audience",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAudienceUsersOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/budgets": {
      "get": {
        "operationId": "budgets.list",
        "summary": "List rule budgets",
        "description": "What each live rule's budgets have given in the window they are in now ('5,000 Beans a week'), newest rule first, with the window's start and end in the project's time zone. A rule's budgets are never split across pages. `nearly_used` keeps those 80% or more used.",
        "tags": [
          "budgets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "A rule_… ID or the rule's key"
            },
            "required": false,
            "description": "A rule_… ID or the rule's key",
            "name": "rule",
            "in": "query"
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Only budgets 80% or more used in this window"
            },
            "required": false,
            "description": "Only budgets 80% or more used in this window",
            "name": "nearly_used",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List rule budgets",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates": {
      "get": {
        "operationId": "templates.list",
        "summary": "List templates",
        "description": "The kits that add units and rules in one go, in the catalog's order, with whether each is available, or already added to this project (`in_use`). `filter: in_use` shows what this project has added.",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "in_use"
              ],
              "description": "Defaults to all"
            },
            "required": false,
            "description": "Defaults to all",
            "name": "filter",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/TemplateCategory"
            },
            "required": false,
            "description": "The group the catalog shows the template in",
            "name": "category",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List templates",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}": {
      "get": {
        "operationId": "templates.get",
        "summary": "Get a template",
        "description": "One template: what it adds (units, and rules that arrive as drafts) with its default settings, the settings a person can change, and when it was added to this project.",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A tpl_… ID or the template's key"
            },
            "required": true,
            "description": "A tpl_… ID or the template's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a template",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}/plan": {
      "post": {
        "operationId": "templates.plan",
        "summary": "Plan a template",
        "description": "What adding a template with these settings would do, and a test week: a fixed, made-up week of visits, orders and sign-ups run through the real engine against the template's own rules. Nothing is written. Say what already exists (it is reused, not added again) and what to check.",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A tpl_… ID or the template's key"
            },
            "required": true,
            "description": "A tpl_… ID or the template's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settings": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 80
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "description": "Values for the template's settings, by key. Leave one out for its default. Text is 1 to 40 characters, a number is a whole number from 1 to 1,000,000"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plan a template",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanTemplateOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}/install": {
      "post": {
        "operationId": "templates.install",
        "summary": "Add a template",
        "description": "Adds a template's units, views and rules; the rules are drafts and a person takes each live. Existing units and views are reused. Refused if the template is already added, a unit exists with other settings, or a rule key belongs to another rule. To change settings, remove and re-add.",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A tpl_… ID or the template's key"
            },
            "required": true,
            "description": "A tpl_… ID or the template's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settings": {
                    "type": "object",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 80
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "description": "Values for the template's settings, by key. Leave one out for its default. Text is 1 to 40 characters, a number is a whole number from 1 to 1,000,000"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Add a template",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstallTemplateOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}/remove": {
      "post": {
        "operationId": "templates.remove",
        "summary": "Take a template back",
        "description": "Removes the rules the template added **that are still drafts**, and forgets that it was added. Live or paused rules, a rule another added template also uses, the units and everything people earned stay, counted in `kept`. A draft that was never live has no receipts, so the ledger is untouched.",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A tpl_… ID or the template's key"
            },
            "required": true,
            "description": "A tpl_… ID or the template's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Take a template back",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveTemplateOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/views": {
      "get": {
        "operationId": "views.list",
        "summary": "List views",
        "description": "The saved questions of the project, newest first. A view is typed data (who, what, over, shape), never SQL. Search matches a name or key; `conversion=true` lists only conversions.",
        "tags": [
          "views"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Part of a view's name or key"
            },
            "required": false,
            "description": "Part of a view's name or key",
            "name": "search",
            "in": "query"
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Only the views marked as conversions."
            },
            "required": false,
            "description": "Only the views marked as conversions.",
            "name": "conversion",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List views",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "views.create",
        "summary": "Create a view",
        "description": "Saves a question about the project: who, what, over which range, as which shape (number, chart, ranked list). A member, key, brand agent or Lurky may; not a viewer. Audience and units must exist. `key` defaults to a slug of the name (`view-` first if a digit leads). [Views](/views#save-a-view)",
        "tags": [
          "views"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateViewInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Create a view",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "409": {
            "description": "- `idempotency_conflict`: You used an idempotency key with a different request. Use a new key for a new request; reuse a key only to retry the same one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/views/{id}": {
      "get": {
        "operationId": "views.get",
        "summary": "Get a view",
        "description": "A view and its answer: a number, a series over time, or a ranked list. `range` reads another range, `compare` adds the span of the same length just before, `audience` reads for another audience. Ranges and weeks (Monday to Sunday) follow the project's time zone. [Views](/views#read-a-view)",
        "tags": [
          "views"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A view_… ID or the view's key"
            },
            "required": true,
            "description": "A view_… ID or the view's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "now",
                "today",
                "this_week",
                "last_week",
                "last_7_days",
                "last_14_days",
                "last_30_days",
                "last_90_days",
                "this_month",
                "all_time"
              ],
              "description": "Read over this range instead of the view's own"
            },
            "required": false,
            "description": "Read over this range instead of the view's own",
            "name": "range",
            "in": "query"
          },
          {
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string"
                }
              ],
              "description": "Also answer for the span of the same length just before"
            },
            "required": false,
            "description": "Also answer for the span of the same length just before",
            "name": "compare",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "description": "Read for this audience instead of the view's who"
            },
            "required": false,
            "description": "Read for this audience instead of the view's who",
            "name": "audience",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a view",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ViewWithAnswer"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "views.update",
        "summary": "Update a view",
        "description": "Renames a view, changes its description, replaces its whole definition, or sets or clears `conversion` (an owner, admin, developer or key only). Send at least one change. Dashboards that show it show the new question. [Views](/views#list-and-change-views)",
        "tags": [
          "views"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "A view_… ID or the view's key"
            },
            "required": true,
            "description": "A view_… ID or the view's key",
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "description": "A new name, 1 to 80 characters"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 280,
                    "description": "A new note, up to 280 characters; null removes it"
                  },
                  "definition": {
                    "type": "object",
                    "properties": {
                      "who": {
                        "$ref": "#/components/schemas/ViewWho"
                      },
                      "what": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/ViewMeasure"
                        },
                        "minItems": 1,
                        "maxItems": 4,
                        "description": "What to count: 1 to 4 measures. A list ranks by the first and shows the others as columns"
                      },
                      "over": {
                        "$ref": "#/components/schemas/ViewRange"
                      },
                      "shape": {
                        "$ref": "#/components/schemas/ViewShape"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "trusted",
                          "platform",
                          "onchain",
                          "web_identified",
                          "any"
                        ],
                        "description": "Whose events this view counts. Left out is the same as platform: trusted and chat platform events (chat is not available yet). trusted: only your server, an agent or a person in Lurk. onchain: only Lurk's on-chain observations (not available yet). web_identified: server-verified web identification (not available yet). any: all sources; devices, on-chain observations and web identification are not available yet. Units given, spent and held, and new people are counted whatever this says"
                      }
                    },
                    "required": [
                      "who",
                      "what",
                      "over",
                      "shape"
                    ],
                    "additionalProperties": false,
                    "description": "Replaces the whole definition"
                  },
                  "conversion": {
                    "type": "boolean",
                    "description": "Set or clear the mark. Left out: unchanged"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Update a view",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/View"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/views/preview": {
      "post": {
        "operationId": "views.preview",
        "summary": "Preview a view",
        "description": "Answers a view without saving it: a number, series, ranked list or funnel. A funnel counts one try per person, from their first step one in the range; a later try is not counted. Members of every role, keys and brand agents. At most 90 days. [Views](/views#preview-a-view)",
        "tags": [
          "views"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewViewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preview a view",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewViewAnswer"
                }
              }
            }
          },
          "422": {
            "description": "- `validation_failed`: Nothing was changed. Fix what the message says is wrong (the field is named in `param` when there is one) and send the request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integrations": {
      "get": {
        "operationId": "integrations.list",
        "summary": "List integrations",
        "description": "Every way events reach Lurk or state leaves it, with its status: `connected`, `needs_attention`, `not_connected` or `later` (not available yet). Your app (once an active key is used), MCP, webhooks, Web; chat platforms are not available yet. `filter: connected` includes `needs_attention`.",
        "tags": [
          "integrations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "description": "How many items to return, 1 to 200"
            },
            "required": false,
            "description": "How many items to return, 1 to 200",
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "description": "The `next_cursor` of the previous page; leave out for the first page"
            },
            "required": false,
            "description": "The `next_cursor` of the previous page; leave out for the first page",
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "connected",
                "events_in",
                "mirrored_out"
              ],
              "description": "Defaults to all. connected includes the ones that need attention"
            },
            "required": false,
            "description": "Defaults to all. connected includes the ones that need attention",
            "name": "filter",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "List integrations",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationList"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integrations/health": {
      "get": {
        "operationId": "integrations.health",
        "summary": "Get the health of the integrations",
        "description": "What is wrong with this project's connectors, and how to fix it. Without `key` it answers for those connected or needing attention; with `key`, for that one. `needs_attention` counts them all. A failing webhook endpoint or refused Web collection is a problem; an endpoint a person turned off is not.",
        "tags": [
          "integrations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "description": "Check one connector; leave it out for the ones that are connected"
            },
            "required": false,
            "description": "Check one connector; leave it out for the ones that are connected",
            "name": "key",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get the health of the integrations",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationHealthOutput"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/setup": {
      "get": {
        "operationId": "projects.setup",
        "summary": "Get what is left to set this project up",
        "description": "The steps to set the project up (unit, rule, Home dashboard, go-live, app key, first event), which are done, and which dashboard areas they open. Derived from project state, so agent work counts. Once a rule goes live nothing is locked. Locks are advice: no operation is refused.",
        "tags": [
          "projects"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get what is left to set this project up",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSetup"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clock": {
      "get": {
        "operationId": "clocks.get",
        "summary": "Get the project's clock",
        "description": "What time it is in this project, and whether it has been moved from real time. Only a test project's clock can be moved. Every other project shows real time.",
        "tags": [
          "clocks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          }
        ],
        "responses": {
          "200": {
            "description": "Get the project's clock",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectClock"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clock/advance": {
      "post": {
        "operationId": "clocks.advance",
        "summary": "Advance a test project's clock",
        "description": "Moves the project's time forward by days, hours or minutes, so a seven-day streak, a weekly schedule or an expiry can be tried without waiting. Test projects only. Scheduled rules and expiries that come due run within a minute. Time only moves forward, except for a reset.",
        "tags": [
          "clocks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvanceClockInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Advance a test project's clock",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectClock"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clock/set": {
      "post": {
        "operationId": "clocks.set",
        "summary": "Set a test project's clock to a time",
        "description": "Sets the time the project thinks it is, such as the Monday a schedule should run. It cannot be earlier than the project's time now; use a reset to start over. Test projects only.",
        "tags": [
          "clocks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetClockInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set a test project's clock to a time",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectClock"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/clock/reset": {
      "post": {
        "operationId": "clocks.reset",
        "summary": "Reset a test project's clock to real time",
        "description": "Ends the test clock: the project runs on real time again. This is the one way time goes back, so receipts made while the clock was ahead will look as if they come from the future until real time catches up. Test projects only.",
        "tags": [
          "clocks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "W3C Trace Context; joins your trace to ours"
            },
            "required": false,
            "description": "W3C Trace Context; joins your trace to ours",
            "name": "traceparent",
            "in": "header"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "A retry with the same key and body returns the first response"
            },
            "required": true,
            "description": "A retry with the same key and body returns the first response",
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetClockInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reset a test project's clock to real time",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectClock"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Wait `Retry-After` seconds.",
            "headers": {
              "Request-Id": {
                "schema": {
                  "type": "string",
                  "description": "Quote this when you contact support"
                },
                "required": true,
                "description": "Quote this when you contact support"
              },
              "traceparent": {
                "schema": {
                  "type": "string",
                  "description": "W3C Trace Context for this call, in the caller's trace"
                },
                "required": true,
                "description": "W3C Trace Context for this call, in the caller's trace"
              },
              "RateLimit": {
                "schema": {
                  "type": "string",
                  "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
                },
                "required": true,
                "description": "The tightest limit now, e.g. `\"ingest-key\";r=5999;t=42`"
              },
              "RateLimit-Policy": {
                "schema": {
                  "type": "string",
                  "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
                },
                "required": true,
                "description": "Its quota and window, e.g. `\"ingest-key\";q=6000;w=60`"
              },
              "Retry-After": {
                "schema": {
                  "type": "string",
                  "description": "Seconds to wait"
                },
                "required": true,
                "description": "Seconds to wait"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
