{
  "openapi": "3.1.0",
  "info": {
    "title": "eKard Agent API",
    "version": "1",
    "summary": "Operate a eKard account over HTTP: cards, contacts, documents, QR codes, designs, analytics, organizations, and Calendar's bookings, schedule, clients, takings and insights.",
    "description": "REST JSON API for AI agents acting on an account owner's behalf: everything the owner can do in the web app, over HTTP.\n\n- **Key:** the owner finds the account's API key at https://ekard.app/account/ai and sends it on every request as `Authorization: Bearer <key>`. One account, one key, full account power; rotating it there stops the old key at once.\n- **eKard's own app** signs in per device instead (the App tag): its access tokens work wherever the key does.\n- **Responses** are JSON wrapped in a resource key (`{\"kard\": {...}}`). **Errors** are `{\"error\": {\"code\", \"message\", \"details\"}}` with the right HTTP status; `404` means the record doesn't exist or isn't this account's, `403` that it exists but the account's role can't do that.\n- **Updates are partial:** omitted fields keep their value; send `\"\"` to clear one. `PUT` is accepted wherever `PATCH` is, with the same meaning.\n- **Kards are addressed by `share_link`** (their public URL slug). If the same share_link exists in two of your organizations, add `?organization=<org-slug>`.\n- **Times in words** (\"Mon–Sat 10:00 AM–7:00 PM\") follow each calendar's clock, 12- or 24-hour by its country. An app sends its phone's setting as the `Hour-Cycle` header (`24` or `12`) and every answer words times its way; messages to clients keep the calendar's clock.\n- The prose reference, with examples and advice for agents: https://ekard.app/api/v1/docs\n",
    "termsOfService": "https://ekard.app/pages/terms_and_conditions",
    "contact": {
      "name": "eKard support",
      "url": "https://ekard.app/pages/help"
    }
  },
  "externalDocs": {
    "description": "The full reference as plain markdown",
    "url": "https://ekard.app/api/v1/docs"
  },
  "servers": [
    {
      "url": "https://ekard.app/api/v1"
    }
  ],
  "security": [
    {
      "apiKey": [

      ]
    },
    {
      "appSession": [

      ]
    }
  ],
  "tags": [
    {
      "name": "Docs",
      "description": "These descriptions. Public, no key needed."
    },
    {
      "name": "MCP",
      "description": "The same API as Model Context Protocol tools, for Claude, ChatGPT, Cursor and any other MCP client: one endpoint, the same key, the same permissions."
    },
    {
      "name": "Account",
      "description": "The account behind the key, and its plan."
    },
    {
      "name": "App",
      "description": "For eKard's own app, not for agents (they use the account's API key). Signing in: each device gets its own access token (`eka_…`, an hour) and refresh token (`ekr_…`, 60 days from its last use), revocable one at a time."
    },
    {
      "name": "Kards",
      "description": "Digital business cards, addressed by share_link."
    },
    {
      "name": "Analytics",
      "description": "Visits, devices, sources and contacts, per kard and per account."
    },
    {
      "name": "Contacts",
      "description": "People who sent their details through a kard (leads)."
    },
    {
      "name": "Hooks",
      "description": "REST hooks: an automation tool (Zapier, Make, n8n, your own code) subscribes an address to hear about new contacts as they arrive, each POSTed as the contact.created webhook event, and unsubscribes it when it stops."
    },
    {
      "name": "Reports",
      "description": "Report a kard, booking page or file to eKard's Grievance Officer, as the web's complaint form (/grievance) does: the same categories, clocks and evidence rules. Any key. Blocking someone from reaching a kard is under Contacts."
    },
    {
      "name": "Events",
      "description": "Named lead-capture buckets, such as a trade fair; contacts can carry an event_id."
    },
    {
      "name": "Products",
      "description": "What a kard sells, each with a photo, a price and one button (order on WhatsApp, pay, ask, or open its page). Money never passes through eKard."
    },
    {
      "name": "Documents",
      "description": "Files on a kard, each with a stable public URL and QR code, and an optional custom landing page."
    },
    {
      "name": "QR code",
      "description": "The kard's QR code design, logo and image."
    },
    {
      "name": "Email signature",
      "description": "The kard as an email signature, free on every plan: HTML that pastes into Gmail, Outlook and Apple Mail, and its plain text."
    },
    {
      "name": "Custom design",
      "description": "The kard's own HTML page, with drafts, publishing, history, checkpoints and templates."
    },
    {
      "name": "Organizations",
      "description": "Organizations where the account is an admin, and their teams; leaving one is any member's."
    },
    {
      "name": "Custom domains",
      "description": "A personal kard's or an organization's own domain, such as card.priya.com, on every paid plan: connect it, add the DNS record it asks for, and it goes live with HTTPS. The eKard link keeps working beside it."
    },
    {
      "name": "Bookmarks",
      "description": "Other kards this account saved."
    },
    {
      "name": "Bookings",
      "description": "The booking calendars this account manages, and what can be booked from a kard."
    },
    {
      "name": "Calendar",
      "description": "The booking calendar behind the kards: appointments, meetings, clients and the front desk. A key does in Calendar exactly what its person can do on the web, on the same roles (admin, front desk, staff); a calendar it has no role on answers 404, like one that doesn't exist."
    },
    {
      "name": "Calendar setup",
      "description": "Set a calendar up and keep it right: the kind of business and its settings, the menu, the team with their hours and time off, single-use booking links, who signs in, webhooks, importing a price list or clients, syncing with Google Calendar or Outlook, and the phones and browsers that show its notifications. Mostly for the calendar's admins."
    }
  ],
  "paths": {
    "/docs": {
      "get": {
        "operationId": "getReference",
        "tags": [
          "Docs"
        ],
        "summary": "The API reference as markdown",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The reference, plain markdown.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiDescription",
        "tags": [
          "Docs"
        ],
        "summary": "This OpenAPI 3.1 description",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The description, as JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "sendMcpMessage",
        "tags": [
          "MCP"
        ],
        "summary": "Send one MCP message (JSON-RPC 2.0)",
        "description": "The Model Context Protocol over Streamable HTTP: POST one JSON-RPC message, get one JSON answer (no event streams, no sessions). Its tools are this API's endpoints (`tools/list` names them: contacts, Kards, analytics, events, calendars, free times, bookings, the reference, and `api_request` for any other endpoint), each run with the same key and the same permissions and limits; an API error comes back as a tool result with `isError: true` and the API's own message.\n\n- **2026-07-28** (no handshake): every request carries `params._meta` with `io.modelcontextprotocol/protocolVersion` and `io.modelcontextprotocol/clientCapabilities`, and the `MCP-Protocol-Version`, `Mcp-Method` and, for `tools/call`, `Mcp-Name` headers, which must say what the body says (`400`, code `-32020`). Methods: `server/discover`, `tools/list`, `tools/call`.\n- **2025-11-25, 2025-06-18, 2025-03-26**: `initialize` first, then `tools/list`, `tools/call` and `ping` with the agreed version in `MCP-Protocol-Version` (no header reads as 2025-03-26). No `Mcp-Session-Id` is issued.\n- A version it doesn't speak: `400`, code `-32022`, `data.supported` listing those it does. Notifications are answered `202` with no body.\n- 120 messages a minute per account (`429 rate_limited`, `Retry-After`). A browser page on another site is refused (`403`): MCP clients send no `Origin`.\n",
        "parameters": [
          {
            "name": "MCP-Protocol-Version",
            "in": "header",
            "required": false,
            "description": "The protocol version of this request (2026-07-28), or the one `initialize` agreed.",
            "schema": {
              "type": "string",
              "enum": [
                "2026-07-28",
                "2025-11-25",
                "2025-06-18",
                "2025-03-26"
              ]
            }
          },
          {
            "name": "Mcp-Method",
            "in": "header",
            "required": false,
            "description": "2026-07-28: the body's `method`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Mcp-Name",
            "in": "header",
            "required": false,
            "description": "2026-07-28, for `tools/call`: the body's `params.name` (`=?base64?…?=` when it can't be sent plain).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer to a request (`result`), or a JSON-RPC error the request can be fixed from (an unknown tool, `-32602`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          },
          "202": {
            "description": "A notification, or a client's own answer, accepted. No body."
          },
          "400": {
            "description": "Not one JSON-RPC 2.0 message (`-32700`, `-32600`), headers that don't say what the body says (`-32020`), a version it doesn't speak (`-32022`), or 2026-07-28 metadata missing (`-32602`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Sent from a page on another site (`Origin`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          },
          "404": {
            "description": "2026-07-28: a method this server doesn't have (`-32601`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "openMcpStream",
        "tags": [
          "MCP"
        ],
        "summary": "Open an event stream: there is none (405)",
        "description": "Every answer comes with its POST, so there is no stream of server messages to open. `Allow` says `POST`.",
        "security": [

        ],
        "responses": {
          "405": {
            "description": "POST only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "endMcpSession",
        "tags": [
          "MCP"
        ],
        "summary": "End a session: there is none (405)",
        "description": "No session is ever started, so there is none to end. `Allow` says `POST`.",
        "security": [

        ],
        "responses": {
          "405": {
            "description": "POST only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAnswer"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Account"
        ],
        "summary": "The account, its plan, counts, organizations and brand",
        "description": "Start here to confirm the key works.",
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "operationId": "updateAccount",
        "tags": [
          "Account"
        ],
        "summary": "Change the person's name, photo, WhatsApp hello, country, time zone or language",
        "description": "What the web's Profile › Edit (`/profile/edit`) changes. An account made without a name (the apps' sign-up didn't ask) has `account.name` null until then; ask for one. Spaces are tidied; a blank name or one over 100 characters is `422 validation_failed` (`details.name`), and so, since 1.9.14, is a new name holding a web address, an email address or a phone number (it goes into emails sent to others, as a team's name does): `message` says what to take out and where it goes instead (\"Name can't hold a web address: it goes into emails we send. Take out “calendar.app.google/…” and add it to your Kard, under Links\"); show it under the name. A name saved before stays until it's changed. `{\"name\": …}` works without the `account` wrapper. To set the photo, send the request as multipart/form-data with the file in `account[photo]` (JPEG, PNG, GIF or WebP, up to 5 MB; otherwise `422 validation_failed`, `details.photo`), with `account[name]` too or not; `account.image_url` in the answer is the new photo. `account[remove_photo]=1` (or `\"remove_photo\": true` in JSON) removes it: the Google photo, else initials, shows again. What isn't sent stays as it is, so a nameless account may set its photo first. `account[whatsapp_hello]` is the hello WhatsApp opens with beside each contact (`whatsapp_hello` in the answer, as `GET /me` gives it): up to 500 characters, line breaks kept; `{first_name}`, `{event}` and `{link}` are the only placeholders, and any other (`{name}`) is `422 validation_failed` (`details.whatsapp_hello`). Empty, or the same as the country's default, goes back to the default, which follows the default as it improves. Since 1.9.10, `account[country]` and `account[timezone]` (Profile › Edit's \"Country and time zone\", with its checks: a refused one says why, in `details`), and `account[language]` (Profile › Language: one of the eight, null for the phone's own); `message` says what was saved (\"Saved: your country is United States and your time zone Chicago time (CDT, America/Chicago).\"), the language's in the language chosen, with the kards that kept their words (since 1.9.13: a kard following the account's language keeps it, as on the web). A server before 1.9.10 answers `400` for a request with only these (it takes none of them).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AccountMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "account",
                    "message",
                    "whatsapp_hello"
                  ],
                  "properties": {
                    "account": {
                      "$ref": "#/components/schemas/Account"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Saved. You're Asha Rao on eKard.",
                        "Photo saved.",
                        "Photo removed. Your Google photo shows instead.",
                        "Saved. WhatsApp opens with your hello beside each contact.",
                        "Back to the default hello, in English.",
                        "Saved: your country is United States and your time zone Chicago time (CDT, America/Chicago).",
                        "Saved: your time zone is London time (BST, Europe/London). Follow-ups and the morning email follow your booking calendar's, India time (IST): change that one in the calendar's settings.",
                        "eKard is in English for you now."
                      ]
                    },
                    "whatsapp_hello": {
                      "$ref": "#/components/schemas/WhatsappHello"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "The name is blank, too long or holds a web or email address or a phone number (since 1.9.14) (`validation_failed`, with `details.name`), the WhatsApp hello is over 500 characters or names a placeholder other than the three (`validation_failed`, with `details.whatsapp_hello`), the photo isn't a JPEG, PNG, GIF or WebP image or is over 5 MB (`validation_failed`, with `details.photo`), the country, time zone or language isn't one the server knows (`validation_failed`, with `details.country`, `details.timezone` or `details.language`), or `photo` isn't a file sent as multipart/form-data, or `country`, `timezone` or `language` isn't text (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/nonce": {
      "get": {
        "operationId": "getSignInNonce",
        "tags": [
          "App"
        ],
        "summary": "A nonce for the next Google or Apple sign-in",
        "description": "Pass it to Credential Manager (`setNonce`), or to Google's sign-in page on iPhone, and send it back with the ID token. For Sign in with Apple, the Apple request carries its SHA-256 (lower-case hex), and `POST /sessions/apple` gets the nonce itself. It lasts 5 minutes and signs in once. 30 a minute per network.",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInNonce"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/sessions/google": {
      "post": {
        "operationId": "signInWithGoogle",
        "tags": [
          "App"
        ],
        "summary": "Sign in with a Google ID token",
        "description": "The ID token Credential Manager returned for the web client (`serverClientId`), or, on iPhone, the one Google's sign-in page gave for eKard's iOS client, with the nonce from `GET /sessions/nonce`. An email new to eKard creates the account (`created: true`); an account that used a password until now links to Google, as on the web. If that account's address was never verified, Google's verified owner takes it over: its password is removed (`has_password` false), every other app session and web sign-in ends, its AI key and its devices' notifications stop, and the owner is emailed. 30 sign-ins a minute per network.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleSignInInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in on this device.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`: the answer carries the tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSignIn"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "Google didn't confirm the token (`invalid_id_token`: a bad signature, another app's audience, expired), or one of eKard's apps didn't ask for it: its `azp` must be the release Android app's client (app signing or upload key) or the iOS app's. A debug build's client is taken on development servers only.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/EmailNotAllowed"
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "description": "The nonce isn't ours, has expired, was used, or isn't the token's (`invalid_nonce`: get a new one); Google hasn't verified the email (`email_not_verified`); or the device is described wrongly (`validation_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Google's keys couldn't be fetched to check the token (`google_unavailable`); try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/apple": {
      "post": {
        "operationId": "signInWithApple",
        "tags": [
          "App"
        ],
        "summary": "Sign in with Apple",
        "description": "eKard's iPhone app, with what Sign in with Apple returned (`ASAuthorizationAppleIDCredential`): the identity token, the authorization code and, at the first sign-in only, the person's name. The Apple request's nonce is the SHA-256 (lower-case hex) of a nonce from `GET /sessions/nonce`; send that nonce itself here. The account is the one this Apple Account signed in to before; otherwise the one with the email Apple verified (a private relay address too), which is linked to Apple from then on, as Google links one, and its owner is emailed that Sign in with Apple was added (an account whose address was never verified is taken over, as with `POST /sessions/google`); otherwise a new one (`created: true`), with no password. The server keeps Apple's refresh token, so deleting the account ends its link with Apple too. Where Sign in with Apple isn't set up (`features.apple_sign_in` is false in `GET /app/config`): `503 apple_sign_in_unavailable`. 30 sign-ins a minute per network.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppleSignInInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in on this device.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`: the answer carries the tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSignIn"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "Apple didn't confirm the token (`invalid_id_token`: a bad signature, another app's audience, expired).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/EmailNotAllowed"
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "description": "The nonce isn't ours, has expired, was used, or isn't the token's (`invalid_nonce`: get a new one); Apple shared no email address for an Apple Account new to eKard (`email_missing`), or one it hasn't verified (`email_not_verified`); or the device is described wrongly (`validation_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Sign in with Apple isn't set up on this server yet (`apple_sign_in_unavailable`: sign in another way), or Apple's keys couldn't be fetched to check the token (`apple_unavailable`: try again in a minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/password": {
      "post": {
        "operationId": "signInWithPassword",
        "tags": [
          "App"
        ],
        "summary": "Sign in, or create the account, with an email and password",
        "description": "A known email must match its password. An email new to eKard creates the account only with `create: true` (a password of 8 characters or more; `created: true`); without it the answer is `401 no_account` and nothing is made, so the app can ask \"No account for … Create one?\" first. 10 tries a minute per email (counted with the web's sign-in) and 30 sign-ins a minute per network.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordSignInInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in on this device.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`: the answer carries the tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSignIn"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "The email and password don't match (`invalid_credentials`; an account that signs in with Google or Apple only is told so), or no account uses the email and `create` wasn't true (`no_account`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/EmailNotAllowed"
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "description": "Too many tries: `rate_limited` (10 a minute per email, 30 sign-ins a minute per network), or `password_sign_in_paused`: 50 wrong passwords today for this account (web and app together), so password sign-in pauses for 24 hours even with the right password. \"Forgot password\" lifts it; Google sign-in still works. Wait `Retry-After` seconds.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/email_link": {
      "post": {
        "operationId": "requestSignInLink",
        "tags": [
          "App"
        ],
        "summary": "Email a sign-in link",
        "description": "\"Email me a sign-in link\" on the app's sign-in screen: the web's sign-in link, emailed to `email`. The answer is `202` with the same words for every address, and nothing is made yet: the link signs in to the account that uses the address, or makes one (verified, with no password) when it's used. It works once, for 15 minutes. Asking reads no account, so the answer's words, status and time are the same whether or not one exists.\n\n`device_nonce` is a random value this install of the app makes for the ask and keeps for 15 minutes, beside the address: send it again with the link's token (`POST /sessions/email_link/sign_in`). It shows that the link is being used on the device that asked for it, as the web's asking browser holds a cookie. The server keeps nothing of it: the link carries `bind`, a keyed HMAC of the link's own token and the nonce's keyed digest, so only this nonce with this very link counts as the device that asked (a token that leaked never does, even on a device that then asked for a link to the same address).\n\nThe email's link is `https://<host>/sign-in-link/open?token=…&bind=…&app=1`, on the host this request came to. With `app=1` it opens the app where the app is installed (App Links and Universal Links: `/.well-known/assetlinks.json`, `apple-app-site-association`), and the web's page otherwise; a link asked for on the web has no `app=1` and stays in the browser.\n\n**A code beside the link (`with_code: true`, from 1.9.4).** A screen that has a field for it says so: the email then carries an 8-digit code beside the link (\"4821 7390\"), and the `202` an `ask_id` and `code_length` (8). Typed on this screen (`POST /sessions/email_link/code`, with this ask's `ask_id` and `device_nonce`), the code signs this device in as the link would have if it had been opened here: so a link read on a computer or another phone can still sign in the phone that asked. The link and the code work once, for 15 minutes, and using either ends the other. A newer ask from this device (the same `device_nonce`) replaces this one's code, whatever the address: only the newest email's code works. Nobody else's ask touches it. Without `with_code` (every build before the field), the email and the `202` are word for word as before: the email never talks of a code the screen can't take. A server before 1.9.4 ignores `with_code`: its `202` has no `ask_id`, so show no field. Asking still reads no account: the `202`'s words, status and time are the same whether or not one exists, with or without `with_code`.\n\nLimits, counted with the web's asks: 5 links an hour for one mailbox from one network, 20 for it from anywhere, 30 different mailboxes and 40 links in all from one network (an IPv4 address, an IPv6 /64), 60 from one IPv4 /24 or IPv6 /48, and 300 for the whole site. A mailbox is the address without its `+tag` (and, for Gmail, without dots). A refused ask counts nothing.\n\n**Did you mean …?** An address one slip from a big email provider's (`kabir@gmial.com`, `gamil.com`, `hotmial.com`, `yahooo.com`) carries `did_you_mean` (`kabir@gmail.com`) in every answer to the ask: the `202`, and the `403`, `422` and `429` refusals' `error`. It's read from the typed address alone, never an account, so it's the same whether or not either address has one. The web's sign-in page does the same with the same address: it shows \"Did you mean kabir@gmail.com?\" under the field as the field is left and on any refusal, a button that puts the address in; it never stops the ask, so a link asked for anyway goes to the address as typed, and its \"Check your email\" page doesn't say it again. The app has no check as the field is left, so offer it after the answer: on Check your email, \"Did you mean kabir@gmail.com?\", whose press asks again for that address (a new ask, counted as one). An address with a real ending the list doesn't know (`kabir@mehtaevents.com`) has none; `gmail.con` is refused (`422`) with it, as before.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInLinkInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Sent, to an account or to an address with none (the words are the same). `did_you_mean` when the address is one slip from a big provider's. With `with_code: true`, `ask_id` and `code_length` too, and words that say a code is coming.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignInLinkSent"
                },
                "examples": {
                  "sent": {
                    "value": {
                      "message": "We've sent a link to meera@example.com. It works once, for 15 minutes. Open it on this phone to sign in."
                    }
                  },
                  "slip": {
                    "value": {
                      "message": "We've sent a link to kabir@gmial.com. It works once, for 15 minutes. Open it on this phone to sign in.",
                      "did_you_mean": "kabir@gmail.com"
                    }
                  },
                  "with_code": {
                    "value": {
                      "message": "We've sent a link and a code to meera@example.com. They work once, for 15 minutes. Open the link on this phone, or type the code here.",
                      "ask_id": "q8Zt3vN0bKx1WmYp7RsLfA",
                      "code_length": 8
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`email` or `device_nonce` is missing (`missing_parameter`), or `device_nonce` isn't 32 to 128 letters, digits, `-` or `_` (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Sign-ups and sign-ins from this email's domain are blocked (`email_not_allowed`), with `did_you_mean` when the address is one slip from a big provider's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The address is waiting to become another account's sign-in email, and has no account of its own (`email_awaited`, from 1.9.9): that account asked for the change within the last hour, so a link would only make an account that can't be used, and nothing is sent. `message` says so and what to do, naming neither account (\"meera@clinic.com is waiting to become another eKard account's sign-in email: that account asked for it within the last hour. If it was you, open the link we emailed to this address in a browser signed in as that account. If not, you can make an account with it once the link stops working, within the hour.\"); show it as written. The web's sign-in page refuses the same address in the same words, as `POST /sessions/password` does (`validation_failed`). Counted like any ask. An app built before 1.9.9 doesn't know the code and shows its own refusal. `did_you_mean` when the address is one slip from a big provider's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "description": "The address can't get mail (`validation_failed`, with `details.email`): it's malformed, its domain has no real ending (\"is missing the end of its domain, like mehtaevents.com\"), or mail to it bounced for good (\"to this address bounced on 20 Oct 2026 (that mailbox doesn't exist), so we didn't send a link. Check it for a typo, sign in another way, or write to eKard's support address if this mailbox works now.\"). Nothing is sent or counted. `did_you_mean` when the address is one slip from a big provider's (`gmail.con`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Past a limit (`rate_limited`): `message` says which and when to try again, in words that never depend on an account (\"That's 5 sign-in links for meera@example.com in the last hour. Try again in 40 minutes, or sign in another way.\"). Wait `Retry-After` seconds, the end of that count's hour. `did_you_mean` when the address is one slip from a big provider's.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/email_link/sign_in": {
      "post": {
        "operationId": "signInWithEmailLink",
        "tags": [
          "App"
        ],
        "summary": "Sign in with an emailed sign-in link",
        "description": "The app opened an emailed sign-in link (`/sign-in-link/open?token=…&bind=…&app=1`). Send its `token` and `bind`, the `device_nonce` this device asked with (if it asked), and `device`. It answers `201` with the device's tokens, as `POST /sessions/password` does, plus `claimed` and `message` (the web's words for what happened). A link works once: using it ends it, and so does any sign-in to the account since it was sent (web or app) or a changed address. A late, used or altered link, or a token made for anything else, is `410 link_gone`. Using it verifies the address, and an address with no account makes one (`created: true`: verified, with no password).\n\nThe web's rules, with the device that asked in place of the browser that asked:\n- **This device asked for this link** (`device_nonce` is the one it asked with, and `bind` is this link's), for a verified account or a new address: signed in at once.\n- **This device asked for this link, for an account nobody has verified** (anyone could have made it with this address and a password): `409 confirm_claim`, and nothing is used. Show `message` (claiming signs out every other device and browser, and removes the account's password and AI key) and `button` (\"Confirm and sign in\"). The press sends the same again with `claim: true`, which claims the account (`claimed: true`; its owner is emailed).\n- **Any other device** (no `device_nonce` or `bind`, or another one's: the link was asked for in a browser or on another device, or passed on): `409 confirm_sign_in`, and nothing is used. `email` is the account the link signs in to; show it, `message` and `button` (\"Sign in\"). The press sends the same again with `confirm: true`. This never claims an account, and leaves one nobody has verified unverified, its password and other sign-ins working.\n\nAn app that's signed in already asks the person before sending a token at all. 30 sign-ins a minute per network, counted with the other sign-ins.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailLinkSignInInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in on this device.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`: the answer carries the tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLinkSignIn"
                }
              }
            }
          },
          "400": {
            "description": "`token` is missing (`missing_parameter`), or `device_nonce` isn't 32 to 128 letters, digits, `-` or `_` (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The person confirms first (`confirm_claim` or `confirm_sign_in`): nothing was used, and the link still works. Show `message` and `email`, and `button`, whose press sends the same again with `claim: true` (`confirm_claim`) or `confirm: true` (`confirm_sign_in`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLinkConfirmation"
                }
              }
            }
          },
          "410": {
            "description": "The link doesn't work any more (`link_gone`): late, used, altered, made for something else, or the account signed in another way or changed its address since. One answer for every reason. `message` says to ask for a new one; `title` is the web page's heading, which `message` begins with.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/sessions/email_link/code": {
      "post": {
        "operationId": "signInWithEmailCode",
        "tags": [
          "App"
        ],
        "summary": "Sign in with the code from a sign-in email",
        "description": "The 8-digit code from a sign-in email, typed on the screen that asked for it (`POST /sessions/email_link` with `with_code: true`, whose `202` carried `ask_id`). It signs this device in as the email's link would have if it had been opened here, so a link read on a computer or another phone can still sign in the phone that asked. Send the `202`'s `ask_id`, the `code` as typed, the `device_nonce` the ask was made with, and `device`. It answers as `POST /sessions/email_link/sign_in` does: `201` with the device's tokens, `created`, `claimed` and `message`.\n\n- **Only on the device that asked.** The ask is found by `ask_id` and `device_nonce` together: another nonce, or none, never finds it (`410 code_expired`), so nobody else can spend this ask's tries.\n- **One code per ask: 8 digits, 15 minutes, 5 wrong tries.** A newer ask from this device (the same `device_nonce`) replaces it (`410 code_replaced` for the older `ask_id`); only the newest email's code works. The code of an earlier email from this device is `422 code_earlier` and costs no try.\n- **The link and the code spend each other.** One email, one sign-in. A code's sign-in ends the email's link (and every sign-in link sent before). The link used anywhere ends the code (`410 code_used`), and so does any sign-in to the account by any door since the email, a claim, a password reset, a changed address, or an account made for a new address another way (`410 code_ended`).\n- **An account nobody has verified** (anyone could have made it with this address and a password): `409 confirm_claim` first, as the link's, and nothing is used: the code still works. Show `message` (claiming signs out every other device and browser, and removes the account's password and AI key) and `button`; the press sends the same again with `claim: true`, which claims it (`claimed: true`; its owner is emailed). Never `confirm_sign_in`: a code is only ever typed on the device that asked. An address with no account gets one (`created: true`: verified, with no password).\n- **The code as typed.** Spaces, dashes and dots are dropped, and any script's decimal digits (Arabic-Indic ٤٨٢١, Devanagari ४८२१, full-width ４８２１) are read as 0 to 9; none of that is a try. Anything that still isn't 8 digits is `422 validation_failed` (`details.code`), never compared.\n\nBefore a right code, no answer says whether an account exists: each depends only on the ask (its time, its tries, whether it was replaced) and on counts that never read accounts. `code_used` and `code_ended` come only after a right code, which proves the mailbox.\n\n**Tries.** A try is one comparison of an 8-digit code, right or wrong. A malformed code, an unknown, expired, replaced or spent ask, and any refusal by a count compare nothing and count nothing. 5 wrong per ask; 10 tries an hour per device (`device_nonce`); per mailbox (the address without its `+tag`, Gmail's without dots) 10 an hour and 20 a day, from anywhere; 20 an hour per network (an IPv4 address, an IPv6 /64); 50 an hour per IPv4 /24 or IPv6 /48; and 100 an hour for the whole site, past which every code pauses until that hour ends (links, passwords, Google and Apple keep working). Each is `429 rate_limited` with `Retry-After`, in words that never depend on an account. The door also counts with the other sign-ins: 30 a minute per network.\n\n**Keep `ask_id`, the code and the nonce secret.** They go to this endpoint and nowhere else: never into logs, analytics, navigation arguments, crash reports or saved screen state. Keep `ask_id` beside the nonce, and forget it after a `201` or 15 minutes after the ask. Send one at a time: while one is in flight, the button is off.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCodeSignInInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Signed in on this device, as the link would have: `created` when the code made the account (verified, with no password), `claimed` when this request claimed one nobody had verified.",
            "headers": {
              "Cache-Control": {
                "description": "`no-store`: the answer carries the tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLinkSignIn"
                }
              }
            }
          },
          "400": {
            "description": "`ask_id`, `code`, `device_nonce` or `device` is missing (`missing_parameter`), or `device_nonce` isn't 32 to 128 letters, digits, `-` or `_` (`invalid_parameter`). Nothing is counted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`confirm_claim` only: the right code, for an account nobody has verified. Nothing was used, and the code still works. Show `message` and `button`; the press sends the same again with `claim: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLinkConfirmation"
                },
                "examples": {
                  "confirm_claim": {
                    "value": {
                      "error": {
                        "code": "confirm_claim",
                        "message": "Signing in confirms this address is yours, and makes the account yours alone. Your other phones and browsers will be signed out. The old password stops working too: sign in there with a link or a code, and set a new password any time with “Forgot password?” on the sign-in page.",
                        "email": "meera@example.com",
                        "new_account": false,
                        "button": "Confirm and sign in"
                      }
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "This ask's code doesn't work any more. `title` is the heading, and `message` begins with it as a sentence (as `link_gone`'s): show the heading, the rest of `message` under it, and \"Email me a new link and code\" as the main button.\n- `code_expired` (\"This code has expired\"): 15 minutes since the email, or `ask_id` unknown or another device's.\n- `code_replaced` (\"There's a newer code\"): this device asked again since, and that ask's `202` didn't reach the app (it sends the newest `ask_id` it holds), so the newer email's code can't be typed here either: `message` says to ask again with \"Email me a new link and code\".\n- `code_tries_used` (\"This code stopped working\"): the 5th wrong code, and every try after it.\n- `code_used`: the right code, but the email's link was already used (\"This email's link was already used\"), or this code already signed in (\"This code already signed in\": a second press, a lost answer).\n- `code_ended` (\"This code doesn't work any more\"): the right code, but the account signed in another way since the email, its sign-ins were ended, its address changed, or an address with no account got one another way.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "code_used": {
                    "value": {
                      "error": {
                        "code": "code_used",
                        "title": "This email's link was already used",
                        "message": "This email's link was already used. It signed in a browser or another device, so its code stopped working too. To sign this phone in, ask for a new email."
                      }
                    }
                  },
                  "code_expired": {
                    "value": {
                      "error": {
                        "code": "code_expired",
                        "title": "This code has expired",
                        "message": "This code has expired. Each code works for 15 minutes. Ask for a new email: it takes a moment."
                      }
                    }
                  }
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "422": {
            "description": "Show `message` under the field.\n- `code_wrong`, with `tries_left` (4 to 1): \"That code doesn't match. Check it against the newest email from eKard: 4 tries left.\" The 5th wrong code is `410 code_tries_used` instead.\n- `code_earlier`: the code of an earlier email this device asked for. No try counted.\n- `validation_failed`: with `details.code`, not 8 digits once spaces, dashes and dots are dropped (\"The code is the 8 digits in the email.\"), never compared and nothing counted; or with `details` for `device`, described wrongly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "code_wrong": {
                    "value": {
                      "error": {
                        "code": "code_wrong",
                        "tries_left": 4,
                        "message": "That code doesn't match. Check it against the newest email from eKard: 4 tries left."
                      }
                    }
                  },
                  "code_earlier": {
                    "value": {
                      "error": {
                        "code": "code_earlier",
                        "message": "That's the code from an earlier email. Only the newest email's code works: it came after this one."
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Past a count (`rate_limited`): `message` says which and when codes work again, in words that never depend on an account (\"That's 10 codes tried for meera@example.com in the last hour. Try again in 40 minutes, or open the link in the email on this phone.\"). Nothing was compared. Wait `Retry-After` seconds, the end of that count's hour (or day). Also 30 sign-ins a minute per network, counted with the other sign-ins.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sessions/refresh": {
      "post": {
        "operationId": "refreshSession",
        "tags": [
          "App"
        ],
        "summary": "Trade the refresh token for a new pair",
        "description": "Send the `device` as at sign-in, so the list of devices shows the app's version now. Both tokens are replaced; keep the new ones, and store them before using them. The refresh token just replaced still works until the new pair is first used (a request with the new access token, or a refresh with the new refresh token), for up to 7 days, and answers the same pair again (its access token good for another hour): an answer that never arrived can be asked for again with the same token, and two refreshes sent at once both get one pair. After that, or any older token, ends the session, because only a copy would be sent again. 60 a minute per network.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSessionRefresh"
                }
              }
            }
          },
          "401": {
            "description": "Unknown, expired, reused or signed out (`refresh_invalid`): sign in again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/sessions/revoke": {
      "post": {
        "operationId": "revokeSessionWithRefreshToken",
        "tags": [
          "App"
        ],
        "summary": "Sign a device out with its refresh token",
        "description": "For a sign-out that had no signal (`DELETE /session` failed): send the refresh token the app kept (the current one, or the one just replaced) and the session ends, with its phone's notifications. No key. Always `204`, whether or not the token was good; anything but those two tokens ends nothing. 30 a minute per network.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Done (or nothing to end)."
          },
          "415": {
            "$ref": "#/components/responses/NotJson"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/session": {
      "delete": {
        "operationId": "signOut",
        "tags": [
          "App"
        ],
        "summary": "Sign this device out",
        "description": "Ends the session the access token belongs to, and its phone's notifications with it. An API key isn't a session (`422 not_a_session`).",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Signed out."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/sessions": {
      "get": {
        "operationId": "listSessions",
        "tags": [
          "App"
        ],
        "summary": "The devices signed in to the app",
        "description": "The person's own, still signed in, most recently used first; `current` marks the one asking. With `include=web`, the browsers signed in to the website too (`platform` `web`), in the same order. The app's own sign-in only: an AI key is `422 not_a_session` (since 1.9.13).",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "`web` adds the browsers signed in to the website. Without it, the list is the app's devices only.",
            "schema": {
              "type": "string",
              "enum": [
                "web"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The devices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSessionList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/sessions/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "delete": {
        "operationId": "revokeSession",
        "tags": [
          "App"
        ],
        "summary": "Sign one device out",
        "description": "Its tokens stop at once, and its notifications with them. A browser's id (from `include=web`) signs that browser out of the website: its cookies, and any copy of them, stop at once. The app's own sign-in only: an AI key is `422 not_a_session` (since 1.9.13).",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Signed out."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/password_resets": {
      "post": {
        "operationId": "requestPasswordReset",
        "tags": [
          "App"
        ],
        "summary": "Email a link to set a new password",
        "description": "\"Forgot password\" on the app's sign-in screen: the web's reset email, whose link opens the web's page for a new password (it works for 4 hours). The answer is the same whether or not the email has an account. 5 an hour per email, and per network counted with the web's.",
        "security": [

        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Sent, if the email has an account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "422": {
            "description": "Mail to the address bounced for good, as Amazon SES reported (`validation_failed`, with `details.email` saying when, why and what to do), so nothing is sent. The same for any address, whether or not it has an account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/email_verification": {
      "post": {
        "operationId": "sendEmailVerification",
        "tags": [
          "Account"
        ],
        "summary": "Email the link that verifies the account's address",
        "description": "Until the address is verified (`account.email_verified` in GET /me), a personal calendar holds the email to clients its owner types in, and the app sends nobody the owner's kard. The link works for 3 days. 3 an hour, counted with the web's.",
        "responses": {
          "200": {
            "description": "Already verified; nothing sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "202": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Mail to the account's address bounced for good, as Amazon SES reported (`email_undeliverable`), so nothing is sent. Show the `message` as written: it says when and why, and what to do: Try it again (`DELETE /me/email_bounce`, or the web's Profile) for a mailbox that works now, else \"To sign in with another address, change your email.\", the same words as `/me`'s `email_bounced.help`: offer the web's Profile (`/profile`, in `web_pages`), where Change email is linked. Servers before 1.9.9 said \"to use another address, write to\" the brand's support address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/email_change": {
      "post": {
        "operationId": "askEmailChange",
        "tags": [
          "Account"
        ],
        "summary": "Ask to change the sign-in email (Profile › Change email)",
        "description": "The web's Profile › Change email (since 1.9.12): the new address is proved by a link and a code sent to it, and the current address is told, with \"This wasn't me\" (docs: the reference's \"Change the sign-in email\"). The app's own sign-in only: an AI key is `422 not_a_session`. **Proof first:** a phone that signed in within the last 15 minutes asks at once; any other sends `password` (counted with every password door: 50 wrong a day, then paused), or `proof: \"code\"` (an account with no password needn't send it): a code goes to the current address, typed at `POST /me/email_change/check`, and nothing goes to the new address before. A proof lasts this phone 15 minutes, so a typo in the new address costs no second password or code. The answer is the same for an address with an account and without: the email decides (the person at the new address reads \"This address has its own account\" instead of a link and code). One open change per account: a new ask replaces it. Limits, counted with the web's: 5 links to new addresses an hour and 10 a day per account, 5 an hour to one mailbox, 5 proof codes an hour, 30 tries a minute from a network (`429 rate_limited`, `Retry-After`, the wait in `message`: \"That's 5 links to new addresses in the last hour. Try again in 42 minutes.\").\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "new_email"
                ],
                "properties": {
                  "new_email": {
                    "type": "string",
                    "format": "email",
                    "examples": [
                      "meera@clinic.com"
                    ]
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "description": "The account's password, when the phone signed in more than 15 minutes ago and `proof` isn't `code`."
                  },
                  "proof": {
                    "type": "string",
                    "enum": [
                      "password",
                      "code"
                    ],
                    "description": "`code`: email a code to the current address to prove it's the owner, instead of the password."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Asked: `email_change.state` is `pending` (the link and code went to the new address: \"We sent a link and a code to meera@clinic.com. Your sign-in email changes when you open the link or type the code.\") or `proving` (a code went to the current address first: \"We sent a code to meera@personal.com. Type it to check it's you; then the link goes to meera@clinic.com. Until then, nothing has changed.\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeAnswer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "The new address's own problem (`validation_failed`, `details.new_email`: \"That's the address you sign in with now.\"), the password missing (`password_required`), wrong (`password_wrong`) or paused (`password_paused`), each with \"or email a code to … instead\"; a current address that bounces, so no code can reach it (`email_undeliverable`); another `proof` (`invalid_parameter`); an AI key (`not_a_session`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "cancelEmailChange",
        "tags": [
          "Account"
        ],
        "summary": "Cancel the change of sign-in email (Profile's \"Cancel the change\")",
        "description": "While a change is open (`proving` or `pending`): its link and code stop working, and nothing changes. The current address isn't told (nothing changed). No open change: `422 no_email_change`. Since 1.9.12.",
        "responses": {
          "200": {
            "description": "Cancelled: \"Cancelled. You still sign in as meera@personal.com, and the link sent to meera@clinic.com doesn't work any more.\" (`email_change` null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeAnswer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "No change open (`no_email_change`), or an AI key (`not_a_session`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/email_change/check": {
      "post": {
        "operationId": "proveEmailChange",
        "tags": [
          "Account"
        ],
        "summary": "Type the code emailed to the current address (the proof)",
        "description": "For a change in `proving`: the 8-digit code emailed to the current address (spaces and dashes are fine). Right: the change is proved, and the link and code go to the new address (`pending`). 5 wrong tries a code, and 10 wrong codes an hour per account, of both kinds. Since 1.9.12.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "examples": [
                      "1234 5678"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proved: \"Thanks, that's you. We sent a link and a code to meera@clinic.com: your sign-in email changes when you open the link or type the code.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeAnswer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "A code that isn't 8 digits (`validation_failed`), a wrong one (`code_wrong`, with `tries_left`: \"That's not the code in the email to meera@personal.com. 4 tries left.\"), its 5 tries used (`code_tries_used`) or ended (`code_expired`); no change open (`no_email_change`), or one past this step (`not_waiting_for_code`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/email_change/confirm": {
      "post": {
        "operationId": "confirmEmailChange",
        "tags": [
          "Account"
        ],
        "summary": "Change the sign-in email with the new address's code, or its link",
        "description": "For a change in `pending`: the 8-digit code from the email to the new address, as typed on the web's Profile, or the `token` of that email's link (`/email-change/confirm/{token}`), for an app that opens the link itself. Either works only for the account that asked, signed in. Then the address changes: this phone stays signed in with its notifications, every other browser and phone is signed out, and the old address is told, with \"This wasn't me\" for 7 days. A link for another account is `409 another_account` and changes nothing; an address another account took meanwhile `409 email_taken`. Since 1.9.12.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "examples": [
                      "1234 5678"
                    ]
                  },
                  "token": {
                    "type": "string",
                    "description": "The token of the new address's link, instead of `code`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changed (`state` `done`, with the account as it signs in now), or done already (\"This change is done already: you sign in as meera@clinic.com.\").",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeConfirmed"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "The link is for another account (`another_account`), or another account took the address meanwhile (`email_taken`): nothing changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A wrong code (`code_wrong`, with `tries_left`), its tries used (`code_tries_used`), not 8 digits (`validation_failed`); the link and code ended, or the change was cancelled or replaced (`email_change_ended`: ask again); a change still waiting for the code to the current address (`proof_needed`); no change open (`no_email_change`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/email_change/resend": {
      "post": {
        "operationId": "resendEmailChange",
        "tags": [
          "Account"
        ],
        "summary": "Send the new address its link and code again (Profile's \"Send it again\")",
        "description": "For a change in `pending`: a new link and code to the new address, for an hour from now; the earlier email's stop working. Counted as an ask. Since 1.9.12.",
        "responses": {
          "202": {
            "description": "\"We sent a new link and code to meera@clinic.com. The ones in the earlier email don't work any more.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeAnswer"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "The link and code ended (`email_change_ended`), or no change open (`no_email_change`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/email_change/kards": {
      "post": {
        "operationId": "showNewEmailOnKards",
        "tags": [
          "Account"
        ],
        "summary": "Show the new address on the Kards that still show the old one",
        "description": "After a change (`done`), Profile's \"Show meera@clinic.com on it\": each kard in `kards_showing_old_email` is saved with the new address, as its own editor would save it; one that won't save is named with why. A kard's email is what visitors write to, so the change never moves it by itself. No change to carry: `422 no_email_change`. Since 1.9.12.",
        "responses": {
          "200": {
            "description": "\"Meera Iyer shows meera@clinic.com now.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeKards"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "No change of email to carry (`no_email_change`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/email_bounce": {
      "delete": {
        "operationId": "retryBouncedEmail",
        "tags": [
          "Account"
        ],
        "summary": "Email the bounced address again (the web Profile's \"Mailbox works now? Try it again\")",
        "description": "For `account.email_bounced` in GET /me: eKard emails the account's address again, sign-in links included, as the web Profile's button does, and `email_bounced` is null. If it bounces again, Amazon SES says so and `email_bounced` comes back with the new bounce. 3 tries a day per account, counted with the web's button: each try can bounce, and bounces count against eKard's sending. Read GET /me again after the answer. New in 1.9.5: a server before it has no such path (`404`); open the web's Profile then (`/profile`, in `web_pages`).",
        "responses": {
          "200": {
            "description": "Mail goes to the address again: \"We'll email meera@example.com again. If it bounces again, your Profile will say so.\" Or it went already (nothing had bounced: tried again from another device, say): \"Mail goes to meera@example.com already: there's nothing to try again.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "description": "The day's 3 tries are used, the web's included (`rate_limited`; `Retry-After` in seconds): \"That's 3 tries today. If mail still doesn't arrive, write to support@example.com.\" Nothing changes. Show it as written.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/staff_invitations/{token}": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "description": "The invitation link's token (/staff_invitations/{token} on the web).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getStaffInvitation",
        "tags": [
          "App"
        ],
        "summary": "A calendar team's invitation",
        "description": "No key needed: the app shows it before anyone signs in. With a key, `matches_signed_in_account` and `refusal` speak for that account. The invited email stays masked. 10 a minute per invitation.",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamInvitationEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/staff_invitations/{token}/accept": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "acceptStaffInvitation",
        "tags": [
          "App"
        ],
        "summary": "Join the calendar's team",
        "description": "The invited person's own step, with the app session of the account that has the invited email (an API key is `422 not_a_session`). It joins the organization as a member (never an admin), and the calendar as that team member's login or the front desk. Accepting again is harmless.",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Joined.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamInvitationAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Signed in with another email (`wrong_account`): sign in with the invited one. Or an account made before the invitation that hasn't verified its address (`email_unverified`): show the `message` as written, and offer to email the link: POST `verify_url` (`POST /me/email_verification`) with the same session, then accept again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "description": "Cancelled, expired, used, the access since removed, or the team member taken by another login (`invitation_closed`); the message says why and whom to ask.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organization_invitations/{token}": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "description": "The invitation link's token (/organization_invitations/{token} on the web).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getOrganizationInvitation",
        "tags": [
          "App"
        ],
        "summary": "An invitation to an organization's team",
        "description": "No key needed: the app shows it before anyone signs in. With a key, `matches_signed_in_account` and `refusal` speak for that account. The invited email stays masked. 10 a minute per invitation.",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationForInviteeEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organization_invitations/{token}/accept": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "acceptOrganizationInvitation",
        "tags": [
          "App"
        ],
        "summary": "Join the organization's team",
        "description": "The invited person's own step, with the app session of the account that has the invited email (an API key is `422 not_a_session`). It joins as the invitation's role; someone already in the organization keeps the stronger role. Accepting again is harmless.",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Joined.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Signed in with another email (`wrong_account`): sign in with the invited one. Or an account made before the invitation that hasn't verified its address (`email_unverified`): show the `message` as written, and offer to email the link: POST `verify_url` (`POST /me/email_verification`) with the same session, then accept again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "description": "Cancelled, expired, used, or the membership it made has ended (`invitation_closed`); the message says why and whom to ask.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/join_links/{token}": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "description": "The join link's token (/teams/join/{token} on the web).",
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "getJoinLink",
        "tags": [
          "App"
        ],
        "summary": "A team's join link",
        "description": "No key needed: the app shows it before anyone signs in. With a key, `join_request` and `refusal` speak for that account. 30 a minute per link per network. A link turned off or replaced is a 404.",
        "security": [

        ],
        "responses": {
          "200": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JoinLinkForAskerEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/join_links/{token}/join_requests": {
      "parameters": [
        {
          "name": "token",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "askToJoinTeam",
        "tags": [
          "App"
        ],
        "summary": "Ask to join a team through its join link",
        "description": "The person's own step, with their app session (an API key is `422 not_a_session`); the account's address must be verified (`403 email_unverified`, with `verify_url`, which emails the link). One request per person per team, whatever became of it: per account, and per address (a decline outlives a deleted account; a `+tag` or Gmail's dots make no new address). The team's admins are emailed and notified, and approve or decline it; the person hears either way. An account has at most 5 requests waiting at once (`422 too_many_waiting`) and makes 10 a day, the web's and the app's together (`429 rate_limited`, with `Retry-After` in seconds: when the first of them is a day old; GET's `refusal` says `daily_limit` meanwhile).",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "join_request"
                ],
                "properties": {
                  "join_request": {
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 100,
                        "description": "The name on the team Kard they get once approved (GET's `suggested_name` is the account's). A person's name, as it leads the admins' email subject and notification: letters in any script, spaces and `. , ' - ( )`, no digits, and no web or email address (`billing.example.com`); `422 validation_failed` says which."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Asked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JoinRequestMade"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The account's address isn't verified (`email_unverified`): POST its `verify_url` (`POST /me/email_verification`) with the same session to email the link, then ask again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "description": "The link is past its 14 days (`expired`) or took its 50 requests (`used_up`): ask whoever shared it for the team's new link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The name didn't pass (`validation_failed`, with `details`), or this account can't ask: `on_the_team`, `waiting` (asked already), `declined`, `membership_ended` (approved before, since gone), `invited` (an invitation to its address is waiting: accept that), `too_many_waiting`, or `not_a_session`. The message says what to do.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/web_sessions": {
      "post": {
        "operationId": "createWebSession",
        "tags": [
          "App"
        ],
        "summary": "A one-time signed-in link to a web page",
        "description": "For pages only the web has (Calendar setup and settings, the team, the design and QR studios, a Kard's printable card, video-call background and lock-screen wallpaper, organizations, their team import and their printable cards): open `url` in a Custom Tab. `return_to` must be one of the pages `GET /app/config` lists in `web_pages`. It opens `return_to` signed in as this account, once, within 2 minutes, at its fragment if it ends with one (`/organizations/glowstudio/edit#logo` lands at the logo, as the web's own link does). That browser stays signed in for its session only (no remember-me cookie), and only while this app session does: signing the app out signs it out too. A browser not already signed in as this account confirms first (\"Continue as …\"): the link alone never signs anyone in. The app's sign-in only (an API key is `422 not_a_session`); 30 a minute.",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSessionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSession"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "An API key (`not_a_session`), `return_to` isn't a path on this site or its fragment isn't a place on the page (`invalid_parameter`), or it is a page the app doesn't open this way (`page_not_allowed`: open it as it is, and the web asks to sign in).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/public_kards/lookup": {
      "get": {
        "operationId": "lookupPublicKard",
        "tags": [
          "Kards"
        ],
        "summary": "The Kard a link opens",
        "description": "For a scanned or tapped link: the brand's share links in every shape (a person's, an organization's, a team member's, their booking and other public pages), custom domains, and a share link or organization slug a Kard has moved from. What its public page shows, and what the person asking can do with it. Public data only: an inactive kard shows its name and photo. No visit is recorded. 60 a minute per account.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The link, as scanned or tapped (without https:// works too).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The kard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicKardLookup"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The link doesn't open a kard (`not_an_ekard`): open it in a browser instead.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "451": {
            "description": "The kard is hidden after a complaint, while it's looked into (`unavailable`): its public page says the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/address_suggestions": {
      "get": {
        "operationId": "suggestAddresses",
        "tags": [
          "Kards"
        ],
        "summary": "Google Maps' street addresses for what's typed in a kard's address",
        "description": "For a kard's Address line 1, as the web's editor does (no Places SDK and no key in the app): up to five street addresses Google Maps suggests for the words typed so far, in Google's order, then `POST /address_suggestions/pick` for the one the person taps. Street addresses only: never a business. Ask after 3 characters and a 300 ms pause, at most one request in flight (cancel the last), with one `session` (a new UUID v4) per address typed: from the first request to the pick, never reused after a pick (Google bills a session ended by a pick as one, past its first 12 requests).\n\n**What Google gets:** the words, the country, the language (the request's `Accept-Language`, else the account's) and the session; never the person's name, email, account or IP. Nothing Google answers is kept: answers are `Cache-Control: no-store`. Show the list with the Google Maps logo at its foot (16 to 19 dp, labelled \"Google Maps\", from Google's attribution assets) and \"Not listed? Keep typing it yourself.\".\n\n**Off or paused:** `off` is `not_set_up` (the server has no Google Maps key) or `paused`, with `notice` to show once (a person's 100 requests or 10 picks a day, a session's 15 requests, the day's or the month's allowance for Google Maps, an account without a plan past the month's free calls, Google not answering: `reason` says which). Then stop asking until the screen opens again, and keep the plain field: a typed address saves the same. Counted per person with the web's; 60 requests a minute per network (`429 rate_limited`, `Retry-After`).",
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "What's typed in line 1 so far, 3 to 200 characters (else `422 invalid_parameter`).",
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 200
            },
            "examples": {
              "typed": {
                "value": "12 Laxmi"
              }
            }
          },
          {
            "name": "session",
            "in": "query",
            "required": true,
            "description": "This address's session: a UUID (v4), made by the app when line 1 gains focus on a fresh screen or after a pick (else `422 invalid_parameter`).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "The country chosen in the form (ISO 3166-1 alpha-2): suggestions stay within it. Without one, they lean to the account's country.",
            "schema": {
              "type": "string",
              "examples": [
                "IN"
              ]
            }
          },
          {
            "name": "kard",
            "in": "query",
            "required": false,
            "description": "The share link of the kard being edited (`organization` disambiguates). Its team's plan counts for a team kard, as on the web; a kard the account can't manage is `403`, one it can't see `404`. Leave it out on a new kard.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization",
            "in": "query",
            "required": false,
            "description": "The team's slug: of `kard`, or of a new kard made in a team the account admins (else `403`), whose plan then counts.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The suggestions, or why there are none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressSuggestions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`input` under 3 or over 200 characters, or a `session` that isn't a UUID (`invalid_parameter`; `details` names it).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/address_suggestions/pick": {
      "post": {
        "operationId": "pickAddressSuggestion",
        "tags": [
          "Kards"
        ],
        "summary": "The address a person picked, in its parts",
        "description": "The suggestion tapped, in the kard's address parts, in the country's own order (Google's postal address): fill line 1, town or city, region, postal code and country with them (emptying a part Google has none for), line 2 only if it's empty (a floor or a landmark the person typed stays), and send `address_place_id` with the kard's save, so Directions open the exact place. Then say \"Filled from Google Maps. Check each part, and add a shop, unit or floor number if there is one.\", or, with `missing_number`, \"Google Maps knows the street but not the number: add yours to line 1.\". The person may change any part before saving: the server clears `address_place_id` by its rule (`KardInput`). Ends the session: make a new one for the next address. Street addresses only: a business's or a landmark's place is `422 not_a_street_address`, and nothing of its address comes back (Google's terms don't allow copying it). Paused and off as `GET /address_suggestions`; counted together with it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressPickInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address, or why there is none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressPick"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Google Maps no longer finds the place (`place_not_found`): keep what's typed, or ask for suggestions again. Or no such kard or team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A `place_id` that isn't a Google place ID, or a `session` that isn't a UUID (`invalid_parameter`; `details` names it). Or `not_a_street_address`: Google Maps lists the place as a business or a landmark (or as no street address at all), and Google's terms don't allow copying its address, so nothing comes back: say so (\"Google Maps lists that place as a business or a landmark, not a street address, so nothing was filled: Google's terms don't allow copying its address. Pick a street address, or type your address yourself: it saves the same.\") and keep what's typed. Counted as a pick.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/exchanges": {
      "post": {
        "operationId": "shareKardBack",
        "tags": [
          "Contacts"
        ],
        "summary": "Share my kard back with another kard",
        "description": "The web's exchange sheet: my kard (`from_kard`, one of the account's own; `from_organization` when two share the link) lands in the other kard's contacts as a share-back with an optional note, its owner is emailed when it's new, and the account keeps theirs as a bookmark (`bookmark`, default true). Sharing the same kard there again updates it and tells nobody (`200`). A kard the account manages is `422 own_kard`. 30 an hour.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExchangeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Shared before; brought up to date.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExchangeResult"
                }
              }
            }
          },
          "201": {
            "description": "Shared.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExchangeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "`from_kard` isn't one of the account's (`not_found`), or the link doesn't open a kard (`not_an_ekard`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The other kard is the account's own (`own_kard`), switched off for a while (`switched_off`, since 1.9.14: nothing sent, no bookmark), or the note is too long (`validation_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "451": {
            "description": "The kard is hidden after a complaint, while it's looked into (`unavailable`): its public page says the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact_cards/parse": {
      "post": {
        "operationId": "parseContactCard",
        "tags": [
          "Contacts"
        ],
        "summary": "Read a paper business card's text into contact fields",
        "description": "For the card's text as a phone read it (never its photo). Claude reads it into fields for the person to check before saving the contact (POST /kards/{share_link}/contacts with `source: scan`). Nothing of the text or of what was read is kept. A plan with a price, the person's or one of their organizations': else `403 ai_needs_priced_plan`, before anything is counted. 60 an hour and 500 a day per account, and none once the account's card reading today (the web's Scan cards too) has cost a third of the server's day of AI reading: `429 rate_limited`, its message saying when it reads again. When it can't be read just now (Claude out of reach, or the account's two cards already being read, or four of everyone's, the web's Scan cards and New Kard's paper card with them): `503 parse_unavailable`, its message saying which. Either way, keep your own reading.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCardParseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The fields read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCardParse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AiNeedsPricedPlan"
          },
          "422": {
            "description": "More than 4,000 characters (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "The card couldn't be read just now (`parse_unavailable`): Claude out of reach, or too many cards being read at once (the account's two, everyone's four). Show the message as written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/grievance": {
      "get": {
        "operationId": "getComplaintForm",
        "tags": [
          "Reports"
        ],
        "summary": "What a complaint form needs",
        "description": "For an app's \"Report this Kard\": the Grievance Officer (`appointed` false while none is named: complaints then reach the team that runs eKard, on the same clocks), the categories in the web form's words with their clocks, the evidence limits, the account's name and email to fill in, and the words the person confirms (`declaration`). `form_url` is the web's form with `url` filled in, for an app that opens it instead.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "The link being reported (a kard's `public_url`), filled into `form_url`.",
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The form.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplaintForm"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "fileComplaint",
        "tags": [
          "Reports"
        ],
        "summary": "Report a kard, booking page or file",
        "description": "Files a complaint as the web's form does: a reference (`GR-…`) and an acknowledgement email to the reporter at once, the Grievance Officer alerted, and the category's clock running (2 hours for impersonation and intimate images, 3 for a court or government order, 36 for other unlawful content, 7 days for anything else). `reporter_name` and `reporter_email` are the account's unless sent. `declaration: true` says what's written is true (the form's tick box). Evidence (optional, up to 3 photos, screenshots or PDFs of 10 MB each, seen only by the officer) goes as files in `grievance[evidence][]` of a multipart/form-data request; anything else there is `422 invalid_parameter`. `case_url` is the reporter's own page on the case (no sign-in): where it stands, our replies and decision, and how to appeal. Send an `idempotency_key`, a random one (a UUID): a report this account sends again with the same key (its answer lost) answers `200` with the first case, nothing filed or emailed twice. Keys are per account, never per `reporter_email`. 5 cases filed an hour per account, and 5 an hour per network counted together with the web's form (`429 rate_limited`); a send refused for something to fix doesn't count.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplaintInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ComplaintMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Filed already with this idempotency_key; the first case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplaintFiled"
                }
              }
            }
          },
          "201": {
            "description": "Filed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplaintFiled"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Something to fix (`validation_failed`, each message a sentence to show, `details` per field: `reported_url`, `category`, `details`, `order_reference`, `reporter_name`, `reporter_email`, `idempotency_key`, `evidence`, `declaration`), or evidence that isn't files sent with the request (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/app/config": {
      "get": {
        "operationId": "getAppConfig",
        "tags": [
          "App"
        ],
        "summary": "The app's versions and features",
        "description": "Asked before anyone signs in, by each platform's app for itself (`platform`). Under `min_supported_version_code` the app shows a blocking update screen (the kill switch for a broken release); under `latest_version_code`, an offer to update. `privacy_policy_url` and `terms_url` are the brand's own pages. `features` says what this server offers that platform's app; `route_words`, the first path segments no kard's link can have. Cached an hour.",
        "security": [

        ],
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "description": "`android`, or `ios` for the iPhone app. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "android",
                "ios"
              ],
              "default": "android"
            }
          },
          {
            "name": "version_code",
            "in": "query",
            "description": "The app's own build number, for `update_required` and `update_available`: Android's version code, or the iPhone app's build number (`CFBundleVersion`, a whole number).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The config.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConfig"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/me/deletion_request": {
      "post": {
        "operationId": "requestAccountDeletion",
        "tags": [
          "Account"
        ],
        "summary": "Ask to delete the account",
        "description": "Emails the account's address a link to confirm (it works for 3 days, once). Once confirmed, the account and everything in it is deleted within 30 days, and the person is emailed when it's done. Asking again sends the link again; a confirmed request answers `200` with its date. The same as https://ekard.app/account/delete on the web. An account that signs in with Apple can confirm with Apple instead (`POST /me/deletion_request/apple`); when Apple has stopped forwarding mail to its private relay address (`account.email_reachable` false in `GET /me`), no link goes: `422 confirm_with_apple`. 3 an hour, counted with the web page's.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmed already; when it's deleted by.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequested"
                }
              }
            }
          },
          "202": {
            "description": "The confirmation link is on its way.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequested"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Apple isn't forwarding mail to the account's private relay address, so a link couldn't arrive and none was sent (`confirm_with_apple`): confirm with `POST /me/deletion_request/apple`, or the person turns forwarding back on and asks again. `message` says so.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/me/deletion_request/apple": {
      "post": {
        "operationId": "confirmAccountDeletionWithApple",
        "tags": [
          "Account"
        ],
        "summary": "Ask to delete the account, confirmed with Sign in with Apple",
        "description": "For an account that signs in with Apple (`account.apple_linked` in `GET /me`), from eKard's iPhone app: the deletion is confirmed by a fresh Sign in with Apple instead of the emailed link, which a Hide My Email address may never get. Get a nonce from `GET /sessions/nonce`, run an Apple request whose nonce is its SHA-256 (lower-case hex), and send what it returned. The identity token must be Apple's, for this app, carry the nonce (used once), be no older than the nonce's 5 minutes, and be for the Apple Account that signs in to this account. Then the request waiting for its link, or a new one, is confirmed: the account and everything in it is deleted within 30 days, as after the link. The authorization code ends the account's link with Apple right away (eKard leaves the Apple Account's list of apps using Sign in with Apple), so `apple_linked` turns false once it has ended. This request signs no device out, but once the link ends Apple reports the app's credential revoked on the iPhone. Confirmed already: `200` with its date, and the link with Apple still ends. Token refusals are `422`, never `401`, so they can't read as the session's own token refused. 10 tries an hour.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeletionAppleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmed (or confirmed already): when it's deleted by. `message` says so, and that the link with Apple is ending.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionRequested"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The account doesn't sign in with Apple (`apple_not_linked`), or the token is for another Apple Account (`apple_account_mismatch`). `message` says how else to confirm.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The nonce isn't ours, has expired, was used, or isn't the token's (`invalid_nonce`); Apple issued the token too long ago (`stale_id_token`); or Apple didn't confirm the token (`invalid_id_token`: a bad signature, another app's audience, expired). Run a new Apple request with a new nonce.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Sign in with Apple isn't set up on this server (`apple_sign_in_unavailable`: confirm from the email), or Apple's keys couldn't be fetched to check the token (`apple_unavailable`: try again in a minute).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/subscription": {
      "get": {
        "operationId": "getSubscription",
        "tags": [
          "Account"
        ],
        "summary": "The current plan",
        "description": "`subscription` is null on the free tier. Buying a plan happens on the web (Razorpay checkout): send the owner to `upgrade_url`.",
        "responses": {
          "200": {
            "description": "The plan.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "subscription",
                    "upgrade_url"
                  ],
                  "properties": {
                    "subscription": {
                      "$ref": "#/components/schemas/Subscription"
                    },
                    "upgrade_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "operationId": "cancelSubscription",
        "tags": [
          "Account"
        ],
        "summary": "Cancel the plan at the end of the billing period",
        "description": "The same as the web's Cancel button: stops the next renewal; the plan stays active until `current_period_end`. A plan that doesn't renew (paid once, or cancelled already) is `422 not_renewing`. Razorpay trouble is a `502`: `razorpay_refused` (nothing changed), or `razorpay_unavailable` (Razorpay didn't answer: the cancellation is finished in the background, and `renews` turns false once Razorpay confirms). Confirm with the owner before calling this.",
        "responses": {
          "200": {
            "description": "Cancelled; it stays active until the period ends.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cancelled",
                    "subscription"
                  ],
                  "properties": {
                    "cancelled": {
                      "const": true
                    },
                    "subscription": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "502": {
            "description": "Razorpay refused the cancellation (`razorpay_refused`), or didn't answer (`razorpay_unavailable`: finished in the background).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics": {
      "get": {
        "operationId": "getAccountAnalytics",
        "tags": [
          "Analytics"
        ],
        "summary": "Visits and contacts for every kard the account holds or administers",
        "description": "Use this for \"how are my kards doing?\". Every kard the account holds and every kard of the organizations it administers, the organization's own kard included. Every plan gets the last 7 and 30 days; lifetime visits come with a plan (history).",
        "parameters": [
          {
            "name": "organization",
            "in": "query",
            "description": "An organization's slug: every team kard for its admins, the account's own kards there for anyone else.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One row per kard, plus totals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAnalytics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OwnerLanguage"
        }
      ],
      "get": {
        "operationId": "listKards",
        "tags": [
          "Kards"
        ],
        "summary": "Every kard the account owns, newest first",
        "description": "Personal and organization-owned kards.",
        "responses": {
          "200": {
            "description": "The kards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createKard",
        "tags": [
          "Kards"
        ],
        "summary": "Create a kard",
        "description": "Only `name` is required. Since 1.9.14 a kard's name, as a person's, can't hold a web address, an email address or a phone number (`422 validation_failed`, `details.name`, its `message` saying what to take out and where it goes: \"Name can't hold a web address: it goes into emails we send. Take out “priya.shop” and add it under Links instead\"); the same on `PATCH /kards/{share_link}` for a new name. The `share_link` is generated; read it from the response. To attach a photo, send the whole request as multipart/form-data with fields named `kard[name]`, `kard[photo]` and so on. Send an `idempotency_key` when a request may be sent again (a retry after a lost answer, a second tap on Create): the same key within 24 hours answers `200` with the kard the first request made, never a second kard, even when both arrive at once. Limit: 100 new kards an hour per account, counted with the web's (`429 rate_limited`, with `Retry-After`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kard"
                ],
                "properties": {
                  "kard": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/KardInput"
                      },
                      {
                        "required": [
                          "name"
                        ],
                        "properties": {
                          "idempotency_key": {
                            "type": "string",
                            "maxLength": 100,
                            "description": "Your key for this kard, unique to it (a UUID made when the person starts the form). Sent again within 24 hours, by this account, it answers `200` with the kard the first request made, as it is now (renamed or not), and nothing else is saved; the other fields are not compared. After 24 hours the key makes a new kard, and so does the key of a kard deleted since, or handed to someone else. Keys are per account. Over 100 characters: `422 invalid_parameter`."
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/KardMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Made already, by a request with this `idempotency_key` in the last 24 hours: that kard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/PhotoNotStored"
          }
        }
      }
    },
    "/kards/{share_link}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getKard",
        "tags": [
          "Kards"
        ],
        "summary": "One kard in full",
        "parameters": [
          {
            "$ref": "#/components/parameters/OwnerLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "The kard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateKard",
        "tags": [
          "Kards"
        ],
        "summary": "Update a kard",
        "parameters": [
          {
            "$ref": "#/components/parameters/OwnerLanguage"
          }
        ],
        "description": "Partial: omitted fields keep their value. Custom links use nested semantics: no `id` adds a link, an `id` edits it, `\"_destroy\": true` removes it. `contact_form` is the whole list of the kard's own questions: sent, it replaces them.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kard"
                ],
                "properties": {
                  "kard": {
                    "$ref": "#/components/schemas/KardInput"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/KardMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated kard.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "502": {
            "$ref": "#/components/responses/PhotoNotStored"
          }
        }
      },
      "delete": {
        "operationId": "deleteKard",
        "tags": [
          "Kards"
        ],
        "summary": "Delete a kard and everything under it",
        "description": "Irreversible: confirm with the owner first. Organization kards can be deleted only by the organization's admins, and an organization's default kard not at all. Its contacts stay (since 1.9.5): kept for the account, a team kard's for its team's admins, `GET /contacts` lists them with `kard` null; the web's Contacts lists them \"From a deleted Kard\".",
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted",
                    "share_link"
                  ],
                  "properties": {
                    "deleted": {
                      "const": true
                    },
                    "share_link": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/analytics": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getKardAnalytics",
        "tags": [
          "Analytics"
        ],
        "summary": "One kard's performance",
        "description": "With a plan (history true), the range's visits by day, devices, places, sources and link clicks. Without one, the last 7 or 30 days' visits and contacts only. On every plan, the range's taps on the kard's buttons (taps): Call, WhatsApp, Directions, a way to pay, a profile...",
        "parameters": [
          {
            "name": "time_range",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "7_days",
                "30_days",
                "lifetime"
              ],
              "default": "7_days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Visits, devices, sources, contacts, link clicks and taps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardAnalytics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "operationId": "listAccountContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "The contacts of the kards you hold (a team's with `organization`), newest first",
        "description": "With the contacts your deleted kards left you (since 1.9.5): a deleted kard's contacts are kept for its account, a team kard's for its team, with `kard`, `kard_name` and `kard_organization` null (show \"From a deleted Kard\"; open, note, remind and delete one at `/contacts/{id}`). With `organization`, its admins get the team's deleted kards' too. `kard` leaves them out; `query` and the other filters read them as any contact.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "name": "kard",
            "in": "query",
            "description": "One kard's contacts, by share_link (add `organization` if two of your organizations use it).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization",
            "in": "query",
            "description": "An organization's slug: every team kard's contacts for its admins, the account's own kards there for anyone else. Without it, the contacts of the kards the account holds: an organization's own kard, which nobody holds, is listed only with it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_id",
            "in": "query",
            "description": "Met at this event: tagged with it, or met there and since come back at a later event (since 1.9.13), as the event's `contacts_count` counts them. A returner is listed on each event they came to.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "How they arrived, one or more comma-separated: exchange, share_back, booking, manual, api, suggestion, scan, agent.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "app": {
                "value": "scan,manual"
              }
            }
          },
          {
            "$ref": "#/components/parameters/ContactFoundVia"
          },
          {
            "$ref": "#/components/parameters/ContactReached"
          },
          {
            "name": "follow_up",
            "in": "query",
            "description": "`due`: a follow-up reminder on the account's today or before (its zone: the person's calendar's, else the one their browser reported, else UTC), the people the morning email lists. `set`: any reminder.",
            "schema": {
              "type": "string",
              "enum": [
                "due",
                "set"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/contacts/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "get": {
        "operationId": "getKeptContact",
        "tags": [
          "Contacts"
        ],
        "summary": "One contact from a deleted kard",
        "description": "A contact `GET /contacts` lists with `kard` null: one a deleted kard left its account, or its team (since 1.9.5). For the account it's kept for, and a team's for the team's admins (and site admins), as the web's Contacts › From a deleted Kard; anyone else gets `404`, the team's members and the kard's last holder included. A contact still on a kard is `404` here too: it's `/kards/{share_link}/contacts/{id}`, so pick the path by `kard`. New in 1.9.5: a server before it has no such path (`404`).",
        "responses": {
          "200": {
            "description": "The contact, `kard`, `kard_name` and `kard_organization` null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateKeptContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Your note on a contact from a deleted kard, and its reminder",
        "description": "Only `note` and `follow_up_on` change, by the rules they have on a kard's contact, and each is checked alone: what the person sent stays as they sent it, with no kard to correct it on. Anything else in `contact` (`name`, `email`, `event_id`, ...) is `422 invalid_parameter` naming it, and nothing changes. The reminder is the sender's (`follow_up_by`): the morning email and push list the person as they list a kard's contacts, \"From a deleted Kard\" where the kard's name goes, for the sender while they may still open the contact; once they can't (no longer the team's admin), for the account it's kept for, or the team's admins. Who may: as `GET`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contact"
                ],
                "properties": {
                  "contact": {
                    "$ref": "#/components/schemas/KeptContactInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The contact, as saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "A note over 1000 characters, or a day in the past or more than 2 years ahead (`validation_failed`, with `details.note` or `details.follow_up_on`); a `follow_up_on` that isn't a date, or a field other than these two (`invalid_parameter`: \"A contact from a deleted Kard keeps what they sent: only note and follow_up_on change, not name.\"). Nothing is saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteKeptContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact from a deleted kard, for good",
        "description": "As the web's Delete beside them on Contacts › From a deleted Kard: permanent, nothing of theirs is kept (save them to the phone first if the person needs a record). Who may: as `GET`.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/contacts/{id}/reaches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "operationId": "recordKeptContactReach",
        "tags": [
          "Contacts"
        ],
        "summary": "Record a tap on Call, Text, WhatsApp or Email on a contact from a deleted kard",
        "description": "\"Reached out\" for a contact a deleted kard left (`kard` null, since 1.9.13), as `POST /kards/{share_link}/contacts/{id}/reaches` is for a kard's: send it as the app opens the dialler, Messages, WhatsApp or the mail app for them, so their `last_reach` and `GET /contacts?reached=no` count it. The same body, rules and answers: kept for the account it's kept for and, for a team's, its admins; a site admin's tap outside them is answered with `reach: null` and not kept. Who may: as `GET /contacts/{id}` (anyone else, and a contact still on a kard, `404`). The web's From a deleted Kard page doesn't record its own taps yet: an app's are the only ones there. A server before 1.9.13 has no such path (`404`): send nothing for these, as before.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactReachInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already kept (the same way by the same person within 10 minutes), or a site admin's tap (`reach` null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactReachResult"
                }
              }
            }
          },
          "201": {
            "description": "Kept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactReachResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`way` isn't one of whatsapp, text, call, email, or `at` isn't a time (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/contacts": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listKardContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "One kard's contacts",
        "description": "JSON whatever the `Accept` header says (curl's `*/*` included), unless it asks for `text/csv`: then every matching contact as a CSV file, as `/contacts.csv` gives it (`text/vcard`: the contact file `/contacts.vcf` gives).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/ContactSort"
          },
          {
            "$ref": "#/components/parameters/Direction"
          },
          {
            "$ref": "#/components/parameters/KardContactEvent"
          },
          {
            "$ref": "#/components/parameters/KardContactFollowUp"
          },
          {
            "$ref": "#/components/parameters/KardContactQuestion"
          },
          {
            "$ref": "#/components/parameters/KardContactAnswer"
          },
          {
            "$ref": "#/components/parameters/KardContactProduct"
          },
          {
            "$ref": "#/components/parameters/ContactFoundVia"
          },
          {
            "$ref": "#/components/parameters/ContactReached"
          },
          {
            "$ref": "#/components/parameters/ContactIds"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of contacts; with `Accept: text/csv`, every matching contact as CSV.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "createContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Add a lead by hand",
        "description": "For a contact collected elsewhere; visitors use the kard's own connect form. The app saves the people its user typed in or scanned with `source` and an `idempotency_key`. Since 1.9.11, at most 500 new contacts an hour per account, counted with the web's Add a person (429 with Retry-After); a repeat with its `idempotency_key` isn't counted.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already saved with this idempotency_key; the first contact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCreated"
                }
              }
            }
          },
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactCreated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/kards/{share_link}/contacts.csv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "exportKardContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "One kard's contacts as a CSV file",
        "description": "Since 1.9.11 the file starts with a UTF-8 byte-order mark (EF BB BF), so Excel reads it as UTF-8, and a column no exported row fills is left out, except Name, Email, Phone, How they came and Date: read the columns by their headers, never by position.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/ContactSort"
          },
          {
            "$ref": "#/components/parameters/Direction"
          },
          {
            "$ref": "#/components/parameters/KardContactEvent"
          },
          {
            "$ref": "#/components/parameters/KardContactFollowUp"
          },
          {
            "$ref": "#/components/parameters/KardContactQuestion"
          },
          {
            "$ref": "#/components/parameters/KardContactAnswer"
          },
          {
            "$ref": "#/components/parameters/KardContactProduct"
          },
          {
            "$ref": "#/components/parameters/ContactReached"
          },
          {
            "$ref": "#/components/parameters/ContactIds"
          }
        ],
        "responses": {
          "200": {
            "description": "Every matching contact.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/contacts.vcf": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "exportKardContactsVcf",
        "tags": [
          "Contacts"
        ],
        "summary": "One kard's contacts as one contact file (Save to my phone)",
        "description": "The web's \"Save to my phone\": every matching contact in one vCard 3.0 file, which an iPhone (\"Add All 12 Contacts\") and Google Contacts import in one step. Each card is the one the contact's own file has: the name, job title and company, every email and phone, the address, then a note with their message, their card's notes, your note, where you met them when they're tagged with an event (\"Met at PackEx India 2026 (22–24 Oct).\") and \"Received on eKard on 17 October 2026.\" (the day in the Kard holder's time zone), and a shared kard's link. The same people the CSV has, the newest first whatever `sort` says, as the web's file. Who may export them: as the CSV. Importing the same people twice makes copies, so say what the web says beside it: \"Saving the same people twice makes copies. To save only some, search or open an event first: the file holds the list on screen.\"",
        "parameters": [
          {
            "$ref": "#/components/parameters/Query"
          },
          {
            "$ref": "#/components/parameters/ContactSort"
          },
          {
            "$ref": "#/components/parameters/Direction"
          },
          {
            "$ref": "#/components/parameters/KardContactEvent"
          },
          {
            "$ref": "#/components/parameters/KardContactFollowUp"
          },
          {
            "$ref": "#/components/parameters/KardContactQuestion"
          },
          {
            "$ref": "#/components/parameters/KardContactAnswer"
          },
          {
            "$ref": "#/components/parameters/KardContactProduct"
          },
          {
            "$ref": "#/components/parameters/ContactReached"
          },
          {
            "$ref": "#/components/parameters/ContactIds"
          }
        ],
        "responses": {
          "200": {
            "description": "Every matching contact, one card after another (`Content-Disposition: attachment`, named like `Priya Sharma-Expo 2026-contacts-20261019.vcf`).",
            "content": {
              "text/vcard": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "text/vcard"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "Nobody to save (`no_contacts`): a phone opens no empty file. The `message` is the web's: \"No contacts yet, so nothing to save to your phone.\", or, with a search, an event or `follow_up` that matches nobody, \"Nobody in this list to save. Show everyone, then Save to my phone.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/contacts/bulk": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "bulkContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "Several contacts at once (put in an event, one reminder, Done, delete), as the web's contacts list does",
        "description": "The web's bulk actions on a kard's contacts (ticked rows, or \"Select all\"): `event` puts them in one of the kard's events, or takes them off theirs; `follow_up` gives them all one reminder (the morning email and push go to you), or clears theirs; `done` marks their follow-ups done (To follow up's Done: their reminders cleared, in Done's words); `delete` deletes them. Pick them by `ids`, or with `all: true` every contact the list holds on every page, as `query`, `event_id`, `follow_up`, `question` with `answer`, `found_via` and `product` narrow it (the same filters as `GET /kards/{share_link}/contacts`; ticked `ids` are narrowed by them too). Only this kard's contacts are ever found, whatever ids come. Who may: whoever may open the kard's contacts, as for one contact: its holder, and a team kard's organization admins. A team member may act on the contacts of the team kards they hold, not on another member's (`403`, or `404` without `organization`).\n\nAsk first with `dry_run: true`: nothing changes, and the answer says who's picked (`who`), where they stand now (`now`), and what the choice would change, in the web's words (`message`, with `changed` and `unchanged`). Then send the same with `count`, the number you showed. If the list changed in between (someone arrived, a contact was deleted on another device), nothing changes: `409 count_changed`, with the new `count` in the error; show it and confirm again. `event`, `follow_up` and `done` change only those who don't have it already, and the person who made the change can undo it for an hour (`undo.token`, `POST /kards/{share_link}/contacts/bulk/undo`). `delete` is permanent, with no undo: offer the same people's CSV or contact file first (`GET /kards/{share_link}/contacts.csv` or `.vcf` with the same `ids[]`, or the same filters).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactBulkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Done, or with `dry_run` what it would do; `message` says it in the web's words.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkResult"
                }
              }
            }
          },
          "400": {
            "description": "No `verb`; neither `ids` nor `all`; no `count` (without `dry_run`); for `event` neither `move_to_event_id` nor `clear_event`, for `follow_up` neither `follow_up_on` nor `clear_follow_up` (`missing_parameter`). A `verb` this list doesn't have, more than 1000 `ids`, or a filter, an id or a date that can't be read (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The list changed since you counted it (`count_changed`): `count` in the error is how many it picks now (0 when everyone picked was deleted since). Nothing changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkCountChanged"
                }
              }
            }
          },
          "422": {
            "description": "Nobody picked (`nothing_selected`); `move_to_event_id` isn't one of the kard's events, or is archived (`invalid_parameter`, in the web's words: \"Auto Expo is archived, so it takes no one new. Pick another event, or No event.\"); a reminder day in the past or more than 2 years ahead (`validation_failed`, `details.follow_up_on`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/contacts/bulk/undo": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "undoBulkContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "Undo a bulk event or reminder change, within its hour",
        "description": "Puts back what `POST /kards/{share_link}/contacts/bulk` changed, once, within an hour, for the person who made the change (the web's Undo under the list). Only the contacts still as the change left them go back: one changed since keeps its newer event or reminder (`kept`), and so does one deleted since. A deleted event or a removed person's reminder can't come back: those contacts are left without one.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "`undo.token` from the change."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Undone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkUndone"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "Nothing to undo (`nothing_to_undo`): it was undone already, its hour has passed, or it isn't this account's change on this kard. The web's words: \"Nothing to undo: it was undone already, or the hour to undo it has passed.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/contacts/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getContact",
        "tags": [
          "Contacts"
        ],
        "summary": "One contact",
        "responses": {
          "200": {
            "description": "The contact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Only the fields sent change. In `card_details`, only the keys sent change (`\"\"` clears one), so `{\"card_details\": {\"company\": \"Mehta Exports\"}}` keeps the job title and the rest. `clear_event: true` (or `event_id: null`) takes the contact off its event.\n\n**Their email or number put right** (the sheet's Fix for `email_typo`, its Edit; since 1.9.13 as the web's): it's the owner's record, and nothing is sent to the person. A return's not-checked email or number (`card_details.unchecked_emails`, `unchecked_phones`) that becomes theirs leaves its list; the others stay not checked. The answer then has `message` in the web sheet's words (\"Saved Rohit's email. Nothing was sent to Rohit.\").",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contact"
                ],
                "properties": {
                  "contact": {
                    "$ref": "#/components/schemas/ContactInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated contact.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "delete": {
        "operationId": "deleteContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/contacts/{id}/block": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getContactBlock",
        "tags": [
          "Contacts"
        ],
        "summary": "Whether this contact's person is blocked on the kard",
        "description": "\"Block this sender\", as the web's contact sheet shows it: `block` is the block they're under on this kard (made from this contact, or from another of their contacts with the same email, number or account), or null. `blockable` is false when the contact has no email, number or shared card to block them by.",
        "responses": {
          "200": {
            "description": "The contact's block, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBlockState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "blockContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Block this contact's person from reaching the kard",
        "description": "What they send this kard from now on (its exchange form, a card shared back, a time suggested on its booking page) is dropped: no contact, and no email, notification or webhook to the kard's people. Nobody is told, the blocked person least of all: they get all anyone gets (the answer, a repeat's answer with the same contact id, their \"Here's …'s card\" email), and they can still see the kard. They're known by the contact's email, its number (any spacing) and, for a card shared back, its account. A booking on the kard's booking page is refused too, in the words a client the calendar blocked gets, with nothing kept; a waitlist join from that page files nothing (they see their waitlist page as anyone does). Already blocked: `200` with the block. Whoever may open the kard's contacts may block.",
        "responses": {
          "200": {
            "description": "Already blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBlockState"
                }
              }
            }
          },
          "201": {
            "description": "Blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBlockState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The contact has no email address, number or shared card to block them by (`nothing_to_block`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unblockContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Unblock this contact's person",
        "description": "Lifts every block the person is under on this kard (this contact's, and one made from another of their contacts), so what they send reaches it again. Nothing they sent while blocked comes back: it was never kept.",
        "responses": {
          "200": {
            "description": "Unblocked (`block` is null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBlockState"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/contacts/{id}/reaches": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "recordContactReach",
        "tags": [
          "Contacts"
        ],
        "summary": "Record a tap on Call, Text, WhatsApp or Email on a contact",
        "description": "\"Reached out\" (since 1.9.11): send it as the app opens the dialler, Messages, WhatsApp or the mail app for this contact, so the contact's `last_reach` and the web's \"Not reached yet\" (`?reached=no`) count the apps' taps as the web's. It records what eKard knows, that the tap opened it, not that a call or a message went: show it as \"Opened WhatsApp · Fri 23 Oct\". Done on a follow-up records `followed_up` by itself (the bulk `done`, the web's Done). Kept for the kard's own people (its holder, its team's admins); a site admin's tap is answered with `reach: null` and not kept. The same way by the same person within 10 minutes (a second tap, the outbox's retry) is the same line: `200` with it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactReachInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already kept (the same way by the same person within 10 minutes), or a site admin's tap (`reach` null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactReachResult"
                }
              }
            }
          },
          "201": {
            "description": "Kept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactReachResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "`way` isn't one of whatsapp, text, call, email, or `at` isn't a time (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/contacts/{id}/merge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "mergeContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "\"Same person?\": merge two contacts into one",
        "description": "The web's Merge them (since 1.9.13), for the pair a contact's `same_person` names: this contact and `with`, in either order. One contact stays, the visitor's send (`same_person.kept_id`), as they sent it (their message, answers, email and number, how they found the kard); it takes from the other what it lacks: the owner's note (beside its own), the company, job title and the card's other details, the event, the reminder, every other number and email, its bookings and its \"Reached out\" lines. For a suggested pair, the later send's message joins the first's as a return's does (\"Came back Thu 22 Oct: …\"), with its answers where the first has none and the products it ticked. The name is `name` when it's one of `same_person.names`, else the first of them (the added one's). The other contact is then deleted. Nothing is sent to anyone. Two contacts that aren't such a pair (any more) are `404`, as the web's page. Whoever may open the kard's contacts may.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "with"
                ],
                "properties": {
                  "with": {
                    "type": "integer",
                    "description": "The other contact's id (`same_person.contact_id`)."
                  },
                  "name": {
                    "type": "string",
                    "description": "One of `same_person.names`; anything else keeps the first of them."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Merged. `contact` is the one kept, as its sheet reads now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactMergeResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The contact kept wouldn't save with the other's details (`validation_failed`, the web's words: \"Not merged: email is invalid. Fix it on their contact, then merge again.\"). Nothing is merged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "keepContactsApart",
        "tags": [
          "Contacts"
        ],
        "summary": "\"Same person?\": keep two suggested contacts apart",
        "description": "The web's Keep them apart (since 1.9.13), with `?with=` the other contact's id: a suggested pair (`same_person.suggested`, two of a visitor's sends from before 1.9.6) stays two contacts and isn't suggested again. Any other pair is found again by the email or number it shares while it's two, so there's nothing to keep: `422 not_suggested` (the web's Keep them apart only goes back to the list). Who may: as `POST`.",
        "parameters": [
          {
            "name": "with",
            "in": "query",
            "required": true,
            "description": "The other contact's id (`same_person.contact_id`).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Kept apart. `contact` is the later send.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactKeptApart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "Not a suggested pair (`not_suggested`): \"Rahul V and Rahul Verma share the number +91 98201 33457, so the sheet asks again while they're two contacts: leave them as they are, or merge them.\"",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/blocks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listKardBlocks",
        "tags": [
          "Contacts"
        ],
        "summary": "Who's blocked on the kard",
        "description": "Everyone blocked on this kard, newest first, as the web's Contacts › Blocked lists them: a block stays when the contact it was made from is deleted (`contact_id` null), and can be lifted here.",
        "responses": {
          "200": {
            "description": "The blocks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "blocks"
                  ],
                  "properties": {
                    "blocks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/KardBlock"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/blocks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "delete": {
        "operationId": "deleteKardBlock",
        "tags": [
          "Contacts"
        ],
        "summary": "Lift one block",
        "responses": {
          "200": {
            "description": "Unblocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted",
                    "id",
                    "message"
                  ],
                  "properties": {
                    "deleted": {
                      "const": true
                    },
                    "id": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Ravi Mehta is unblocked. What they send Asha Rao reaches you again."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/events": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Events"
        ],
        "summary": "A kard's events",
        "responses": {
          "200": {
            "description": "The events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "createEvent",
        "tags": [
          "Events"
        ],
        "summary": "Create an event",
        "description": "Limit: 30 new events an hour per account, counted with the web's New event (`429 rate_limited`, with `Retry-After`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event"
                ],
                "properties": {
                  "event": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/EventInput"
                      },
                      {
                        "required": [
                          "name"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The event its idempotency_key made before.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/kards/{share_link}/events/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getEvent",
        "tags": [
          "Events"
        ],
        "summary": "One event",
        "responses": {
          "200": {
            "description": "The event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateEvent",
        "tags": [
          "Events"
        ],
        "summary": "Update an event",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event"
                ],
                "properties": {
                  "event": {
                    "$ref": "#/components/schemas/EventInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "delete": {
        "operationId": "deleteEvent",
        "tags": [
          "Events"
        ],
        "summary": "Delete an event (its contacts stay, detached)",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/products": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        },
        {
          "$ref": "#/components/parameters/OwnerLanguage"
        }
      ],
      "get": {
        "operationId": "listProducts",
        "tags": [
          "Products"
        ],
        "summary": "A kard's products, its Products section's settings and its plan's limits",
        "description": "Every product in the order the kard shows them, hidden ones and those past the plan's count too (`shown` says which the kard shows). For whoever manages the kard: its holder, its team's admins. Since 1.9.7 the shown ones appear on the kard's page, under `heading`, and in `GET /public_kards/lookup`'s `kard.products`.",
        "responses": {
          "200": {
            "description": "The products.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "createProduct",
        "tags": [
          "Products"
        ],
        "summary": "Add a product",
        "description": "`name` is required, and a price unless `price_mode` is `ask`. Its button (`action`) starts as `whatsapp` when the kard has a WhatsApp number, else `ask`. A button that can't work is refused in words that say how to fix it: `whatsapp` without the kard's WhatsApp number, `pay` without a way to get paid on the kard or without a fixed price, `link` without `url` (`422 validation_failed`, `details.action` or `details.url`; `message` is the same sentence, \"Order on WhatsApp needs your WhatsApp number on your Kard.\", since 1.9.9: before, it began with the field's name, \"Action Order on WhatsApp…\"). The free plan shows 6 products on a kard and a plan (given ones and the trial too; a team kard follows its team's) up to 200; a kard holds 200 at most. Past either: `422 validation_failed` with `details.products`, its message what to do (\"Your plan shows 6 products. A paid plan shows up to 200.\"). A team kard's products are its admins' to change: its other members get `403 forbidden`. To add the photo, send the request as multipart/form-data with the fields named `product[name]` and so on and the file in `product[photo]` (JPEG, PNG, GIF or WebP, up to 5 MB); its copies are made in the background a moment later.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "product"
                ],
                "properties": {
                  "product": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ProductInput"
                      },
                      {
                        "required": [
                          "name"
                        ]
                      }
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProductMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The product its idempotency_key made before.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/products/order": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "put": {
        "operationId": "reorderProducts",
        "tags": [
          "Products"
        ],
        "summary": "Put the kard's products in a new order",
        "description": "The whole order at once, as the web's Move up and Move down make it one step at a time: every product's id once (hidden ones too). The first ones are the ones the kard shows when its plan shows fewer than it has. Ids missing, repeated or not the kard's: `422 invalid_parameter`. Answers the list, as GET does.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "examples": [
                      [
                        42,
                        17,
                        23
                      ]
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The products in their new order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/products/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "patch": {
        "operationId": "updateProductSettings",
        "tags": [
          "Products"
        ],
        "summary": "The Products section's heading, its exchange question and taxes",
        "description": "What isn't sent stays as it is. `null` puts a setting's default back: ours for `heading`, on for `on_exchange`, the kard's country's for `prices_include_taxes` (null for those two since 1.9.10; before, null stored false). `heading` over 30 characters: `422 validation_failed`, `details.heading` the fragment (\"is too long: keep it to 30 letters\") and `message` a whole sentence (\"Heading is too long: keep it to 30 letters.\"; before 1.9.10 it named the setting, \"Products heading setting is too long…\"). Answers the list, as GET does.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "heading": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 30,
                    "description": "The section's heading in the owner's words, shown as written (\"Shop my picks\", \"Our range\", \"Menu\"). Empty or null: ours, \"Products\", in each visitor's language."
                  },
                  "on_exchange": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Ask visitors which products interest them when they send their details (the exchange's tick list, with the Products section). Null: the default, on."
                  },
                  "prices_include_taxes": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Visitors see \"Prices include taxes\" under the products. Null: the default, on where consumer prices include taxes (India, the EU, the UK) by the kard's country."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The products and the settings now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/products/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        },
        {
          "$ref": "#/components/parameters/OwnerLanguage"
        }
      ],
      "get": {
        "operationId": "getProduct",
        "tags": [
          "Products"
        ],
        "summary": "One product",
        "responses": {
          "200": {
            "description": "The product.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateProduct",
        "tags": [
          "Products"
        ],
        "summary": "Change a product, its photo, Sold out or Hidden",
        "description": "What isn't sent stays as it is. `available: false` is Sold out (it stays on the kard, its button greyed); `hidden: true` takes it off the kard and keeps it. One of those two sent alone answers with the web's words for that switch in `message` (since 1.9.10): \"Mailer box is marked Sold out: it stays on your Kard with its button greyed.\", \"Mailer box is back in stock.\", \"Mailer box is hidden: it's kept here, off your Kard.\", \"Mailer box shows again.\"; anything else \"Mailer box is saved.\". Showing a hidden one past the plan's count: `422 validation_failed` with `details.products` (\"Your Kard shows 6 products on your plan. Hide another to show this one, or keep them all with a paid plan.\"; to the apps, which offer no plan, without \"or keep them all with a paid plan\" since 1.9.10). A new photo goes as multipart/form-data in `product[photo]`; `remove_photo: true` takes it away. The same refusals as create.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "product"
                ],
                "properties": {
                  "product": {
                    "$ref": "#/components/schemas/ProductInput"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProductMultipart"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The product now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "delete": {
        "operationId": "deleteProduct",
        "tags": [
          "Products"
        ],
        "summary": "Delete a product and its photo",
        "description": "Gone from the kard and the list for good, with its photo; there's no undo. Contacts who said they were interested keep its name (their `products` line stays). Ask first in the web's words: \"Delete Mailer box? It leaves your Kard and this list for good, with its photo. Contacts who said they were interested keep its name.\" (one wording on the web and in both apps since 1.9.10).",
        "responses": {
          "200": {
            "description": "Deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted",
                    "id",
                    "message"
                  ],
                  "properties": {
                    "deleted": {
                      "const": true
                    },
                    "id": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Mailer box is deleted."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/documents": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listDocuments",
        "tags": [
          "Documents"
        ],
        "summary": "A kard's documents",
        "responses": {
          "200": {
            "description": "The documents.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "documents"
                  ],
                  "properties": {
                    "documents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "uploadDocument",
        "tags": [
          "Documents"
        ],
        "summary": "Upload a document",
        "description": "PDF, Word or images, up to 10 MB each and 10 per kard. The slug is made from the file name when omitted.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream"
                  },
                  "title": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]+$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/documents/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getDocument",
        "tags": [
          "Documents"
        ],
        "summary": "One document",
        "responses": {
          "200": {
            "description": "The document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateDocument",
        "tags": [
          "Documents"
        ],
        "summary": "Rename a document or change its slug",
        "description": "Changing the slug changes its public URL and QR code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]+$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "delete": {
        "operationId": "deleteDocument",
        "tags": [
          "Documents"
        ],
        "summary": "Delete a document",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/documents/{id}/replace": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "patch": {
        "operationId": "replaceDocumentFile",
        "tags": [
          "Documents"
        ],
        "summary": "Replace a document's file, keeping its slug, URL and QR code",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The document with its new file.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/documents/{document_id}/design": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/DocumentId"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getDocumentDesign",
        "tags": [
          "Documents"
        ],
        "summary": "A document's landing page",
        "description": "Instead of opening the raw file, a document's URL can serve a custom HTML page (draft, then publish; sanitized on publish).",
        "responses": {
          "200": {
            "description": "The landing page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "saveDocumentDesign",
        "tags": [
          "Documents"
        ],
        "summary": "Save the landing page's draft (and publish it with `publish`)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DesignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved draft, or the published page with what the sanitizer removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/documents/{document_id}/design/publish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/DocumentId"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "publishDocumentDesign",
        "tags": [
          "Documents"
        ],
        "summary": "Publish the landing page's draft",
        "description": "The response's `sanitizer_removals` lists anything stripped for safety; mention them to the owner.",
        "responses": {
          "200": {
            "description": "Published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/documents/{document_id}/design/unpublish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/DocumentId"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "delete": {
        "operationId": "unpublishDocumentDesign",
        "tags": [
          "Documents"
        ],
        "summary": "Take the landing page down (the QR opens the file again; the draft stays)",
        "responses": {
          "200": {
            "description": "Unpublished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/qr": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getQr",
        "tags": [
          "QR code"
        ],
        "summary": "The kard's QR design and image URLs",
        "description": "The stored PNG is also public at `{kard url}/qr`.",
        "responses": {
          "200": {
            "description": "The QR code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateQr",
        "tags": [
          "QR code"
        ],
        "summary": "Restyle the QR code, set or remove its logo, or reset it",
        "description": "Three modes: design keys under `qr` (merged into the current design; out-of-range numbers are clamped), a `logo` file (multipart) or `remove_logo=1`, or `reset_default=1` for the stock design. The stored PNG is re-rendered.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "qr": {
                    "$ref": "#/components/schemas/QrDesign"
                  },
                  "remove_logo": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  },
                  "reset_default": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "logo"
                ],
                "properties": {
                  "logo": {
                    "type": "string",
                    "contentMediaType": "image/png",
                    "description": "PNG, JPG, WebP or GIF, up to 2 MB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The QR code as now drawn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/qr/regenerate": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "regenerateQr",
        "tags": [
          "QR code"
        ],
        "summary": "Re-render the stored QR image",
        "responses": {
          "200": {
            "description": "The QR code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QrEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/signature": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getSignature",
        "tags": [
          "Email signature"
        ],
        "summary": "The kard as an email signature, in a layout",
        "description": "HTML for the clipboard (tables and inline styles; it pastes into Gmail, Outlook and Apple Mail) with a plain-text twin. Its images (`{kard url}/signature_photo`, `{kard url}/signature_qr`) always show the kard's current photo and QR; the text is as of now, so copy it again after editing the kard. What it says (Save my contact, Scan for my card, the credit, \"My card:\") is in the kard's main language, right to left when that is.",
        "parameters": [
          {
            "name": "layout",
            "in": "query",
            "required": false,
            "description": "`qr` (default): photo, details and the kard's QR. `button`: photo, details and a Save my contact button. `text`: text only.",
            "schema": {
              "type": "string",
              "enum": [
                "qr",
                "button",
                "text"
              ]
            }
          },
          {
            "name": "file",
            "in": "query",
            "required": false,
            "description": "`1`: a line of its own for the kard's first file (`file` in the answer), its name and an arrow linking to the file's page (\"Résumé →\"; the text twin \"Résumé: <url>\"), as the web's \"Add a line for Résumé, which opens it\" adds it. Without it, or on a kard with no file, no line (`with_file` false). Since 1.9.13 or 1.9.14.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The signature.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/shares": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "recordKardShare",
        "tags": [
          "Kards"
        ],
        "summary": "Record that the kard was sent on (it ticks \"Get your Kard seen\")",
        "description": "Send it as the app hands the kard's link to another app (the share sheet, Copy link, WhatsApp, an email, a text message) or copies its email signature or saves its QR: the sending itself never reaches the server. The web's Share tab records the same (`launch_checklist`'s `chat` and `signature` steps tick from it). Recorded for the kard's holder and its organization's admins; a site admin's send answers `204` and records nothing. 30 a minute per account, the web's taps and the app's together.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KardShareInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Recorded."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "A channel this list doesn't have (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/kards/{share_link}/qr_shows": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "recordKardQrShown",
        "tags": [
          "Kards"
        ],
        "summary": "Record that the app showed the kard's QR full screen (the web's Show my QR)",
        "description": "Send it each time the app puts the kard's QR up full screen for someone in front of the person (Share's Show full screen, the Show my Kard control, the widget), in the background as the app opens it; nothing to send offline. Counted with the web's Show my QR in eKard's growth report, by where it was opened (`from`). It ticks no step of `launch_checklist`: showing the code isn't proof anyone scanned it (`POST /kards/{share_link}/shares` records a send). Recorded for the kard's holder and its organization's admins; a site admin's answers `204` and records nothing. 30 a minute per account. New in 1.9.10: a server before it has no such path (`404`); send nothing then.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "enum": [
                      "share",
                      "widget",
                      "control"
                    ],
                    "description": "Where in the app: `share` (Share's Show full screen), `widget`, `control` (the Show my Kard control). Left out: elsewhere in the app."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Recorded."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "A `from` this list doesn't have (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/kards/{share_link}/launch_checklist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "delete": {
        "operationId": "hideKardLaunchChecklist",
        "tags": [
          "Kards"
        ],
        "summary": "Hide \"Get your Kard seen\" for good",
        "description": "The web's \"Hide this list\": the kard's `launch_checklist` is null from now on, on the web too. Its holder's alone, as the list is (anyone else: `404`). Again: `204`. The email signature, the printable card and the lock-screen wallpaper stay where they were; the web's words for it: \"Hidden. The email signature, printable card and lock-screen wallpaper stay on Priya Sharma's Share tab.\"",
        "responses": {
          "204": {
            "description": "Hidden."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/live_panel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "delete": {
        "operationId": "hideKardLivePanel",
        "tags": [
          "Kards"
        ],
        "summary": "Hide \"Your Kard is live\" for good",
        "description": "The web's \"Hide\" on \"Your Kard is live\", the panel Create opens on: the kard's `settings.live_panel_dismissed` is true from now on, so the web never shows it again and an app that shows its own after Create hides it on every device. Its holder's alone, as the panel is (anyone else: `404`). Again: `204`. Nothing a visitor sees changes; the web's words for it: \"Hidden. Send to a number, your link and your QR stay on this tab.\"",
        "responses": {
          "204": {
            "description": "Hidden."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/search_offer": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "patch": {
        "operationId": "answerKardSearchOffer",
        "tags": [
          "Kards"
        ],
        "summary": "Answer \"Let people find this Kard on Google\"",
        "description": "The kard's `search_offer` answered, as the web's buttons do, and ended for good, on the web too: `yes` (\"Show it on Google\") lets search engines in, so the kard's `indexable` becomes true, the sitemap lists it and its page names its canonical; `no` (\"No, keep it hidden\") and `not_now` (\"Not now\") change nothing a visitor sees. Whoever the offer asks may answer (the kard's holder, its organization's admins); anyone else gets `404`. Answering when it isn't asked is fine: `yes` on a kard search engines can already see keeps it so. Also the Google panel's \"Show it on Google\" (`google` on the kard's analytics, while it's hidden). A kard that can't save (one made before a newer rule) answers `422 validation_failed` and keeps nothing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchOfferAnswerInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Kept.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchOfferAnswer"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/wallpaper.png": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getKardWallpaper",
        "tags": [
          "Kards"
        ],
        "summary": "The kard's QR on a phone's lock screen, as a picture",
        "description": "The web's lock-screen wallpaper (free on every plan): the kard's QR from its QR studio on a white plate, with the name, job title and company over it, on the colours of `style`, the top of the picture left clear for the clock and the bottom for the lock screen's buttons. Wake the phone and anyone can scan it. The kard's people only (its holder, its organization's admins). Each one counts toward `launch_checklist`'s `in_person` step, as the web's download does. Drawn in the request (a second or two), out of one drawing budget per account for every picture the web and the app draw (its wallpapers, pictures to post, video backgrounds and printable cards): about 30 seconds of drawing a minute, some 16 wallpapers; past it `429 rate_limited` with `Retry-After`. A kard hidden after a complaint draws nothing: `451 unavailable`. The web's words on setting it: on an iPhone, open it in Photos, tap Share, then Use as Wallpaper, then Add, and choose Set as Wallpaper Pair; on Android, Use as or Set as wallpaper (the words differ from phone to phone), then Lock screen. Set it as it comes, without zooming in: zooming can push the code off the screen.",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "description": "`iphone` (the default): 1290 × 2796, which every iPhone fits to its screen. `android`: 1440 × 3200, which fits most Android phones. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "iphone",
                "android"
              ],
              "default": "iphone"
            }
          },
          {
            "name": "style",
            "in": "query",
            "description": "Its colours: one of the kard's `wallpaper_styles` keys, `kard` (the colours of the kard's layout) when left out. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "kard",
                "porcelain",
                "ink",
                "seal"
              ],
              "default": "kard"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The picture (`Content-Disposition: inline`, named like `Priya Sharma lock screen iPhone 1290x2796.png`): RGB, no transparency, which every phone takes.",
            "headers": {
              "Content-Disposition": {
                "$ref": "#/components/headers/PictureFileName"
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/png"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The kard's fonts can't draw some of its words (`undrawable`; the `message` is the web's: \"Priya Sharma can't go on a wallpaper yet: its fonts don't draw Ꮜ Ꮚ. Change those words in Edit Kard to make one.\"), or a `phone` or `style` it doesn't have (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "451": {
            "description": "The kard is hidden after a complaint, while it's looked into (`unavailable`): nothing is drawn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/picture.png": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getKardPicture",
        "tags": [
          "Kards"
        ],
        "summary": "A picture to post: the kard's QR for a Status or a chat, with a festival greeting or without",
        "description": "The web's \"Picture to post\" (the Share tab's Status picture and Festival greeting; free on every plan): the kard's photo (or its team's logo), name, job title and company over its QR studio's code, in the colours of `style`, with the brand line at the foot unless a paid plan hides it. With an `occasion` it's a greeting card: the greeting over the person and the code, and a line under it. The kard's people only (its holder, its organization's admins). Each picture (not a `preview`) counts toward `launch_checklist`'s `chat` step, as the web's download does. Drawn in the request (a second or two), out of one drawing budget per account for every picture the web and the app draw (its pictures to post, wallpapers, video backgrounds and printable cards): about 30 seconds of drawing a minute, some 20 pictures or 40 previews; past it `429 rate_limited` with `Retry-After`. A kard hidden after a complaint draws nothing: `451 unavailable`. Post it as it comes: Status and Stories lay their bars over the top and the bottom of a `status` picture, which are left clear. Put the kard's link in the caption (a viewer can't scan their own screen); the web's caption link is `public_url` with `?via=chat`, so Analytics counts its visits as sent in a chat.",
        "parameters": [
          {
            "name": "shape",
            "in": "query",
            "description": "`status` (the default): 1080 × 1920, the shape of a phone's screen, for WhatsApp Status and Instagram and Facebook Stories. `square`: 1080 × 1080, which a chat or a feed shows whole. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "status",
                "square"
              ],
              "default": "status"
            }
          },
          {
            "name": "style",
            "in": "query",
            "description": "Its colours: one of the kard's `wallpaper_styles` keys, `kard` (the colours of the kard's layout) when left out. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "kard",
                "porcelain",
                "ink",
                "seal"
              ],
              "default": "kard"
            }
          },
          {
            "name": "occasion",
            "in": "query",
            "description": "A greeting, one of the kard's `picture_occasions` keys: `wishes` (Warm wishes), `thanks`, `christmas`, `diwali`, `eid`, `lunar_new_year`, `new_year`; `none` (the default) for no greeting. Anything else is `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "wishes",
                "thanks",
                "christmas",
                "diwali",
                "eid",
                "lunar_new_year",
                "new_year"
              ],
              "default": "none"
            }
          },
          {
            "name": "greeting",
            "in": "query",
            "description": "Your own words for the greeting, at most 40 letters (शुभ दीपावली, عيد مبارك: any script the print fonts carry; emoji are left off). Left out or empty, the occasion's own (`picture_occasions[].greeting`). Only with an `occasion` other than `none`; otherwise `422 invalid_parameter`.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "message",
            "in": "query",
            "description": "The line under the greeting, at most 90 letters. Left out, the occasion's own (`picture_occasions[].message`); empty (`message=`), no line. Only with an `occasion` other than `none`.",
            "schema": {
              "type": "string",
              "maxLength": 90
            }
          },
          {
            "name": "preview",
            "in": "query",
            "description": "`true`: the same picture 400 pixels wide, for showing while the words are chosen. Not counted as a send, and on its own limit (60 a minute).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The picture (`Content-Disposition: inline`), RGB with no transparency, named like the web's download: `Priya Sharma greeting 1080x1920.png`, `Priya Sharma Status picture 1080x1920.png` or `Priya Sharma picture 1080x1080.png`.",
            "headers": {
              "Content-Disposition": {
                "$ref": "#/components/headers/PictureFileName"
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/png"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The fonts can't draw some of the kard's words or of the greeting (`undrawable`, in the web's words: \"Priya Sharma can't go on a picture yet: its fonts don't draw Ꮜ Ꮚ. Change those words in Edit Kard to make one.\" or \"The picture's fonts don't draw Ꮜ in your greeting. Change those letters to make one.\"; `details.words` says which: `kard`, fixed in Edit Kard, or `greeting`, fixed in the words sent, and `details.characters` lists the letters, eight at most), or a `shape`, `style` or `occasion` it doesn't have, words too long, or words without an occasion (`invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "451": {
            "description": "The kard is hidden after a complaint, while it's looked into (`unavailable`): nothing is drawn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/kards/{share_link}/design": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getDesign",
        "tags": [
          "Custom design"
        ],
        "summary": "The kard's custom HTML page",
        "description": "Visitors only ever see published HTML; the standard layout shows until then.",
        "responses": {
          "200": {
            "description": "The design and how many versions it has.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/DesignEnvelope"
                    },
                    {
                      "type": "object",
                      "required": [
                        "versions_count"
                      ],
                      "properties": {
                        "versions_count": {
                          "type": "integer"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "saveDesign",
        "tags": [
          "Custom design"
        ],
        "summary": "Save the draft (and publish it with `publish`)",
        "description": "Up to 150,000 characters. Every save is kept in the history.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DesignInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved draft, or the published page with what the sanitizer removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/kards/{share_link}/design/publish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "publishDesign",
        "tags": [
          "Custom design"
        ],
        "summary": "Publish the draft as the kard's page",
        "description": "Sanitized on publish; `sanitizer_removals` lists anything stripped (scripts, external iframes...). Mention removals to the owner.",
        "responses": {
          "200": {
            "description": "Published.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/design/unpublish": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "delete": {
        "operationId": "unpublishDesign",
        "tags": [
          "Custom design"
        ],
        "summary": "Return to the standard layout (the draft stays)",
        "responses": {
          "200": {
            "description": "Unpublished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DesignEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/design/versions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listDesignVersions",
        "tags": [
          "Custom design"
        ],
        "summary": "The last 50 versions of the design",
        "responses": {
          "200": {
            "description": "Newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "versions"
                  ],
                  "properties": {
                    "versions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DesignVersion"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/design/restore": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "restoreDesignVersion",
        "tags": [
          "Custom design"
        ],
        "summary": "Make an earlier version the draft (nothing goes live until publish)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "version_id"
                ],
                "properties": {
                  "version_id": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The restored draft.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/DesignEnvelope"
                    },
                    {
                      "type": "object",
                      "required": [
                        "restored_version_id"
                      ],
                      "properties": {
                        "restored_version_id": {
                          "type": "integer"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/design/checkpoint": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "createDesignCheckpoint",
        "tags": [
          "Custom design"
        ],
        "summary": "Name the current draft as a safety point (up to 25)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "maxLength": 120
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The checkpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "checkpoint"
                  ],
                  "properties": {
                    "checkpoint": {
                      "$ref": "#/components/schemas/DesignVersion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/design/templates": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listDesignTemplates",
        "tags": [
          "Custom design"
        ],
        "summary": "The built-in templates",
        "responses": {
          "200": {
            "description": "The templates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "templates"
                  ],
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "name",
                          "blurb"
                        ],
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "blurb": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/design/apply_template": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "applyDesignTemplate",
        "tags": [
          "Custom design"
        ],
        "summary": "Make a template the draft (the previous draft stays in the history)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "template"
                ],
                "properties": {
                  "template": {
                    "type": "string",
                    "description": "A slug from the templates list."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new draft.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/DesignEnvelope"
                    },
                    {
                      "type": "object",
                      "required": [
                        "applied_template"
                      ],
                      "properties": {
                        "applied_template": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations": {
      "get": {
        "operationId": "listOrganizations",
        "tags": [
          "Organizations"
        ],
        "summary": "The account's organizations, with its role in each",
        "responses": {
          "200": {
            "description": "The organizations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "organizations"
                  ],
                  "properties": {
                    "organizations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Organization"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "startOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Start a team (free for up to 25 people); the account is its first admin",
        "description": "As the web's Start a team. The account must have a verified email address (`403 email_unverified`: its `verify_url`, `POST /me/email_verification`, sends the link) and run fewer than 3 teams (`403 team_limit`); 3 new teams a day (`429 rate_limited`). `slug` is its address (https://ekard.app/<slug>): letters, numbers and underscores, 3 to 50, not taken, not reserved, and not an old address that still leads somewhere (GET /organizations/address checks one first). Its own kard, the front door at /<slug>, is made either way; `kard_name` also makes the account a team kard of its own with that name (`kard`; null without it); `kard`, the share link of one of the account's own personal kards that names a person and has no domain of its own, brings that kard in instead, with everything on it, its contacts too, at the team's link for its name (its old link and printed QR codes lead there; another is `422 validation_failed` under `kard`); it becomes the team's: any admin of the team can read its contacts, hand it to someone else or delete it, and it stays in the team if they leave. A team is free for up to 25 people for now (GET /organizations/{slug}/members `places`). The account is emailed what to do next. Send `logo` as multipart.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "organization"
                ],
                "properties": {
                  "organization": {
                    "$ref": "#/components/schemas/OrganizationStartInput"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "organization[name]",
                  "organization[slug]"
                ],
                "properties": {
                  "organization[name]": {
                    "type": "string"
                  },
                  "organization[slug]": {
                    "type": "string"
                  },
                  "organization[kard_name]": {
                    "type": "string"
                  },
                  "organization[kard]": {
                    "type": "string"
                  },
                  "organization[logo]": {
                    "type": "string",
                    "contentMediaType": "image/png"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/TeamStartRefused"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/address": {
      "get": {
        "operationId": "checkOrganizationAddress",
        "tags": [
          "Organizations"
        ],
        "summary": "Whether an address is free for a new team, or for renaming one",
        "description": "The web's live check under the address field, as saving would answer. With `organization` (one the account administers), renaming it: its own address is `available` (\"That's Glow Studio's address now.\"), and so is one of its own old ones.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organization",
            "in": "query",
            "required": false,
            "description": "The slug of the organization being renamed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationAddressCheck"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/{slug}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "getOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "One organization (its admins and members)",
        "description": "Its admins read all of it. A member (a calendar login included) reads what the web's page shows them, the same organization `GET /organizations` lists: their place in it (`role`, `calendar_only`, `calendar_login`, `membership_summary`) and `admin_names`, the admins to ask, with `custom_domain` and `launch_checklist` null. Anyone else: `403`.",
        "responses": {
          "200": {
            "description": "The organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Configure an organization (admins only)",
        "description": "Send `logo` as multipart, or `remove_logo=1`. A new `slug` follows the rules of starting one (GET /organizations/address checks it). The old address keeps working: it, the team kards' old links and every QR code already printed redirect to the new one, and its own kard stays the front door at the new /<slug>. Deleting an organization isn't self-serve.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "organization"
                ],
                "properties": {
                  "organization": {
                    "$ref": "#/components/schemas/OrganizationInput"
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "organization[logo]": {
                    "type": "string",
                    "contentMediaType": "image/png"
                  },
                  "organization[remove_logo]": {
                    "type": "string",
                    "enum": [
                      "1"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/organizations/{slug}/launch_checklist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "delete": {
        "operationId": "hideTeamLaunchChecklist",
        "tags": [
          "Organizations"
        ],
        "summary": "Hide \"Set up your team\" for good, for every admin",
        "description": "The web's \"Hide this list\" on the team's page: the organization's `launch_checklist` is null from now on, for each of its admins, on the web too. The team's admins only, the ones who see it: a plain member gets `403`; a site admin who isn't one of its admins, or anyone else, `404`. Again: `204`. Nothing a visitor sees changes, and inviting people, printing the cards and the team's settings stay where they were; the web's words for it: \"Hidden for Acme's admins. Inviting people, printing cards and the team's settings stay on its page.\"",
        "responses": {
          "204": {
            "description": "Hidden."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/own_kard": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "post": {
        "operationId": "bringOwnKardIntoTeam",
        "tags": [
          "Organizations"
        ],
        "summary": "Bring one of your own kards into a team you run",
        "description": "The web's \"Bring in Marcus Bell\" on Set up your team: one of the account's own kards (`kard`, its share link: one of `kards_to_bring` on `GET /me`, or on the team's `launch_checklist`) moves into the team with everything on it, its contacts too, and becomes the team's: every admin of the team can read its contacts, hand it to someone else or delete it, and it stays in the team if its person leaves (say so in the app's confirm, as the web does). It takes the team's link for its name (`bell_realty/marcus`); its old link and every QR code printed with it keep leading to it, whoever holds it. An account with a paid plan of its own: the plan covers its personal kards, and in the team the kard has the team's plan. The answer is the kard where it is now, the organization (its checklist's `own_kard` step done once the kard has more than a name and email), and the web's words (`message`), which also name a team kard of theirs there with only a name and email, to delete if they don't need it. The team's admins only, bringing their own: a plain member gets `403`; a site admin who isn't one of its admins, or anyone else, `404`. A kard that isn't one they can bring (another's, a business's, one with its own domain, or none by that link) is `422 validation_failed` (`details.kard`), and so is one the move refuses (\"Marcus Bell didn't come into Bell Realty: …. Fix it in its editor, then bring it in again.\"); nothing moves then. New in 1.9.10: a server before it has no such path (`404`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kard"
                ],
                "properties": {
                  "kard": {
                    "type": "string",
                    "description": "The share link of one of the account's own kards to bring in (`kards_to_bring`).",
                    "examples": [
                      "x7kp2"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Brought in.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnKardBrought"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "Not a kard they can bring, or one the move refuses (`validation_failed`, `details.kard`), in words.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/organizations/{slug}/our_team_offer": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "delete": {
        "operationId": "hideOurTeamOffer",
        "tags": [
          "Organizations"
        ],
        "summary": "Hide \"Show your team on one page\" for good, for every admin",
        "description": "The web's \"No thanks\" on the team's page: the organization's `our_team_offer` is null from now on, for each of its admins, on the web too. \"Our team\" itself stays as it was (off): an admin can still turn it on with `PATCH /organizations/{slug}` (`our_team_public_setting: true`), as the web's Settings › Our team does. The team's admins only, the ones who see it: a plain member gets `403` (\"Only Glow Studio's admins can hide “Show your team on one page”.\"); a site admin who isn't one of its admins, or anyone else, `404`. Again: `204`. The web's words for it: \"Hidden for Glow Studio's admins. “Our team” stays off until an admin turns it on in Settings › Our team.\"",
        "responses": {
          "204": {
            "description": "Hidden."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/kards": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "listOrganizationKards",
        "tags": [
          "Organizations"
        ],
        "summary": "Every kard in an organization (admins only)",
        "responses": {
          "200": {
            "description": "The kards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KardList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/analytics": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "getOrganizationAnalytics",
        "tags": [
          "Organizations"
        ],
        "summary": "Every team kard's visits and contacts (admins); a member's own team kards'",
        "description": "The organization's whole team in one call, in GET /analytics's shape, for its admins. A member (a calendar login included) gets the team kards they hold there and no others, as `GET /analytics?organization={slug}` answers them, so a team's Kards list can show each of their own its last 30 days: `totals` adds up those rows only (none: `kards` empty, every total 0). Anyone outside the team: `403` (\"Your account is not on this team.\").",
        "responses": {
          "200": {
            "description": "The analytics: every team kard for its admins, a member's own for a member.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAnalytics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/custom_domain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getKardCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "A personal kard's own domain, and where it stands",
        "description": "`custom_domain` is null when the kard has none. A team kard opens under its organization's domain: GET /organizations/{slug}/custom_domain.",
        "responses": {
          "200": {
            "description": "The domain, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "connectKardCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Connect a domain to a personal kard, or switch to another",
        "description": "Claims the domain and registers it for its certificate; the answer says which DNS record to add (`dns_records`), and the domain goes live by itself once the record is in (often minutes, sometimes hours). Switching to another domain removes the current one; the same domain again changes nothing (200). A domain whose record never shows up is let go a week after it was registered (`release_at`). Every paid plan: `403 plan_required` otherwise, with `upgrade_url`. A team kard can't take one (422). When another account's claim on the name hasn't been proven, the 422 carries `error.challenge`, a TXT record: once it's in the name's DNS, connecting again takes the name over. 10 connects and checks a minute.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "custom_domain"
                ],
                "properties": {
                  "custom_domain": {
                    "$ref": "#/components/schemas/CustomDomainInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Switched to this domain, or it was this one already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DomainsUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "removeKardCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Remove a personal kard's domain",
        "description": "It stops opening the kard at once; the eKard link keeps working. Tell the owner to delete the DNS record too (`message`), so nobody else can connect the name.",
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainRemoved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/kards/{share_link}/custom_domain/check": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "post": {
        "operationId": "checkKardCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Check a personal kard's domain now",
        "description": "Asks the certificate service and DNS, as the scheduled checks do (every few minutes in the first hour, then less often), in the background: 202 at once with where it stood, then GET it in a few seconds. A certificate whose checks timed out is sent through them again, and a proven domain the certificate service is still validating gets its validation nudged. 10 connects and checks a minute.",
        "responses": {
          "202": {
            "description": "Checking now; where it stood before, and a message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainChecking"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/{slug}/custom_domain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "getOrganizationCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "An organization's own domain, and where it stands (admins only)",
        "description": "Its root opens the organization's own kard, and each team kard opens at the domain followed by its share_link. `custom_domain` is null when it has none.",
        "responses": {
          "200": {
            "description": "The domain, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "connectOrganizationCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Connect a domain to an organization, or switch to another (admins only)",
        "description": "As for a kard. Every paid plan: the organization's, or an admin's.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "custom_domain"
                ],
                "properties": {
                  "custom_domain": {
                    "$ref": "#/components/schemas/CustomDomainInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Switched to this domain, or it was this one already.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Connected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/DomainsUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "removeOrganizationCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Remove an organization's domain (admins only)",
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainRemoved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/custom_domain/check": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "post": {
        "operationId": "checkOrganizationCustomDomain",
        "tags": [
          "Custom domains"
        ],
        "summary": "Check an organization's domain now (admins only)",
        "description": "As for a kard; 202 at once, then GET it in a few seconds.",
        "responses": {
          "202": {
            "description": "Checking now; where it stood before, and a message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomDomainChecking"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/{slug}/members": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "listOrganizationMembers",
        "tags": [
          "Organizations"
        ],
        "summary": "Everyone in an organization, its open invitations and who holds each Kard (admins only)",
        "description": "The web's Members page: each member with their role, their calendar login if any and the Kards they hold (`can_hold_kards` is false for someone whose only way in is a calendar login); the invitations still open (waiting, or expired and resendable); every team Kard but the organization's main one, with its `holder` (null: its admins keep it); and the page's count line in `summary`.",
        "responses": {
          "200": {
            "description": "The team.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationTeam"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/members/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "The member's `id` from GET /organizations/{slug}/members.",
          "schema": {
            "type": "integer"
          }
        }
      ],
      "patch": {
        "operationId": "updateOrganizationMember",
        "tags": [
          "Organizations"
        ],
        "summary": "Make a member an admin, or an admin a member (admins only)",
        "description": "The organization always keeps an admin: taking the last one's role is `422 last_admin`. You may step down yourself while another admin remains. An admin made a member loses the open invitations they sent (cancelled; the `message` names them).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "member"
                ],
                "properties": {
                  "member": {
                    "type": "object",
                    "required": [
                      "role"
                    ],
                    "properties": {
                      "role": {
                        "type": "string",
                        "enum": [
                          "admin",
                          "member"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The member as they are now, and what it means.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberChanged"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/TeamRefused"
          }
        }
      },
      "delete": {
        "operationId": "removeOrganizationMember",
        "tags": [
          "Organizations"
        ],
        "summary": "Take someone out of the organization (admins only)",
        "description": "They lose the organization's pages and Kards, and their calendar login ends. A calendar team member linked to them keeps its bookings, but their own calendar stops getting them and its private links change. Their team Kards stay the organization's, with their links, QR codes and contacts: given to `kards_to`, or kept with the admins (nobody holds them), and cleared of their details first with `clear_details`. The open invitations they sent are cancelled. The last admin can't be removed (`422 last_admin`). Removing yourself is leaving: an admin leaving can choose both here, where `DELETE /organizations/{slug}/membership` keeps the Kards with the admins.",
        "parameters": [
          {
            "name": "kards_to",
            "in": "query",
            "required": false,
            "description": "The member `id` to give their team Kards to: someone else who `can_hold_kards`. Leave it out to keep them with the admins.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "clear_details",
            "in": "query",
            "required": false,
            "description": "true: their details go from the team Kards they held before anyone gets them (the name becomes the organization's; job title, photo, phone, email, social and custom links, and any custom design go; the link, QR code and contacts stay). Without it the Kards keep showing them until someone edits them. The email telling them they were removed says which.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removed; `kards` are the Kards they held, as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberRemoved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/TeamRefused"
          }
        }
      }
    },
    "/organizations/{slug}/membership": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "delete": {
        "operationId": "leaveOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Leave an organization (any member)",
        "parameters": [
          {
            "name": "clear_details",
            "in": "query",
            "required": false,
            "description": "true: your details go from the Kards you hold there as you leave (the name becomes the organization's; job title, photo, phone, email, social and custom links, and any custom design go). Without it they keep showing them until an admin edits them.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "description": "Your team Kards there stay the organization's, with its admins, and the calendar unlinks you from its team members (their bookings stay). The last admin can't leave (`422 last_admin`): make someone else an admin first. Not in it: 404.",
        "responses": {
          "200": {
            "description": "Left; `kards` are the Kards you held there, now with its admins.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberRemoved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/TeamRefused"
          }
        }
      }
    },
    "/organizations/{slug}/invitations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "post": {
        "operationId": "inviteToOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Invite someone to the organization by email (admins only)",
        "description": "The email goes out at once. Its link works once, for 14 days, for the account with that email (they sign in, or create the account). `role` is `member` unless you send `admin`. Someone already in the organization can't be invited, except a calendar login, whom joining puts on the team. 30 invitations an hour per account, counted with the web's and the calendar's, and at most 3 invitation emails a day to one address, whoever sends them (past that, 422). A team is free for up to 25 people for now: each person on the team and each open invitation takes a place (GET /organizations/{slug}/members `places`), and with none left the invitation is `422 team_full`, its message saying how to free one or ask for more.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "invitation"
                ],
                "properties": {
                  "invitation": {
                    "type": "object",
                    "required": [
                      "email"
                    ],
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "member",
                          "admin"
                        ]
                      },
                      "kard": {
                        "type": "string",
                        "description": "Optional: the `share_link` of one of the organization's team Kards, handed to them when they join. One nobody holds, or one you hold, that no other open invitation carries (else 422); another organization's, or its main Kard, is a 404."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationNow"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/InvitationRefused"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/{slug}/invitations/{id}/resend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "operationId": "resendOrganizationInvitation",
        "tags": [
          "Organizations"
        ],
        "summary": "Send an invitation again (admins only)",
        "description": "The same link, working for 14 days from now (an expired one comes back). `sent: false` (nothing went out) within a minute of the last send, or once the address has had 3 invitation emails today. Counts in the same 30 invitations an hour. Only open invitations are found.",
        "responses": {
          "200": {
            "description": "The invitation as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationNow"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/organizations/{slug}/invitations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "delete": {
        "operationId": "cancelOrganizationInvitation",
        "tags": [
          "Organizations"
        ],
        "summary": "Cancel an invitation (admins only)",
        "description": "Its link stops working. Only open invitations are found; a used or cancelled one is a 404.",
        "responses": {
          "200": {
            "description": "Cancelled (`status` is `revoked`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInvitationNow"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/join_link": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "getOrganizationJoinLink",
        "tags": [
          "Organizations"
        ],
        "summary": "The team's join link (admins only)",
        "description": "One link to share in a group chat instead of an email per person: whoever opens it signs in and asks to join, and nobody joins until an admin approves them (`GET /organizations/{slug}/join_requests`). `join_link` is null while it's off.",
        "responses": {
          "200": {
            "description": "The link, or null.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinLinkEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "makeOrganizationJoinLink",
        "tags": [
          "Organizations"
        ],
        "summary": "Turn the join link on, or replace it (admins only)",
        "description": "A new link that works for 14 days and takes up to 50 requests. The old one, if any, stops working at once; requests already made through it stay to be answered.",
        "responses": {
          "201": {
            "description": "The new link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinLinkNow"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "operationId": "turnOffOrganizationJoinLink",
        "tags": [
          "Organizations"
        ],
        "summary": "Turn the join link off (admins only)",
        "description": "It stops working at once. Requests already made through it stay to be answered.",
        "responses": {
          "200": {
            "description": "Off (`join_link` is null).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinLinkNow"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/join_requests": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        }
      ],
      "get": {
        "operationId": "listOrganizationJoinRequests",
        "tags": [
          "Organizations"
        ],
        "summary": "Requests to join the team through its join link, waiting for an admin (admins only)",
        "description": "Oldest first. A request takes one of the team's places only once it's approved: `needs_a_place` is true for one that can't be approved until a place is free, and `full_message` says how to free one.",
        "responses": {
          "200": {
            "description": "The waiting requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinRequestList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/organizations/{slug}/join_requests/{id}/approve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "operationId": "approveOrganizationJoinRequest",
        "tags": [
          "Organizations"
        ],
        "summary": "Let someone who asked into the team (admins only)",
        "description": "They join as a member, with a team Kard in the name they gave, held by them, to fill in (someone who joined meanwhile keeps their role and Kards). It takes one of the team's places (`places.limit`): with none left it's `422 team_full`. They're emailed, and their phones notified. One another admin answered already is `422 already_decided`.",
        "responses": {
          "200": {
            "description": "Approved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinRequestApproved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/JoinDecisionRefused"
          }
        }
      }
    },
    "/organizations/{slug}/join_requests/{id}/decline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "operationId": "declineOrganizationJoinRequest",
        "tags": [
          "Organizations"
        ],
        "summary": "Say no to someone who asked to join (admins only)",
        "description": "They're emailed (no admin is named), and the team's join link can't bring them in again: only an invitation can. One another admin answered already is `422 already_decided`.",
        "responses": {
          "200": {
            "description": "Declined.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationJoinRequestDeclined"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/JoinDecisionRefused"
          }
        }
      }
    },
    "/organizations/{slug}/kards/{share_link}/holder": {
      "parameters": [
        {
          "$ref": "#/components/parameters/OrganizationSlug"
        },
        {
          "$ref": "#/components/parameters/ShareLink"
        }
      ],
      "patch": {
        "operationId": "setTeamKardHolder",
        "tags": [
          "Organizations"
        ],
        "summary": "Give a team Kard to a member, or keep it with the admins (admins only)",
        "description": "Whoever holds a team Kard can edit it; its admins manage them all. `member_id` (from GET /organizations/{slug}/members, someone who `can_hold_kards`) gives it to that person, who is emailed its link; `null` keeps it with the admins. Its link, QR code and contacts don't change. The organization's main Kard isn't given to anyone (404).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "holder"
                ],
                "properties": {
                  "holder": {
                    "type": "object",
                    "required": [
                      "member_id"
                    ],
                    "properties": {
                      "member_id": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The Kard and who holds it now; `changed` is false when it already was.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamKardHolderChanged"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/hooks": {
      "get": {
        "operationId": "listHooks",
        "tags": [
          "Hooks"
        ],
        "summary": "This account's REST hooks",
        "responses": {
          "200": {
            "description": "The hooks, oldest first, the events one can hear and the most an account can have.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hooks",
                    "events",
                    "max"
                  ],
                  "properties": {
                    "hooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Hook"
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "contact.created"
                        ]
                      }
                    },
                    "max": {
                      "type": "integer",
                      "description": "The most hooks an account can have (50)."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createHook",
        "tags": [
          "Hooks"
        ],
        "summary": "Subscribe an address to new contacts",
        "description": "Each new contact the account sees (on one kard, or on every kard it holds or runs the team of) is POSTed to `target_url` as the contact.created webhook event: the same body and headers (see `webhooks.contact`), signed with the hook's own secret, which this answer gives once (`secret`). Only with the account's API key, not an app's sign-in: generating a new key on https://ekard.app/account/ai deletes every hook. An answer of 410 Gone deletes the hook; deleting the kard, its team or the account does too, and so does the kard being handed to someone else (its holder's hooks on it). At most 50 per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hook"
                ],
                "properties": {
                  "hook": {
                    "type": "object",
                    "required": [
                      "target_url"
                    ],
                    "properties": {
                      "event": {
                        "type": "string",
                        "enum": [
                          "contact.created"
                        ],
                        "default": "contact.created"
                      },
                      "target_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "A public https address on the standard port, as a webhook's."
                      },
                      "kard": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "A share link of a kard whose contacts the account sees (it holds it, or it's an admin of its team). Null or left out: every kard whose contacts the account sees."
                      },
                      "organization": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "A team's slug: with `kard`, the team kard of that link; without, every kard of that team the account sees (all of them for an admin)."
                      }
                    }
                  }
                }
              },
              "example": {
                "hook": {
                  "event": "contact.created",
                  "target_url": "https://hooks.zapier.com/hooks/standard/123456/abcdef/",
                  "kard": "priya",
                  "organization": null
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscribed. `secret` signs every delivery to this hook; it's given here only, so keep it to check signatures.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hook",
                    "secret"
                  ],
                  "properties": {
                    "hook": {
                      "$ref": "#/components/schemas/Hook"
                    },
                    "secret": {
                      "type": "string",
                      "description": "The hook's signing secret (`whsec_` and base64), given once: check each delivery's `webhook-signature` with it, as a webhook's."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Made with an app's sign-in, not the account's API key (`forbidden`); or the account hasn't verified its email address (`email_unverified`, with `verify_url`, which emails the link).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such kard or team, or not one whose contacts this account sees (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "description": "The account already has 50 hooks (`rate_limited`); remove one first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/hooks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "delete": {
        "operationId": "deleteHook",
        "tags": [
          "Hooks"
        ],
        "summary": "Unsubscribe an address",
        "description": "204 whether it was there or not (Zapier may unsubscribe twice); another account's hook is left as it is.",
        "responses": {
          "204": {
            "description": "Gone."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/bookmarks": {
      "get": {
        "operationId": "listBookmarks",
        "tags": [
          "Bookmarks"
        ],
        "summary": "Kards this account saved, newest first",
        "description": "A kard hidden after a complaint comes as `unavailable: true`, with its share_link and public_url only (its page says why); restored, it's listed as before. A kard switched off for a while comes as `switched_off: true`, with its name and photo only, as its page shows it (since 1.9.14).",
        "responses": {
          "200": {
            "description": "The bookmarks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "bookmarks"
                  ],
                  "properties": {
                    "bookmarks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Bookmark"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createBookmark",
        "tags": [
          "Bookmarks"
        ],
        "summary": "Bookmark any public kard",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "share_link"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bookmarked (or already was).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "bookmark"
                  ],
                  "properties": {
                    "bookmark": {
                      "$ref": "#/components/schemas/Bookmark"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "description": "The kard is switched off for a while (`switched_off`, since 1.9.14): its page offers no bookmark until it's back on. Show the message as written.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "451": {
            "description": "The kard is hidden after a complaint, while it's looked into (`unavailable`): its public page says the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/bookmarks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "delete": {
        "operationId": "deleteBookmark",
        "tags": [
          "Bookmarks"
        ],
        "summary": "Remove a bookmark",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/bookings": {
      "get": {
        "operationId": "listAccountBookings",
        "tags": [
          "Bookings"
        ],
        "summary": "Bookings across every calendar the account manages, earliest first",
        "description": "The account's own calendar (behind its personal kards) and those of organizations it administers. Each booking carries its `calendar`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/BookingStatuses"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of bookings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/kards/{share_link}/offerings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listOfferings",
        "tags": [
          "Bookings"
        ],
        "summary": "What can be booked from a kard",
        "description": "A team kard linked to a person lists what that person does. The `kard` block says whether the kard shows a Book button.",
        "responses": {
          "200": {
            "description": "The kard's Book button, its calendar and the offerings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "kard",
                    "calendar",
                    "offerings"
                  ],
                  "properties": {
                    "kard": {
                      "$ref": "#/components/schemas/KardBooking"
                    },
                    "calendar": {
                      "$ref": "#/components/schemas/SchedulingCalendar"
                    },
                    "offerings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Offering"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NoCalendar"
          }
        }
      }
    },
    "/kards/{share_link}/availability": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getAvailability",
        "tags": [
          "Bookings"
        ],
        "summary": "Open times for a visit, by local date",
        "description": "One or more offerings, back to back with one person. `provider_ids` on each time lists who is free, in assignment order.",
        "parameters": [
          {
            "name": "offering_ids[]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "name": "date",
            "in": "query",
            "description": "The first local date (YYYY-MM-DD); today in the calendar's zone when omitted.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14,
              "default": 1
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "Who with. A team kard linked to a person defaults to them.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "One of the offering's duration options, in minutes.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "`online`: what a visitor can book. `front_desk`: what the business can, ignoring notice and the booking window.",
            "schema": {
              "type": "string",
              "enum": [
                "online",
                "front_desk"
              ],
              "default": "online"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open times.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendar",
                    "offerings",
                    "provider",
                    "mode",
                    "dates"
                  ],
                  "properties": {
                    "calendar": {
                      "$ref": "#/components/schemas/SchedulingCalendar"
                    },
                    "offerings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NamedRecord"
                      }
                    },
                    "provider": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/NamedRecord"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "online",
                        "front_desk"
                      ]
                    },
                    "dates": {
                      "type": "object",
                      "description": "Local dates (YYYY-MM-DD) to their open times. Today's start now: a visit that would be over already is left out, and of those under way only the latest is there (`starts_at` before now, for someone already at the desk: show it as started).",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Slot"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NoCalendar"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/kards/{share_link}/bookings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "listKardBookings",
        "tags": [
          "Bookings"
        ],
        "summary": "Bookings of the calendar behind a kard",
        "parameters": [
          {
            "$ref": "#/components/parameters/From"
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "$ref": "#/components/parameters/BookingStatuses"
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of bookings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NoCalendar"
          }
        }
      },
      "post": {
        "operationId": "createBooking",
        "tags": [
          "Bookings"
        ],
        "summary": "Book like the front desk",
        "description": "`source: \"api\"`: no notice or booking window, any active person. Send an `idempotency_key`: a retry with the same key returns the first booking instead of booking twice (keys are per API user).\n\nEvery booking emails its client and guests, so `client.email` and each guest must be one mailbox on a public domain, and a booking made here names at most 2 guests (else `422 invalid_recipient`, and nothing is booked or sent). Limits, counted together with the web's front desk: per account 5 new bookings a minute and 200 a day; per calendar 10 a minute and 300 a day (`429 rate_limited` with `Retry-After`).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "booking"
                ],
                "properties": {
                  "booking": {
                    "$ref": "#/components/schemas/BookingInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NoCalendar"
          },
          "409": {
            "$ref": "#/components/responses/SlotTaken"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/kards/{share_link}/bookings/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/ShareLink"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/Organization"
        }
      ],
      "get": {
        "operationId": "getBooking",
        "tags": [
          "Bookings"
        ],
        "summary": "One booking",
        "responses": {
          "200": {
            "description": "The booking.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateBooking",
        "tags": [
          "Bookings"
        ],
        "summary": "Move a booking, or change its status",
        "description": "Either a new time (`starts_at`, optionally `provider_id` and `overlap_allowed`; the client's manage link and reminders follow) or a new `status`, not both. Statuses: `arrived`, `completed`, `no_show` (after the start), `booked` (approve a request), `declined` and `cancelled` (both take an optional `reason`; cancelling here is the business's).\n\nLimits, counted together with the web's front desk: 30 changes a minute per account, and 5 an hour per booking (`429 rate_limited` with `Retry-After`).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "booking"
                ],
                "properties": {
                  "booking": {
                    "$ref": "#/components/schemas/BookingUpdate"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The booking as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/SlotTaken"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars": {
      "get": {
        "operationId": "listCalendars",
        "tags": [
          "Calendar"
        ],
        "summary": "The calendars this account works in, with its role on each",
        "description": "Any key. Its personal calendar, its organizations' calendars (as an admin), and those it signs in to as front desk or staff. `role` is `admin`, `front_desk` or `staff`, and `role_summary` says what that role can do. Everything inside one is under `/calendars/{calendar_id}/…`. An account that works in no calendar gets an empty list.\n",
        "responses": {
          "200": {
            "description": "The calendars.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendars"
                  ],
                  "properties": {
                    "calendars": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createCalendar",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Set a calendar up, with the setup wizard's choices",
        "description": "Any key, for its own calendar; an organization's (`organization`: its slug) for that organization's admins only. A member who isn't an admin gets `403`, naming the admins; anyone else gets `404`. The setup wizard's steps in one call, in its order and all or nothing: the kind of business (`preset`, with `time_zone`, `currency` and `country`), the team (organizations: team Kards, people by name, or yourself), `opening_hours`, and the menu (`offerings`: `\"starters\"`, the kind's starter menu, or your own rows; a row can start from a starter, `{\"starter\": 1, \"price_cents\": 120000}`). With a menu, online booking turns on unless `accepting_bookings` is false. Read the kinds and their starter menus from `GET /calendars/presets`.\n\nA step that can't be saved is `422 validation_failed`, with `details` keyed by step (`kind`, `team`, `opening_hours`, `offerings`), and nothing is set up. A calendar that already exists is `409 calendar_exists` (`details.calendar_id`); change it with `PATCH /calendars/{calendar_id}/settings`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "calendar"
                ],
                "properties": {
                  "calendar": {
                    "$ref": "#/components/schemas/CalendarSetupInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Set up. `setup` says which wizard steps there are, the last one done and what's next; `message` is the line to relay.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendar",
                    "setup",
                    "message"
                  ],
                  "properties": {
                    "calendar": {
                      "$ref": "#/components/schemas/Calendar"
                    },
                    "setup": {
                      "type": "object",
                      "required": [
                        "steps",
                        "finished",
                        "next"
                      ],
                      "properties": {
                        "steps": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "kind",
                              "team",
                              "hours",
                              "offerings",
                              "share"
                            ]
                          }
                        },
                        "finished": {
                          "type": "string",
                          "enum": [
                            "kind",
                            "team",
                            "hours",
                            "offerings"
                          ]
                        },
                        "next": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "kind",
                            "team",
                            "hours",
                            "offerings",
                            "share",
                            null
                          ]
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Bloom Salon is set up. Online booking is live. “Book appointment” shows on 2 Kards."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "This account or organization already has a calendar (`calendar_exists`; `details.calendar_id`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/presets": {
      "get": {
        "operationId": "listCalendarPresets",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The kinds of business a calendar can be, with their starter menus",
        "description": "Any key. Setup's first step, \"What kind of business?\": each kind's words (`labels`), what it switches on, its default booking rules and opening hours, and its starter menu priced in `currency` (the account's country's currency when omitted). A starter with `needs_price: true` has no price in that currency yet: ask the owner for one.\n",
        "parameters": [
          {
            "name": "currency",
            "in": "query",
            "description": "ISO 4217, such as INR, USD or GBP.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every kind of business.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "presets"
                  ],
                  "properties": {
                    "presets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarPresetDetail"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendars/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "The calendar's id, from GET /calendars.",
          "schema": {
            "type": "integer"
          }
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendar",
        "tags": [
          "Calendar"
        ],
        "summary": "One calendar, with its team, features and menu",
        "description": "Every role. `your_provider` is the person this login is on the team, if any. `offerings`, the menu the desk books from (front-desk-only ones included), is for the front desk and admins; it is null for staff. A calendar the key has no role on is a 404, like one that doesn't exist.\n",
        "responses": {
          "200": {
            "description": "The calendar.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendar"
                  ],
                  "properties": {
                    "calendar": {
                      "$ref": "#/components/schemas/Calendar"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/schedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarSchedule",
        "tags": [
          "Calendar"
        ],
        "summary": "The desk's day or week",
        "description": "Every role: \"what does my Tuesday look like?\". The day (the default) has each person's hours, leave, breaks and blocked time and their visits, who is free now, and the day's summary. `view=week` is Monday to Sunday around `date`: each day's status, blocks and every visit.\n\nA visit here is who, what, when and its state, with the client's alert note where this login sees the client's details (staff: their own visits). The client's other details are on `GET /calendars/{calendar_id}/bookings/{id}`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/CalendarDate"
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week"
              ],
              "default": "day"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "One person only.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The day, or the week.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendar",
                    "schedule"
                  ],
                  "properties": {
                    "calendar": {
                      "$ref": "#/components/schemas/SchedulingCalendar"
                    },
                    "schedule": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ScheduleDay"
                        },
                        {
                          "$ref": "#/components/schemas/ScheduleWeek"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/availability": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarAvailability",
        "tags": [
          "Calendar"
        ],
        "summary": "Free times for a visit, or for moving a booking",
        "description": "The front desk and admins (the web's new-booking and reschedule sheets). Send `offering_ids[]` (one or more offerings, back to back with one person: anyone who does them, unless `provider_id` names one), or `booking_id` for where that booking could move (its services and timing, its own time not counted, its person unless `provider_id` names another). Times come grouped by local date; `provider_ids` on each lists who is free, best first.\n\n`mode=front_desk` (the default here) is what the business may book, ignoring notice and the booking window; `mode=online` is what clients can book.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/OfferingIds"
          },
          {
            "name": "booking_id",
            "in": "query",
            "description": "A booking of this calendar, instead of `offering_ids[]`.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/CalendarDate"
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 14,
              "default": 1
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "One person.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "One of the first offering's duration options, in minutes.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Their usual person first, when anyone will do.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/AvailabilityMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Free times.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "calendar",
                    "offerings",
                    "provider",
                    "booking",
                    "mode",
                    "dates"
                  ],
                  "properties": {
                    "calendar": {
                      "$ref": "#/components/schemas/SchedulingCalendar"
                    },
                    "offerings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/NamedRecord"
                      }
                    },
                    "provider": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/NamedRecord"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "booking": {
                      "description": "The booking being moved, with `booking_id`.",
                      "oneOf": [
                        {
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "type": "integer"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "front_desk",
                        "online"
                      ]
                    },
                    "dates": {
                      "type": "object",
                      "description": "Local dates (YYYY-MM-DD) to their free times. Today's start now: a visit that would be over already is left out, and of those under way only the latest is there (`starts_at` before now, for someone already at the desk: show it as started).",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Slot"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/calendars/{calendar_id}/availability/explain": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "explainCalendarAvailability",
        "tags": [
          "Calendar"
        ],
        "summary": "Why a time isn't free, person by person",
        "description": "The front desk and admins. For the person `provider_id` names, or else each active person who does every offering: when the visit would end with them (`ends_at`), `free`, and the `reasons` in words (\"booked: Meera Iyer, Haircut\"), empty when the time is free for them. With `mode=online`, also why clients can't book it online (\"within the 2-hour minimum notice\").\n",
        "parameters": [
          {
            "name": "starts_at",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/OfferingIds"
          },
          {
            "name": "booking_id",
            "in": "query",
            "description": "A booking of this calendar, instead of `offering_ids[]`; its own time doesn't count.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "One person.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "duration",
            "in": "query",
            "description": "One of the first offering's duration options, in minutes.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/AvailabilityMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Each person, and why not.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "starts_at",
                    "local_starts_at",
                    "mode",
                    "people"
                  ],
                  "properties": {
                    "starts_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "local_starts_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "front_desk",
                        "online"
                      ]
                    },
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "provider",
                          "ends_at",
                          "free",
                          "reasons"
                        ],
                        "properties": {
                          "provider": {
                            "$ref": "#/components/schemas/NamedRecord"
                          },
                          "ends_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "When the visit would end with this person (UTC), free or not: their own length for the services asked (a 75-minute haircut with one person, 45 minutes with another), the `duration` picked, or the booking's own timing for its person."
                          },
                          "free": {
                            "type": "boolean"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "examples": [
                              [
                                "booked: Meera Iyer, Haircut"
                              ],
                              [
                                "within the 2-hour minimum notice"
                              ]
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarBookings",
        "tags": [
          "Calendar"
        ],
        "summary": "The calendar's bookings, earliest first",
        "description": "Every role: every login reads every visit, as on the web. Staff see the client's details (phone, email, alert note, notes, answers, guests, address) and the team note only on their own visits, null on the others', and `payment` and `advance` are null for them; `can` says what this login may do with each booking. A request whose hold ran out is released time and isn't listed. `status=requested` is the list of requests to approve: without `date`, `from` or `to`, it keeps a request whose advance was received even once its time has passed, since that one waits for an answer.\n",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "A comma-separated list of requested, booked, arrived, completed, cancelled, no_show, declined; or `all`.",
            "schema": {
              "type": "string",
              "default": "requested,booked"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "A local date (YYYY-MM-DD) in the calendar's zone, for that day's bookings; instead of `from` and `to`.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "ISO 8601; now when omitted, unless `to` or `date` is sent.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/To"
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "Bookings with this person.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "This client's bookings.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "A comma-separated list of online, front_desk, walk_in, api.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paid",
            "in": "query",
            "description": "Only visits marked paid (`true`), or only those not (`false`).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "`desc` for the latest first.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of bookings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskBookingPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Book like the front desk, or add a walk-in",
        "description": "The front desk and admins. Like the desk's new-booking sheet: no notice or booking window, any active person (or the one `provider_id` names); `overlap_allowed` with a `provider_id` books anyway over that person's time. Send an `idempotency_key`: a retry with the same key returns the first booking instead of booking twice (keys are per API user). The body is `{\"booking\": {...}}`.\n\nBooked from eKard's app it is the desk's own (`source: front_desk`, \"Booked at the desk by …\"), and the business isn't told it as news; with an AI key it is `api`, and the rest of the business hears.\n\n`source: \"walk_in\"` (only where the calendar's `features.walk_ins` is on) is someone in the shop now: it starts now unless `starts_at` says otherwise, is marked arrived when it starts now (one for a later time is `booked` until it's arrived), and without a client files under the desk's anonymous \"Walk-in\".\n\n`client` with a `phone` or `email` a client has books that client, as the desk does (their name kept, a blank detail of theirs filled). A client is kept only with a name: a new number or email with no `name` is `422 validation_failed`, `details.name` as before, and since 1.9.12 `message` in the web sheet's words (\"Add their name to keep 98490 98490, so you find them next time. Or start without their details: send no client, and the visit is filed under \\\"Walk-in\\\".\" for a walk-in), where it said \"Name can't be blank\". Nothing is booked and no client is made.\n\nEvery booking emails its client and guests, so `client.email` and each guest must be one mailbox on a public domain, and a booking made here names at most 2 guests (else `422 invalid_recipient`, and nothing is booked or sent). Limits, shared with `POST /kards/{share_link}/bookings` and the web's front desk: per account 5 new bookings a minute and 200 a day; per calendar 10 a minute and 300 a day (`429 rate_limited` with `Retry-After`).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "booking"
                ],
                "properties": {
                  "booking": {
                    "$ref": "#/components/schemas/CalendarBookingInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Booked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskBookingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/SlotTaken"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "One booking, as the desk's booking sheet shows it",
        "description": "Every role, with the client's last 3 earlier visits (`history`). Staff: the client's details, the team note and `history` only on their own visits (null on the others'), and no money.\n",
        "responses": {
          "200": {
            "description": "The booking.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskBookingEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarBookingNote",
        "tags": [
          "Calendar"
        ],
        "summary": "Change the team's note on a booking",
        "description": "Admins, the front desk, and staff on their own visits. Only `internal_notes` (the team's note; clients never see it; `\"\"` clears it): statuses, times and money have their own operations. Limit: 30 changes a minute per account (`429 rate_limited`).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "internal_notes"
                ],
                "properties": {
                  "internal_notes": {
                    "type": "string",
                    "examples": [
                      "Bring the round brush"
                    ]
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The booking as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskBookingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/arrive": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "markCalendarBookingArrived",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a visit arrived",
        "description": "Admins, the front desk, and staff on their own visits. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/complete": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "markCalendarBookingCompleted",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a visit completed",
        "description": "Admins, the front desk, and staff on their own visits. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/no_show": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "markCalendarBookingNoShow",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a no-show",
        "description": "Admins, the front desk, and staff on their own visits. Only once the visit has started. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/undo_status": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "undoCalendarBookingStatus",
        "tags": [
          "Calendar"
        ],
        "summary": "Undo arrived, completed or no-show",
        "description": "Admins, the front desk, and staff on their own visits. The web's Undo: puts an arrived, completed or no-show visit back to the status it had (`to`: `booked` or `arrived`). Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "to"
                ],
                "properties": {
                  "to": {
                    "type": "string",
                    "enum": [
                      "booked",
                      "arrived"
                    ]
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/approve": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "approveCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Approve a request",
        "description": "The front desk and admins. A request (`status: requested`) becomes booked, and the client is told. Limits: 30 changes a minute per account, and 5 an hour per booking, since each one emails the client.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/decline": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "declineCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Decline a request",
        "description": "The front desk and admins. The client is told, with your `reason` when you give one. Limits: 30 changes a minute per account, and 5 an hour per booking, since each one emails the client.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Optional; the client reads it."
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "cancelCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Cancel a booking, as the business",
        "description": "The front desk and admins. The `reason` is required (else `422 validation_failed`, with `details.reason`): the client's message and the team both read it. Limits: 30 changes a minute per account, and 5 an hour per booking, since each one emails the client.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "examples": [
                      "Stylist unwell"
                    ]
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/reschedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "rescheduleCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Move a booking to a new time or person",
        "description": "The front desk and admins. The client's manage link and reminders follow, and the client is told. `provider_id` moves it to another person (else it stays with its own); `overlap_allowed: true` moves it anyway over that person's time. Limits: 30 changes a minute per account, and 5 an hour per booking, since each one emails the client.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "starts_at"
                ],
                "properties": {
                  "starts_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "provider_id": {
                    "type": "integer"
                  },
                  "overlap_allowed": {
                    "type": "boolean",
                    "default": false
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/SlotTaken"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/resize": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "resizeCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Make a visit longer or shorter",
        "description": "The front desk and admins. The day grid's resize: `duration_minutes` is the whole visit's length from its start. The team's business: the client isn't messaged. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "duration_minutes"
                ],
                "properties": {
                  "duration_minutes": {
                    "type": "integer",
                    "minimum": 1,
                    "examples": [
                      75
                    ]
                  },
                  "overlap_allowed": {
                    "type": "boolean",
                    "default": false
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/SlotTaken"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{id}/confirm": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "confirmCalendarBooking",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a booking confirmed",
        "description": "The front desk and admins. The web's \"They confirmed they're coming\" on the booking's sheet (its button's words since 1.9.6; say it so, not \"Mark confirmed\"): the client confirmed some other way (a call, a message). Only for a visit still to come that is booked or requested (else `422 invalid_transition`); one already confirmed keeps its first time. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{booking_id}/payment": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/BookingId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "patch": {
        "operationId": "markCalendarBookingPaid",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a visit paid, or change what was recorded",
        "description": "The front desk and admins. Every field is optional, as on the web's booking sheet: the amount starts from what's due (the price less an advance received), the method from the last one used here, the time from now. Only a visit that has started can be marked paid. `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Minor units of the booking's currency."
                  },
                  "tip_cents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "`null` clears it."
                  },
                  "payment_method": {
                    "type": "string",
                    "enum": [
                      "cash",
                      "upi",
                      "card",
                      "other"
                    ]
                  },
                  "paid_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Not in the future. Default: now, or the visit's end for a visit on a day gone by (since 1.9.14), so that day's takings count it."
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "description": "Not saved (`validation_failed`); `details` has the sheet's message per field (`amount_cents`, `tip_cents`, `payment_method`, `paid_at`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "clearCalendarBookingPayment",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark a visit not paid after all",
        "description": "The front desk and admins. Forgets the amount, tip, method and time. Limit: 30 changes a minute per account.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/LockVersion"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{booking_id}/advance": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/BookingId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "patch": {
        "operationId": "markCalendarBookingAdvanceReceived",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark the client's advance received",
        "description": "The front desk and admins. The client is emailed. On a request, the time is then held until someone approves or declines it (its `request_expires_at` becomes null). `approve: true` approves a request in the same step. A booking with no advance, or one already marked received, is `422 invalid_transition`. `PUT` is the same. Limits: 30 changes a minute per account, and 5 an hour per booking, since each one emails the client.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "approve": {
                    "type": "boolean",
                    "default": false
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "undoCalendarBookingAdvance",
        "tags": [
          "Calendar"
        ],
        "summary": "Mark the advance not received after all",
        "description": "The front desk and admins. A request is held again from now, as if just made (a new `request_expires_at`). An advance not marked received is `422 invalid_transition`. Limit: 30 changes a minute per account.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/LockVersion"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{booking_id}/confirmation": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/BookingId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "resendCalendarBookingConfirmation",
        "tags": [
          "Calendar"
        ],
        "summary": "Send the client's confirmation again",
        "description": "The web's \"Send the confirmation again\", for after a client's mistyped email was put right (on the client, or the booking): the client's confirmation, to the email the booking has now. Nothing sends it by itself. The front desk and admins. The answer is the booking, with a `notice` to show (\"Sent Ananya the confirmation again, to ananya@gmail.com.\"). A visit that isn't booked or arrived, a walk-in, one that has ended, or one with no email is `422 invalid_transition`. A personal calendar whose owner hasn't verified their email address is `403 email_unverified` (with `verify_url` for the owner). Limits, counted with the web's: once in 10 minutes a booking (`429 rate_limited`, `Retry-After` the seconds left, its `message` when it went: \"It went to ananya@gmail.com at 3:05 PM. Give it a few minutes, and ask Ananya to look in their spam folder.\"), and 3 times a day a booking (`429 rate_limited`, `Retry-After` the seconds until the day's window ends, \"Not sent: it has gone to ananya@gmail.com 3 times since 3:05 PM, the most in a day. Call or message Ananya instead: …\"); 30 changes a minute per account, and 5 an hour per booking with its email changes; a new address counts on the day's booking emails, and past them nothing goes (`429 rate_limited`, \"Not sent. Ananya wasn't emailed at …\").\n",
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{booking_id}/email": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/BookingId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "patch": {
        "operationId": "changeCalendarBookingEmail",
        "tags": [
          "Calendar"
        ],
        "summary": "Change the email a booking's emails go to",
        "description": "The web booking sheet's \"Email for this appointment: … Change\" (since 1.9.12): the address this booking's confirmation, reminders and changes go to, where it was booked with its own typed address (`contact_email`) that fixing the client's record doesn't reach. The front desk and admins, on a visit the sheet offers it on: still to come, `requested`, `booked` or `arrived`, not a walk-in (anything else `422 invalid_transition`). As on the web, the booking gets a new private link: the one sent before, by email or on WhatsApp, stops working. The client's record follows when it held the same address, and with it their other bookings to come (each a new private link) and their waitlist places; one it can't take stays as it was, and the `notice` says why. Nothing is emailed by the change: for a `booked` visit the `notice` ends \"Send the confirmation again so they have the new link.\" (`POST …/confirmation`). The answer is the booking, with the web's words as its `notice`: \"Saved: Ananya's reminders go to ananya@gmail.com now, with a new private link to the appointment. The link sent before, to ananya@gmial.com or on WhatsApp, stops working.\" The same address again is a `200` that changes nothing (\"Nothing changed: Ananya's appointment already goes to ananya@gmail.com.\"). Refused: not an email address (`422 validation_failed`, \"Not saved: “ananya.gmail.com” isn't an email address. Type it as name@example.com.\", `details.email`), a personal calendar whose owner hasn't verified their email address (`403 email_unverified`, with `verify_url` for the owner), a booking changed since `lock_version` (`409 stale_booking`). `PUT` is the same. Limits: 30 changes a minute per account, and 5 changes an hour per booking, the front desk's and the API's together (`429 rate_limited`).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "examples": [
                      "ananya@gmail.com"
                    ]
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/bookings/{booking_id}/advance-outcome": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/BookingId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "patch": {
        "operationId": "setCalendarBookingAdvanceOutcome",
        "tags": [
          "Calendar"
        ],
        "summary": "Say whether a cancelled visit's advance was refunded or kept",
        "description": "The front desk and admins. Cancelling refunds nothing by itself: once a visit with a received advance is cancelled or declined, record `outcome: \"refunded\"` or `\"kept\"`, and the client's booking page says so (refunded advances leave takings). Any other visit is `422 invalid_transition`; an `outcome` that isn't one of the two is `400 invalid_parameter`. `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "outcome"
                ],
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "refunded",
                      "kept"
                    ]
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "clearCalendarBookingAdvanceOutcome",
        "tags": [
          "Calendar"
        ],
        "summary": "Forget whether the advance was refunded or kept",
        "description": "The front desk and admins. Back to not said: the client's page says to ask about it again. Limit: 30 changes a minute per account.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/LockVersion"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CalendarBooking"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/series": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarSeries",
        "tags": [
          "Calendar"
        ],
        "summary": "Repeating bookings, the latest first",
        "description": "The front desk and admins. A series is one client's regular visit (\"every week, 6 times\"), booked at the desk or here; each visit is a booking of its own (`GET .../bookings/{id}`). By default only series with a visit still to come; `status=all` lists every one.\n",
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "description": "This client's series.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "`active` (a visit still to come) or `all`.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "all"
              ],
              "default": "active"
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of series, each with its visits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarSeriesPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarSeries",
        "tags": [
          "Calendar"
        ],
        "summary": "Book a repeating booking (or see each date's status first)",
        "description": "The front desk and admins. Like the new-booking sheet's Repeat: every `every_weeks` (1, 2 or 4) from `starts_at`, `count` times or `until` a date, a year at most either way (`count` up to 52 every week, 27 every 2 weeks, 14 every 4 weeks), on the calendar's wall clock (a 4:30 PM visit stays 4:30 PM across a daylight-saving change). The desk's rules, as `POST .../bookings`: no notice, booking window or daily caps. One person for every date: `provider_id`, else whoever is first free at the first date.\n\n`dry_run: true` books nothing and returns each date with its status: `free` (and who takes it), `taken` (the `reasons`, and up to 3 `alternatives`, one per person, the same day first, else within 3 days), or `skipped` (a `picks` entry left it out). Booking then skips taken dates unless `picks` gives them another time (`{ index, starts_at, provider_id }`) or leaves them out (`{ index, skip: true }`); `if_taken: \"refuse\"` books nothing when a date is taken (`409 series_taken`, with `details.dates`). A date free a moment ago and taken since is reported in `failed`, and the rest are booked.\n\nEach visit is a normal booking (reminders, status, payment, its own manage link) linked by the series. The client and guests get one email listing every date with one calendar file holding them all, and the business one for the series, never one per visit. Send an `idempotency_key`: a retry with the same key returns the same series and visits, and books any date a first attempt didn't reach. Limits, shared with the web's front desk: a series counts once on the per-minute limits (5 per account, 10 per calendar) and once per date on the per-day ones (200 per account, 300 per calendar); a dry run counts as one of 30 changes a minute.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "series"
                ],
                "properties": {
                  "series": {
                    "$ref": "#/components/schemas/CalendarSeriesInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The dry run's dates (nothing was booked).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dry_run",
                    "series"
                  ],
                  "properties": {
                    "dry_run": {
                      "type": "boolean",
                      "const": true
                    },
                    "series": {
                      "$ref": "#/components/schemas/SeriesPlan"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Booked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "series"
                  ],
                  "properties": {
                    "series": {
                      "$ref": "#/components/schemas/CalendarSeries"
                    },
                    "skipped": {
                      "type": "array",
                      "description": "Dates not booked because they were taken (with free times), or left out.",
                      "items": {
                        "$ref": "#/components/schemas/SeriesDate"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "description": "Dates free when checked and taken a moment later.",
                      "items": {
                        "$ref": "#/components/schemas/SeriesFailure"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "description": "`series_taken` (if_taken refuse: `details.dates`), or `slot_taken` (no date is free).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_series` (how often, how many or until when), `invalid_recipient`, `idempotency_conflict`, or another of the engine's refusals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/series/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarSeries",
        "tags": [
          "Calendar"
        ],
        "summary": "One repeating booking, with every visit",
        "description": "The front desk and admins.\n",
        "responses": {
          "200": {
            "description": "The series.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarSeriesEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/series/{id}/reschedule": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "rescheduleCalendarSeries",
        "tags": [
          "Calendar"
        ],
        "summary": "Move a visit, or it and every later one",
        "description": "The front desk and admins. `booking_id` is a visit of the series; `starts_at` its new time. `scope: \"one\"` moves it alone, as `POST .../bookings/{id}/reschedule` (`overlap_allowed` books it over someone's time). `scope: \"following\"` (the default) moves it and every later visit still to come by the same amount on the calendar's clock (Tuesday 4:30 PM to Wednesday 5:00 PM takes each later one to the Wednesday after its own Tuesday, at 5:00 PM); `provider_id` moves them all to that person.\n\n`dry_run: true` returns each move (`from`, `to`, `status` free, taken with `reasons` and `alternatives`, or kept). A visit whose new time is taken stays where it is unless `picks` gives it another (`{ booking_id, starts_at, provider_id }`) or keeps it on purpose (`{ booking_id, keep: true }`); `if_taken: \"refuse\"` moves nothing then (`409 series_taken`). A visit changed or taken a moment ago is reported in `failed`, and the rest move. The client gets one email with every new time. Limits: 30 changes a minute per account, and 5 an hour per series (scope one: per booking).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "booking_id",
                  "starts_at"
                ],
                "properties": {
                  "booking_id": {
                    "type": "integer"
                  },
                  "starts_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "provider_id": {
                    "type": "integer"
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "one",
                      "following"
                    ],
                    "default": "following"
                  },
                  "dry_run": {
                    "type": "boolean",
                    "default": false
                  },
                  "if_taken": {
                    "type": "string",
                    "enum": [
                      "keep",
                      "refuse"
                    ],
                    "default": "keep"
                  },
                  "overlap_allowed": {
                    "type": "boolean",
                    "default": false,
                    "description": "scope one only."
                  },
                  "picks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "booking_id"
                      ],
                      "properties": {
                        "booking_id": {
                          "type": "integer"
                        },
                        "starts_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "provider_id": {
                          "type": "integer"
                        },
                        "keep": {
                          "type": "boolean"
                        }
                      }
                    }
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The moves (a dry run), or the series as it is now with what moved, what stayed and what failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dry_run": {
                      "type": "boolean"
                    },
                    "moves": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SeriesMove"
                      }
                    },
                    "series": {
                      "$ref": "#/components/schemas/CalendarSeries"
                    },
                    "moved": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    },
                    "kept": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SeriesFailure"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "description": "`series_taken` (if_taken refuse), `slot_taken` or `stale_booking` (scope one).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/series/{id}/cancel": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "cancelCalendarSeries",
        "tags": [
          "Calendar"
        ],
        "summary": "Cancel a visit, or it and every later one, as the business",
        "description": "The front desk and admins. `booking_id` is a visit of the series; `scope: \"one\"` cancels it alone (as `POST .../bookings/{id}/cancel`), `scope: \"following\"` (the default) it and every later visit still to come. The `reason` is required (else `422 validation_failed`): the client's message and the team both read it. The client gets one email listing what's cancelled. Limits: 30 changes a minute per account, and 5 an hour per series (scope one: per booking).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "booking_id",
                  "reason"
                ],
                "properties": {
                  "booking_id": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string",
                    "examples": [
                      "Moving to another city"
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "one",
                      "following"
                    ],
                    "default": "following"
                  },
                  "lock_version": {
                    "$ref": "#/components/schemas/LockVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The series as it is now, what was cancelled and what failed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "series",
                    "cancelled"
                  ],
                  "properties": {
                    "series": {
                      "$ref": "#/components/schemas/CalendarSeries"
                    },
                    "cancelled": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SeriesFailure"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/StaleBooking"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/clients": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarClients",
        "tags": [
          "Calendar"
        ],
        "summary": "The calendar's clients, or a search",
        "description": "The front desk and admins. `q` searches part of a name or email, or any 3+ digits of a phone number (best matches first); without it, `sort` orders the list. Each client comes with their counts, next booking and usual service. Notes and alert notes can hold health details: keep them to what the owner asked for. The record every walk-in who gives no name is filed under (`nameless_walk_ins`) isn't a client: the list, its search and the export leave it out.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientQuery"
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Without `q`.",
            "schema": {
              "type": "string",
              "enum": [
                "recent",
                "name",
                "no_shows"
              ],
              "default": "recent"
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of clients.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "clients",
                    "pagination"
                  ],
                  "properties": {
                    "clients": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ClientSummary"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarClient",
        "tags": [
          "Calendar"
        ],
        "summary": "Add a client",
        "description": "The front desk and admins. Only `name` is required; a phone number another client of this calendar has is a `422`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client"
                ],
                "properties": {
                  "client": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ClientInput"
                      },
                      {
                        "required": [
                          "name"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The client its idempotency_key made before.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/clients.csv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "exportCalendarClients",
        "tags": [
          "Calendar"
        ],
        "summary": "The clients as a CSV file",
        "description": "Admins only, as on the web (the whole client base in one file). Everyone, or the `q` search; notes and alert notes only with `include_notes=1`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientQuery"
          },
          {
            "name": "include_notes",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every client, or every match.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/clients/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarClient",
        "tags": [
          "Calendar"
        ],
        "summary": "One client, as the client's page shows them",
        "description": "The front desk and admins. Notes, visits, what they paid, upcoming bookings, history (the latest 10; `history=all` for every one) and possible duplicates.",
        "parameters": [
          {
            "name": "history",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarClient",
        "tags": [
          "Calendar"
        ],
        "summary": "Change a client",
        "description": "The front desk and admins. Partial: omitted fields keep their value. `blocked: true` stops them booking online (the desk still can); `alert_note` shows on every booking of theirs. The walk-ins' shared record (`nameless_walk_ins: true`) takes no changes: `422 nameless_walk_ins`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client"
                ],
                "properties": {
                  "client": {
                    "$ref": "#/components/schemas/ClientInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The client as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/clients/{client_id}/merge": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ClientId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "mergeCalendarClient",
        "tags": [
          "Calendar"
        ],
        "summary": "Merge a possible duplicate onto the older record",
        "description": "The front desk and admins. A client marked `possible_duplicate_of` another (a public booking whose details clashed with an existing client's) is merged onto the older record: bookings, notes, alert note, a missing phone or email. The answer is the kept client, and `merged`: the record that went and what moved. A client not marked as a possible duplicate is `422 not_a_possible_duplicate`; a merged field that would be too long is `422 validation_failed`, and nothing is merged. Limit: 30 changes a minute per account.\n",
        "responses": {
          "200": {
            "description": "Merged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "client",
                    "merged"
                  ],
                  "properties": {
                    "client": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "merged": {
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "moved"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "moved": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "examples": [
                            [
                              "2 appointments (Mon 7 Jan, Haircut; Thu 10 Jan, Blow-dry)",
                              "the notes"
                            ]
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "unlinkCalendarClientDuplicate",
        "tags": [
          "Calendar"
        ],
        "summary": "Unlink a possible duplicate (not the same person)",
        "description": "The front desk and admins. The possible-duplicate link goes; both records stay. Limit: 30 changes a minute per account.\n",
        "responses": {
          "200": {
            "description": "Unlinked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "client",
                    "unlinked"
                  ],
                  "properties": {
                    "client": {
                      "$ref": "#/components/schemas/Client"
                    },
                    "unlinked": {
                      "description": "The client it was linked to, or null when it wasn't.",
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/NamedRecord"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/takings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarTakings",
        "tags": [
          "Calendar"
        ],
        "summary": "What was marked paid over a range of days",
        "description": "Admins only, as on the web. Today by default; `range=week` (Monday to Sunday) or `range=month` for this week or month, or `from` and `to` (local dates, up to 366 days). By day, person and method (advances count as `advance` on the day they arrived), and `unpaid`: finished visits nobody marked paid (`count`, and the 50 most recent).\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/TakingsRange"
          },
          {
            "$ref": "#/components/parameters/TakingsFrom"
          },
          {
            "$ref": "#/components/parameters/TakingsTo"
          }
        ],
        "responses": {
          "200": {
            "description": "The takings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "takings"
                  ],
                  "properties": {
                    "takings": {
                      "$ref": "#/components/schemas/Takings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/takings.csv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "exportCalendarTakings",
        "tags": [
          "Calendar"
        ],
        "summary": "The paid visits as a CSV file",
        "description": "Admins only. The same range as `GET /calendars/{calendar_id}/takings`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/TakingsRange"
          },
          {
            "$ref": "#/components/parameters/TakingsFrom"
          },
          {
            "$ref": "#/components/parameters/TakingsTo"
          }
        ],
        "responses": {
          "200": {
            "description": "One row per paid visit.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/insights": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarInsights",
        "tags": [
          "Calendar"
        ],
        "summary": "How full each person is, no-shows, clients, sources and services over a range of days",
        "description": "Admins only, as on the web (Calendar → Insights). This month by default; `range=week` (Monday to Sunday) or `range=month` around `date` (today by default), or `from` and `to` (local dates, up to 366 days). Visits count on their local date in the calendar's `time_zone`; money on the day it was taken, as in takings (it is the takings' own figures).\n\nEvery panel carries a `sentence` that says what its numbers mean, in the calendar's own words: read it to the owner as it is. Booked time is the time bookings hold (prep and cleanup in, processing time free, no-shows in) over working time (hours or special hours, less time off, breaks, blocked time and closures); a range that has begun splits at now into `so_far` and `ahead`. The bookings behind any number: `GET /calendars/{calendar_id}/insights/bookings` with the same dates.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/InsightsRange"
          },
          {
            "$ref": "#/components/parameters/InsightsDate"
          },
          {
            "$ref": "#/components/parameters/InsightsFrom"
          },
          {
            "$ref": "#/components/parameters/InsightsTo"
          }
        ],
        "responses": {
          "200": {
            "description": "The insights.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "insights"
                  ],
                  "properties": {
                    "insights": {
                      "$ref": "#/components/schemas/Insights"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/insights.csv": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "exportCalendarInsights",
        "tags": [
          "Calendar"
        ],
        "summary": "Every insights panel as a table in one CSV file",
        "description": "Admins only. The same dates as `GET /calendars/{calendar_id}/insights`. Counts, hours and money only; no client names.",
        "parameters": [
          {
            "$ref": "#/components/parameters/InsightsRange"
          },
          {
            "$ref": "#/components/parameters/InsightsDate"
          },
          {
            "$ref": "#/components/parameters/InsightsFrom"
          },
          {
            "$ref": "#/components/parameters/InsightsTo"
          }
        ],
        "responses": {
          "200": {
            "description": "A titled table per panel, a blank row between them.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/insights/bookings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarInsightBookings",
        "tags": [
          "Calendar"
        ],
        "summary": "The bookings behind an insights number",
        "description": "Admins only. The visits for the same dates as `GET /calendars/{calendar_id}/insights`, earliest first, narrowed like the number they stand behind. A filter value that isn't one is `400 invalid_parameter`; a `provider_id` or `offering_id` of another calendar is `404`.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/InsightsRange"
          },
          {
            "$ref": "#/components/parameters/InsightsDate"
          },
          {
            "$ref": "#/components/parameters/InsightsFrom"
          },
          {
            "$ref": "#/components/parameters/InsightsTo"
          },
          {
            "name": "status",
            "in": "query",
            "description": "`kept` (the default: everything booked but cancellations and declined requests), `no_show` or `cancelled`.",
            "schema": {
              "type": "string",
              "enum": [
                "kept",
                "no_show",
                "cancelled"
              ]
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "Visits this person works.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offering_id",
            "in": "query",
            "description": "Visits with this service.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "online",
                "front_desk",
                "walk_in",
                "api"
              ]
            }
          },
          {
            "name": "via",
            "in": "query",
            "description": "Online bookings made on a Kard's booking page (`kard`), through a single-use booking link (`link`) or on the business's website (`embed`).",
            "schema": {
              "type": "string",
              "enum": [
                "kard",
                "link",
                "embed"
              ]
            }
          },
          {
            "name": "kard_id",
            "in": "query",
            "description": "Online bookings through this Kard (not its booking links); `none` for those from Kards deleted since.",
            "schema": {
              "oneOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "string",
                  "enum": [
                    "none"
                  ]
                }
              ]
            }
          },
          {
            "name": "channel",
            "in": "query",
            "description": "How a booking the business made came in; `none` when nobody said.",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "whatsapp",
                "instagram",
                "in_person",
                "other",
                "none"
              ]
            }
          },
          {
            "name": "clients",
            "in": "query",
            "description": "The bookings of new clients (no visit before these dates) or returning ones; no-shows aside.",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "returning"
              ]
            }
          },
          {
            "name": "ahead",
            "in": "query",
            "description": "A `booked_ahead` bucket.",
            "schema": {
              "type": "string",
              "enum": [
                "same_day",
                "day_before",
                "days",
                "week",
                "weeks",
                "month"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of bookings, with the list's title.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/DeskBookingPage"
                    },
                    {
                      "type": "object",
                      "required": [
                        "from",
                        "to",
                        "title"
                      ],
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date"
                        },
                        "to": {
                          "type": "string",
                          "format": "date"
                        },
                        "title": {
                          "type": "string",
                          "examples": [
                            "No-shows · Priya Sharma"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/settings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarSettings",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The calendar's settings",
        "description": "Admins only. The web's Settings page: the live switch, when clients can book, what they're asked for, cancelling, reminders, the morning summary, the business's details and opening hours, and the private feed of every booking (`feed_url`: anyone with it sees the bookings).\n",
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "settings"
                  ],
                  "properties": {
                    "settings": {
                      "$ref": "#/components/schemas/CalendarSettings"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarSettings",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Change the calendar's settings",
        "description": "Admins only. Send what changes; the rest stays. `opening_hours` changes the days named and keeps the others (a personal calendar's hours are its person's: `PUT …/providers/{provider_id}/hours`, else `422 invalid_parameter`). A key that isn't a setting is `400 invalid_parameter`; a value that doesn't save is `422 validation_failed` with `details` per setting. `message` says what people will notice (online booking paused or live and on how many Kards, a new kind of business, prices kept in a new currency). `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "settings"
                ],
                "properties": {
                  "settings": {
                    "$ref": "#/components/schemas/CalendarSettingsInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "settings"
                  ],
                  "properties": {
                    "settings": {
                      "$ref": "#/components/schemas/CalendarSettings"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "examples": [
                        "Online booking paused. Book is hidden on 4 Kards. Existing appointments stay. Your booking page asks people to call or message you instead."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/share_kit": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarShareKit",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Everything for sharing the booking page",
        "description": "Admins only. Setup's share step: the booking link, the Kards showing Book, links that book one person, a WhatsApp message, the QR code to print, snippets for a website, and the latest 20 single-use links. `booking_url` and the rest are null until the calendar has a Kard to book from.\n",
        "responses": {
          "200": {
            "description": "The share kit.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "share_kit"
                  ],
                  "properties": {
                    "share_kit": {
                      "$ref": "#/components/schemas/ShareKit"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/feed_link": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "renewCalendarFeedLink",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A new private feed link for the whole calendar",
        "description": "Admins only. For a link that leaked: the old one stops at once, and calendars subscribed to it stop updating until they subscribe again with the new `feed_url`. Limit: 30 changes a minute per account.\n",
        "responses": {
          "201": {
            "description": "The new link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedLink"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/booking_links": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarBookingLinks",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Single-use booking links, newest first",
        "description": "Admins only. Private links that book one offering (or anything on the menu), optionally with one person, a set number of times, until a date.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "booking_links",
                    "pagination"
                  ],
                  "properties": {
                    "booking_links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BookingLink"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarBookingLink",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Make a single-use booking link",
        "description": "Admins only. Everything is optional: without `offering_id` it books anything on the menu, without `provider_id` anyone, `max_uses` defaults to 1, and without `expires_in_days` it doesn't expire. An offering or person that isn't active on this calendar, or a number out of range, is `422 validation_failed`. Send the `url` to the client. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "booking_link": {
                    "$ref": "#/components/schemas/BookingLinkInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Made.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "booking_link"
                  ],
                  "properties": {
                    "booking_link": {
                      "$ref": "#/components/schemas/BookingLink"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/booking_links/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "deleteCalendarBookingLink",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Delete a single-use booking link",
        "description": "Admins only. It stops booking at once. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/blocks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarBlocks",
        "tags": [
          "Calendar"
        ],
        "summary": "Blocked time and closures over a range of days",
        "description": "Every role (the day and week show them). Breaks, blocked time and time off for one person, and closures of the whole business, overlapping the local dates `from` to `to` (up to 92 days; today and the next 30 when omitted).\n",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "The first local date (YYYY-MM-DD); today when omitted.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The last local date; 30 days after `from` when omitted.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "What affects this person (their own blocks and the closures).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "A comma-separated list of break, time_off, blocked, closed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The blocks, in time order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "blocks"
                  ],
                  "properties": {
                    "from": {
                      "type": "string",
                      "format": "date"
                    },
                    "to": {
                      "type": "string",
                      "format": "date"
                    },
                    "blocks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarBlock"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarBlock",
        "tags": [
          "Calendar"
        ],
        "summary": "Block time for one person, or close the whole business",
        "description": "The front desk and admins (the day view's \"Block time\"). With a `provider_id`: a break, blocked time or time off for that person; without one (or `\"all\"`): the whole business closed. Say when as the desk's sheet does (a local `date` and `time`, then `duration` in minutes or `\"rest\"` of the day, or `until` a time; today, the next quarter hour and an hour when omitted), or with two instants, `starts_at` and `ends_at`. Clients can't book it online; the desk can still book over it, and visits already inside it stay booked: `still_booked` names them, and `message` says what to do. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "block"
                ],
                "properties": {
                  "block": {
                    "$ref": "#/components/schemas/CalendarBlockInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The block its idempotency_key made before, said again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "block",
                    "still_booked",
                    "message"
                  ],
                  "properties": {
                    "block": {
                      "$ref": "#/components/schemas/CalendarBlock"
                    },
                    "still_booked": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VisitWithClient"
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Blocked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "block",
                    "still_booked",
                    "message"
                  ],
                  "properties": {
                    "block": {
                      "$ref": "#/components/schemas/CalendarBlock"
                    },
                    "still_booked": {
                      "type": "array",
                      "description": "Visits already inside it, still booked.",
                      "items": {
                        "$ref": "#/components/schemas/VisitWithClient"
                      }
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Blocked Priya today, 3:00 – 4:00 PM (Training). Clients can't book that time online. Ananya at 3:00 PM is still booked: move it if needed."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/blocks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "deleteCalendarBlock",
        "tags": [
          "Calendar"
        ],
        "summary": "Remove blocked time or a closure",
        "description": "The front desk and admins. That time is bookable online again. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/waitlist": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarWaitlist",
        "tags": [
          "Calendar"
        ],
        "summary": "Who waits for a time, or who a free time suits",
        "description": "The front desk and admins, while the calendar's waitlist is on (`422` `waitlist_off` otherwise). People who found no time that suit them, the days and parts of the day they'd take, and what they were offered (each offer's `state`, as the desk shows it), in the order they joined: live entries (`status=all`: the ones that ended too), one day's with `date`, one client's with `client_id`; `offers_to_send` counts the offers on `date` (every date without one) the business still has to send on WhatsApp. With `time` and `provider_id` too (\"Offer this time\" on a free gap): the live entries on that day, for that person or anyone, that want that time and could book it online then. When time frees up, the calendar offers it by itself: by email to the first five an email reaches, and to up to five more who gave only a phone number as offers for the business to send on WhatsApp (`to_send`); the first to confirm books it.\n",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "A local date (YYYY-MM-DD); with `time`, today when omitted.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "time",
            "in": "query",
            "description": "A local time on `date`, like \"16:00\", with `provider_id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "description": "The person whose free time it is (with `time`).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "`all` adds the entries that ended (booked, removed, expired).",
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          }
        ],
        "responses": {
          "200": {
            "description": "The entries, in the order they joined (a free time's answer also names `starts_at` and the `provider`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "waitlist"
                  ],
                  "properties": {
                    "waitlist": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WaitlistEntry"
                      }
                    },
                    "offers_to_send": {
                      "type": "integer",
                      "description": "Offers on `date` (every date without one) still to send on WhatsApp, for people no email reaches. Not in a free time's answer."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "starts_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "local_starts_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "provider": {
                      "$ref": "#/components/schemas/NamedRecord"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "post": {
        "operationId": "createCalendarWaitlistEntry",
        "tags": [
          "Calendar"
        ],
        "summary": "Add someone to the waitlist",
        "description": "The front desk and admins (a client's record: \"Waitlist\"). An existing client by `client_id`, or `client` with a name and a phone or an email (matched by phone, then email, like the desk's bookings; the email must be one booking emails can go to). Up to 14 local `dates`; `day_parts` from `morning` (before 12:00), `afternoon` (12:00–17:00), `evening` (after 17:00), any time when omitted; without `provider_id`, anyone who does it. It reaches the client record's phone and email. The walk-ins' shared record (`nameless_walk_ins`) can't join (`422`). Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entry"
                ],
                "properties": {
                  "entry": {
                    "$ref": "#/components/schemas/WaitlistEntryInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entry"
                  ],
                  "properties": {
                    "entry": {
                      "$ref": "#/components/schemas/WaitlistEntry"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/waitlist/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarWaitlistEntry",
        "tags": [
          "Calendar"
        ],
        "summary": "One entry, with the free times that suit it",
        "description": "The front desk and admins. The entry, its offers, and `free_times`: for each of its next days (up to four; or `date`), the times it could book online in its parts of the day, with whom.",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "One local date's free times.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entry.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entry"
                  ],
                  "properties": {
                    "entry": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/WaitlistEntry"
                        },
                        {
                          "type": "object",
                          "required": [
                            "free_times"
                          ],
                          "properties": {
                            "free_times": {
                              "type": "object",
                              "description": "Local date (YYYY-MM-DD) to its free times.",
                              "additionalProperties": {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/WaitlistFreeTime"
                                }
                              }
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      },
      "delete": {
        "operationId": "deleteCalendarWaitlistEntry",
        "tags": [
          "Calendar"
        ],
        "summary": "Take someone off the waitlist",
        "description": "The front desk and admins. No more offers reach them. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "description": "Removed; `message` says so.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entry",
                    "message"
                  ],
                  "properties": {
                    "entry": {
                      "$ref": "#/components/schemas/WaitlistEntry"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Took Tara off the waitlist for Haircut."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/waitlist/{id}/offers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "offerCalendarWaitlistTime",
        "tags": [
          "Calendar"
        ],
        "summary": "Offer someone waiting a free time",
        "description": "The front desk and admins. A time they could book online then, with `provider_id` (needed when they wait for anyone); else `422` `time_not_open` with the reason. `send: email` (the default) emails them the link; `whatsapp` is the desk's WhatsApp button: open `whatsapp_url` on your phone and press send, and the offer counts as sent (`400` without a mobile number); `none` only makes the offer. An offer in `state` `to_send` is sent the same way, with its `starts_at` and `provider_id`. The link opens that time on the booking page, their details filled in; the time isn't held, and the first to confirm books it. The same time offered again is the same offer. Limits: 30 changes a minute, and 10 offer emails a minute and 200 a day, per account, with the front desk's.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offer"
                ],
                "properties": {
                  "offer": {
                    "type": "object",
                    "required": [
                      "starts_at"
                    ],
                    "properties": {
                      "starts_at": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "provider_id": {
                        "type": "integer"
                      },
                      "send": {
                        "type": "string",
                        "enum": [
                          "email",
                          "whatsapp",
                          "none"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Offered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offer",
                    "emailed",
                    "message"
                  ],
                  "properties": {
                    "offer": {
                      "$ref": "#/components/schemas/WaitlistOffer"
                    },
                    "emailed": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Emailed Tara the link for Thu 10 Jan, 4:00 PM. The first to confirm gets it."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/offerings": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarOfferings",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The menu, in order",
        "description": "Admins only. Everything clients book (Services, Meeting types, Treatments … as `labels.offerings` says), switched-off ones too, in menu order, with who performs each at what price and length.",
        "responses": {
          "200": {
            "description": "The menu.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "offerings"
                  ],
                  "properties": {
                    "offerings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MenuOffering"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarOffering",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add something to the menu",
        "description": "Admins only, with the web form's rules and words. `name` and `duration_minutes` (steps of 5, up to 12 hours) are needed, and `fixed` and `from` prices need `price_cents`. Without `providers`, everyone on the team performs it. Problems are `422 validation_failed`, with `details` per field (a provider not on this calendar's team is one). Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offering"
                ],
                "properties": {
                  "offering": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/OfferingInput"
                      },
                      {
                        "required": [
                          "name",
                          "duration_minutes"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuOfferingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/offerings/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarOffering",
        "tags": [
          "Calendar setup"
        ],
        "summary": "One offering, with its bookings so far",
        "description": "Admins only. As the web's form shows it, plus `upcoming_bookings`, `recent_bookings` (the last 90 days) and `has_bookings` (then it can be switched off, but not deleted).",
        "responses": {
          "200": {
            "description": "The offering.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuOfferingEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarOffering",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Change an offering, or switch it off or on",
        "description": "Admins only. Keys you leave out keep their value; `null` clears one. `questions` and `providers` replace the whole list. `\"active\": false` switches it off: it leaves the booking page and its bookings stay; `true` switches it back on, and the answer carries a `message` to relay. `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "offering"
                ],
                "properties": {
                  "offering": {
                    "$ref": "#/components/schemas/OfferingInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The offering as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuOfferingEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteCalendarOffering",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Delete an offering that was never booked",
        "description": "Admins only. One with bookings is `422 has_bookings`: it stays in the history, so switch it off instead (`\"active\": false`). Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/offerings/{id}/move": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "moveCalendarOffering",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Move an offering up or down within its category",
        "description": "Admins only. Swaps it with its neighbour in the same category. `moved` is false when it's already at that end. Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The whole menu in its new order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "moved",
                    "offerings"
                  ],
                  "properties": {
                    "moved": {
                      "type": "boolean"
                    },
                    "offerings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MenuOffering"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/menu_imports": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarMenuImports",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Price-list imports, and whether one can start now",
        "description": "Admins only. A printed price list (a photo, a PDF, a link to one, or its text) is read in the background into draft rows, which you check and then confirm; nothing joins the menu before that. Up to 10 imports a day per calendar (the web's count too). This says whether one can start now (`can_start`, and `refusal` in words when not), the one being read (`running`), one read and waiting for review, and the last 10.\n",
        "responses": {
          "200": {
            "description": "Where imports stand.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "daily_limit",
                    "imports_left_today",
                    "reading_paused",
                    "can_start",
                    "refusal",
                    "running",
                    "waiting_for_review",
                    "menu_imports"
                  ],
                  "properties": {
                    "daily_limit": {
                      "type": "integer"
                    },
                    "imports_left_today": {
                      "type": "integer"
                    },
                    "reading_paused": {
                      "type": "boolean",
                      "description": "The reading service is out for today."
                    },
                    "can_start": {
                      "type": "boolean"
                    },
                    "refusal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "running": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/MenuImport"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "waiting_for_review": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/MenuImport"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "menu_imports": {
                      "type": "array",
                      "description": "The last 10, newest first (without their rows).",
                      "items": {
                        "$ref": "#/components/schemas/MenuImport"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarMenuImport",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Send a price list to be read",
        "description": "Admins only. One of `text`, `image_url` (a public `https://` address leading straight to a photo or PDF, fetched while the list is read: up to 3 redirects, 15 seconds, 15 MB) or a multipart upload with the photo or PDF as `file` (15 MB at most). The answer is `202` with the import `queued`: poll `GET …/menu_imports/{id}` every few seconds (a text takes 10–20 seconds, a photo 20–60). The photo, PDF or text is deleted once the list is added or discarded, or after 24 hours.\n\nRefusals: `403 ai_needs_priced_plan` (reading a list comes with a plan with a price, the person's or the calendar's organization's; `upgrade_url`), `409 import_running` (one is still being read; `details.menu_import_id`), `429 rate_limited` (the day's 10 are used; `Retry-After`), `503 reading_paused`, and `422 validation_failed` (nothing sent, more than one, or an address that can't be used).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "menu_import"
                ],
                "properties": {
                  "menu_import": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "examples": [
                          "Haircut 45 min 500\nBlow-dry 30 min 400"
                        ]
                      },
                      "image_url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream",
                    "description": "The photo or PDF."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued to be read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuImportEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/MenuImportForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/ImportRunning"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ReadingPaused"
          }
        }
      }
    },
    "/calendars/{calendar_id}/menu_imports/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarMenuImport",
        "tags": [
          "Calendar setup"
        ],
        "summary": "One price-list import, with its rows once read",
        "description": "Admins only. `status` says where it is. A failed (or `stalled`) one carries `error`, in the web's words, with what to do next. A `ready` one carries the review table: `rows` (the draft as read; `duplicate` rows and those to check are left out by default), its `summary`, and `currency_note` when the list's prices are in another currency (amounts are copied as written, never converted). A `confirmed` one says how many were added.\n",
        "responses": {
          "200": {
            "description": "The import.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuImportEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "delete": {
        "operationId": "discardCalendarMenuImport",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Discard a price-list import",
        "description": "Admins only. Nothing is added, and what was sent is deleted. A confirmed or expired one is `409 already_finished`. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "description": "Discarded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "menu_import",
                    "message"
                  ],
                  "properties": {
                    "menu_import": {
                      "$ref": "#/components/schemas/MenuImport"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "$ref": "#/components/responses/ImportFinished"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/menu_imports/{id}/confirm": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "confirmCalendarMenuImport",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add a read price list to the menu",
        "description": "Admins only. Everyone on the team performs the new offerings. Without a body, the draft is added as read (the rows `included`). With `rows`, only the rows sent are added (`\"include\": false` leaves one out), each keeping the draft's value for what you leave out. Problems are `422 validation_failed` with `details.rows` (by row key) and `details.base`, and nothing is added. Not read yet, or it failed: `409 not_ready`; already added, discarded or expired: `409 already_finished`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "key"
                      ],
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "include": {
                          "type": "boolean"
                        },
                        "name": {
                          "type": "string"
                        },
                        "category": {
                          "type": "string"
                        },
                        "duration_minutes": {
                          "type": "integer"
                        },
                        "price_cents": {
                          "type": "integer"
                        },
                        "price_mode": {
                          "type": "string",
                          "enum": [
                            "fixed",
                            "from",
                            "free",
                            "hidden"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "menu_import",
                    "offerings",
                    "message"
                  ],
                  "properties": {
                    "menu_import": {
                      "$ref": "#/components/schemas/MenuImport"
                    },
                    "offerings": {
                      "type": "array",
                      "description": "The new offerings.",
                      "items": {
                        "$ref": "#/components/schemas/MenuOffering"
                      }
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Added 12 services from your price list."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "description": "Not read yet, or it failed (`not_ready`); or already added, discarded or expired (`already_finished`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/menu_imports/{id}/source": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarMenuImportSource",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The photo or PDF of a price list",
        "description": "Admins only. The file itself, to check the rows against. A pasted text, a link not fetched yet, or a file already deleted is `404 no_source`.",
        "responses": {
          "200": {
            "description": "The file, as it was sent.",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/*"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/pdf"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "description": "No such import (`not_found`), or no file to send (`no_source`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/calendars/{calendar_id}/menu_imports/{id}/reread": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "rereadCalendarMenuImport",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Read a price list again after the reading service failed",
        "description": "Admins only, and only after the reading service itself failed (`error.code` `provider` or `budget`): the same list is read again as a new import (`202`; the old one is discarded), with the same refusals as starting one. Anything else is `409 not_rereadable`. Limit: 30 changes a minute per account.\n",
        "responses": {
          "202": {
            "description": "The new import, queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MenuImportEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/MenuImportForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "description": "Not one the reading service failed on (`not_rereadable`), or another is still being read (`import_running`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/ReadingPaused"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarProviders",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The team, in order, and team Kards not on it yet",
        "description": "Admins only. Everyone who takes bookings (Team members, Hosts, Stylists … as `labels.providers` says), switched-off people too, in the team's order, with what they do and where their login stands. Nobody needs an account to be on the team. `suggested_kards`: the organization's Kards nobody stands behind yet, each one call from joining (`POST …/providers` with `{\"provider\": {\"kard\": \"<share_link>\"}}`).\n",
        "responses": {
          "200": {
            "description": "The team.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "providers",
                    "suggested_kards"
                  ],
                  "properties": {
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeamProvider"
                      }
                    },
                    "suggested_kards": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SuggestedKard"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarProvider",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add someone to the team",
        "description": "Admins only. Three ways:\n\n- By name: only `name` is needed. They start with the opening hours and do everything on the menu unless `offering_ids` says what; `color` is the next free one if left out.\n- From a team Kard in one call: `{\"kard\": \"priya\"}` with no `name` takes the Kard's name, tagline and number, links it, and does everything.\n- Yourself: `{\"me\": true}` puts the key's own person on the team, linked to their account (organization members). Already on it: `200` with your record. A personal calendar, or someone outside the organization, is `422 cannot_join`, saying why.\n\nA `kard` must be one of the business's Kards that nobody else stands behind, and not the business's own Kard (that one books the whole team): otherwise `422 validation_failed` with `details.kard`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "provider"
                ],
                "properties": {
                  "provider": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ProviderInput"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "me": {
                            "type": "boolean",
                            "description": "Put the key's own person on the team."
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamProvider"
          },
          "201": {
            "$ref": "#/components/responses/TeamProvider"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarProvider",
        "tags": [
          "Calendar setup"
        ],
        "summary": "One team member, as their page shows them",
        "description": "Admins, and that person's own login (a front-desk or staff login on its `your_provider`; without `login`). Their record plus their week, upcoming special days and time off, and their private links (`links`: anyone with them sees this person's bookings).\n",
        "responses": {
          "200": {
            "description": "The person.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "provider"
                  ],
                  "properties": {
                    "provider": {
                      "$ref": "#/components/schemas/TeamProviderDetail"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarProvider",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Change a team member, or switch them off or on",
        "description": "Admins only. Keys left out keep their value. `\"kard\": null` unlinks their Kard; `offering_ids` replaces what they do (what they keep keeps their own price and minutes, set in `providers` of `PATCH …/offerings/{id}`). `\"active\": false` switches them off: they leave the calendar and the booking page, their past bookings stay, and their \"My day\" and calendar links stop working (the `message` says so). `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "provider"
                ],
                "properties": {
                  "provider": {
                    "$ref": "#/components/schemas/ProviderInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/TeamProvider"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteCalendarProvider",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Take someone off the team",
        "description": "Admins only, with their hours and time off. Someone with bookings stays in the history: `422 has_bookings` (switch them off with `\"active\": false` instead). The only person on a personal calendar stays: `422 last_provider` (pause online booking in settings instead). Limit: 30 changes a minute per account.\n",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{id}/move": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "moveCalendarProvider",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Move someone up or down the team",
        "description": "Admins only. The order of the day's columns, and who comes first when a client lets the business choose. `moved` is false (with a `message`) when they're already first or last. Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The team in its new order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "moved",
                    "providers"
                  ],
                  "properties": {
                    "moved": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Priya Sharma is already first on the team."
                      ]
                    },
                    "providers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TeamProvider"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/hours": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarProviderHours",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A team member's weekly hours",
        "description": "Admins, and that person's own login. `[]` is a day off; two ranges are a split shift or a lunch break. `opening_hours` are the business's, to copy.",
        "responses": {
          "200": {
            "description": "Their hours.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hours"
                  ],
                  "properties": {
                    "hours": {
                      "$ref": "#/components/schemas/ProviderHours"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateCalendarProviderHours",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Change a team member's weekly hours",
        "description": "Admins, and that person's own login. The days named change; the rest keep their hours. Existing bookings stay where they are (the `message` says so). Problems are `422 validation_failed` with `details.weekly_hours` (\"Monday: 10:00–12:00 overlaps 11:00–13:00\"), and nothing is saved. `bookable_online` (whether clients can pick them online) is the admins' switch: from anyone else it's `403 forbidden`, and nothing is saved. `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "weekly_hours": {
                    "$ref": "#/components/schemas/WeeklyHoursInput"
                  },
                  "bookable_online": {
                    "type": "boolean",
                    "description": "Admins only."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Their hours as they are now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "hours",
                    "message"
                  ],
                  "properties": {
                    "hours": {
                      "$ref": "#/components/schemas/ProviderHours"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Saved Priya's hours. Existing appointments stay where they are."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/special_days": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarProviderSpecialDays",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A team member's upcoming special days",
        "description": "Admins, and that person's own login. Dates with different hours, or a day off, from the calendar's today; they replace the weekly hours that day.",
        "responses": {
          "200": {
            "description": "Their special days.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "special_days"
                  ],
                  "properties": {
                    "special_days": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SpecialDay"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarProviderSpecialDay",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Set different hours on one date, or a day off",
        "description": "Admins, and that person's own login. A date that already has special hours is replaced: `201` new, `200` replaced. No `date`, no `hours` (without `day_off`), or hours that overlap or end before they start: `422 validation_failed` (`details.date`, `details.hours`). A date that isn't `YYYY-MM-DD` is `400 invalid_parameter`. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "special_day"
                ],
                "properties": {
                  "special_day": {
                    "$ref": "#/components/schemas/SpecialDayInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/SpecialDaySaved"
          },
          "201": {
            "$ref": "#/components/responses/SpecialDaySaved"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/special_days/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "The special day's id, or its date (YYYY-MM-DD).",
          "schema": {
            "type": "string",
            "examples": [
              "1018409891",
              "2030-01-10"
            ]
          }
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "deleteCalendarProviderSpecialDay",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Put a date back to the usual hours",
        "description": "Admins, and that person's own login. By the special day's id or its date. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/time_off": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarProviderTimeOff",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A team member's upcoming time off, breaks and blocked time",
        "description": "Admins, and that person's own login. Everything ending from now on. `bookings_to_move`: upcoming bookings with this person inside it, which need moving (clients can't book this time; the front desk can, after a warning).",
        "responses": {
          "200": {
            "description": "Their time off.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "time_off"
                  ],
                  "properties": {
                    "time_off": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TimeOff"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarProviderTimeOff",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add time off, a break or blocked time for a team member",
        "description": "Admins, and that person's own login. Whole days (`starts_on`, `ends_on`, `all_day: true`), or a few hours (`starts_on`, `start_time`, `end_time`). `ends_on` left out is the same day; `all_day` left out is all day unless times are given; `kind` left out is `time_off`. The `message` counts the bookings to move. Problems are `422 validation_failed` with the form's sentences in `details.base` (\"Pick an end time.\"). Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "time_off"
                ],
                "properties": {
                  "time_off": {
                    "$ref": "#/components/schemas/TimeOffInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Added.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "time_off",
                    "message"
                  ],
                  "properties": {
                    "time_off": {
                      "$ref": "#/components/schemas/TimeOff"
                    },
                    "message": {
                      "type": "string",
                      "examples": [
                        "Added: Mon 14 Jan – Tue 15 Jan (time off). Clients can't book it."
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/time_off/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "deleteCalendarProviderTimeOff",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Remove a team member's time off, break or blocked time",
        "description": "Admins, and that person's own login. Their own blocks only: that time is bookable again. A closure of the whole calendar is a `404` here; remove it with `DELETE /calendars/{calendar_id}/blocks/{id}`. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/my_day_link": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "renewCalendarProviderMyDayLink",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A new private \"My day\" link for a team member",
        "description": "Admins, and that person's own login. Their day on a phone, no login. The old link stops opening at once (a lost phone, someone who left): send them the new one. Their calendar feed keeps working. Limit: 30 changes a minute per account.",
        "responses": {
          "201": {
            "description": "The new link.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "my_day_url",
                    "message"
                  ],
                  "properties": {
                    "my_day_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/providers/{provider_id}/feed_link": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/ProviderId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "renewCalendarProviderFeedLink",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A new private calendar-feed link for a team member",
        "description": "Admins, and that person's own login. Calendars subscribed to the old link stop updating until they subscribe again with the new one. \"My day\" keeps working. Limit: 30 changes a minute per account.",
        "responses": {
          "201": {
            "description": "The new link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedLink"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/logins": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarLogins",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Who signs in to the calendar",
        "description": "Admins only, on an organization's calendar (a personal calendar is a `404`: only its owner signs in). The organization's admins, the front-desk logins and their open invitations, each team member and where their login stands, what each role can do (`roles`, in words) and a `summary` line.\n",
        "responses": {
          "200": {
            "description": "The logins.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "admins",
                    "front_desk",
                    "providers",
                    "roles",
                    "summary"
                  ],
                  "properties": {
                    "admins": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LoginPerson"
                      }
                    },
                    "front_desk": {
                      "type": "object",
                      "required": [
                        "logins",
                        "invitations"
                      ],
                      "properties": {
                        "logins": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CalendarLogin"
                          }
                        },
                        "invitations": {
                          "type": "array",
                          "description": "Open front-desk invitations not tied to a team member.",
                          "items": {
                            "$ref": "#/components/schemas/StaffInvitation"
                          }
                        }
                      }
                    },
                    "providers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "provider",
                          "login"
                        ],
                        "properties": {
                          "provider": {
                            "type": "object",
                            "required": [
                              "id",
                              "name",
                              "title",
                              "active"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "active": {
                                "type": "boolean"
                              }
                            }
                          },
                          "login": {
                            "type": "object",
                            "required": [
                              "status",
                              "id",
                              "role",
                              "user",
                              "invitation"
                            ],
                            "properties": {
                              "status": {
                                "$ref": "#/components/schemas/LoginStatus"
                              },
                              "id": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "description": "The login's id, for DELETE …/logins/{id} (joined only)."
                              },
                              "role": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "front_desk",
                                  "staff",
                                  null
                                ]
                              },
                              "user": {
                                "oneOf": [
                                  {
                                    "$ref": "#/components/schemas/LoginPerson"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "invitation": {
                                "oneOf": [
                                  {
                                    "$ref": "#/components/schemas/StaffInvitation"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "roles": {
                      "type": "object",
                      "required": [
                        "front_desk",
                        "staff"
                      ],
                      "properties": {
                        "front_desk": {
                          "type": "string"
                        },
                        "staff": {
                          "type": "string"
                        }
                      }
                    },
                    "summary": {
                      "type": "string",
                      "examples": [
                        "4 people sign in to Bloom Salon's calendar: 2 admins, 1 front-desk login and 1 team member."
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      }
    },
    "/calendars/{calendar_id}/logins/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "removeCalendarLogin",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Remove a front-desk or staff login's access",
        "description": "Admins only, on an organization's calendar. Bookings, hours and time off are unchanged. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/invitations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarInvitations",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Open front-desk and staff invitations",
        "description": "Admins only, on an organization's calendar. Newest first; one past its expiry stays open until resent or cancelled (`status` says `expired`).",
        "responses": {
          "200": {
            "description": "The invitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitations"
                  ],
                  "properties": {
                    "invitations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StaffInvitation"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarInvitation",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Invite someone to sign in, as front desk or as a team member",
        "description": "Admins only, on an organization's calendar. The invitation is emailed at once. `role` `staff` signs in as the team member `provider_id` names; `front_desk` runs the desk. Problems are `422 validation_failed`. Limits: 30 changes a minute per account, and 30 invitations an hour (the web's count too).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "invitation"
                ],
                "properties": {
                  "invitation": {
                    "type": "object",
                    "required": [
                      "email"
                    ],
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "front_desk",
                          "staff"
                        ]
                      },
                      "provider_id": {
                        "type": "integer",
                        "description": "The team member a staff login signs in as."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/InvitationNow"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/invitations/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "delete": {
        "operationId": "cancelCalendarInvitation",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Cancel an open invitation",
        "description": "Admins only, on an organization's calendar. Its link stops working; the answer is the invitation, now revoked. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/InvitationNow"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/invitations/{id}/resend": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "resendCalendarInvitation",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Send an open invitation again",
        "description": "Admins only, on an organization's calendar. Its link works for another two weeks. One sent a moment ago isn't sent again: `sent` is false, and the `message` says so. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "description": "The invitation, and whether it went.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitation",
                    "sent",
                    "message"
                  ],
                  "properties": {
                    "invitation": {
                      "$ref": "#/components/schemas/StaffInvitation"
                    },
                    "sent": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/webhooks": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "listCalendarWebhooks",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Webhook endpoints, and the events they can get",
        "description": "Admins only. Up to `max` endpoints get the calendar's booking changes (see the `booking` webhook), each with its signing secret, its latest delivery and its latest test.",
        "responses": {
          "200": {
            "description": "The endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhooks",
                    "events",
                    "max"
                  ],
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CalendarWebhook"
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookEvent"
                      }
                    },
                    "max": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "createCalendarWebhook",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add a webhook endpoint",
        "description": "Admins only. Every event unless `events` names some. Send a test (`POST …/webhooks/{id}/test`) to check it answers. An address that can't be used, or a sixth endpoint, is `422 validation_failed`. Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "webhook"
                ],
                "properties": {
                  "webhook": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/WebhookInput"
                      },
                      {
                        "required": [
                          "url"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/WebhookNow"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/webhooks/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "patch": {
        "operationId": "updateCalendarWebhook",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Change a webhook endpoint, or switch it back on",
        "description": "Admins only. `enabled: true` switches on an endpoint that was turned off after failing. `PUT` is the same. Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "webhook"
                ],
                "properties": {
                  "webhook": {
                    "$ref": "#/components/schemas/WebhookInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/WebhookNow"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteCalendarWebhook",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Remove a webhook endpoint",
        "description": "Admins only. Nothing more is sent to it. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/webhooks/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "testCalendarWebhook",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Send a webhook endpoint a test event",
        "description": "Admins only. A `booking.created` event with made-up client details (`test: true`), sent in the background: `202`, and its answer shows in the endpoint's `test` (`GET …/webhooks`) within a few seconds. While one is still sending, the answer is `200` and nothing more is sent. Limits: 30 changes a minute per account, and 10 tests a minute (the web's count too).\n",
        "responses": {
          "200": {
            "$ref": "#/components/responses/WebhookNow"
          },
          "202": {
            "$ref": "#/components/responses/WebhookNow"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/webhooks/{id}/rotate_secret": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/Id"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "post": {
        "operationId": "rotateCalendarWebhookSecret",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Give a webhook endpoint a new signing secret",
        "description": "Admins only. The old secret stops at once: update the receiver with the new `secret`. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/WebhookNow"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendars/{calendar_id}/clients/import": {
      "parameters": [
        {
          "$ref": "#/components/parameters/CalendarId"
        },
        {
          "$ref": "#/components/parameters/HourCycle"
        }
      ],
      "get": {
        "operationId": "getCalendarClientImportSources",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Where clients can be imported from",
        "description": "Admins only. A spreadsheet (CSV: its limits, and the fields a column can be), or the people who sent their details through the business's Kards (`contacts`: how many, by Kard).",
        "responses": {
          "200": {
            "description": "The sources.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "csv",
                    "contacts"
                  ],
                  "properties": {
                    "csv": {
                      "type": "object",
                      "required": [
                        "max_bytes",
                        "max_rows",
                        "fields",
                        "default_country"
                      ],
                      "properties": {
                        "max_bytes": {
                          "type": "integer"
                        },
                        "max_rows": {
                          "type": "integer"
                        },
                        "fields": {
                          "type": "object",
                          "description": "What a column can be, with its label.",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "default_country": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Reads local phone numbers; send `country` to use another."
                        }
                      }
                    },
                    "contacts": {
                      "type": "object",
                      "required": [
                        "total",
                        "kards"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "kards": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "share_link",
                              "name",
                              "contacts"
                            ],
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "share_link": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "contacts": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          }
        }
      },
      "post": {
        "operationId": "importCalendarClients",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Import clients from a spreadsheet or the Kards' contacts, or preview it",
        "description": "Admins only. `source: \"csv\"` (the default) takes the spreadsheet's text as `csv`, or the file as `file` (multipart); its columns are guessed unless `mapping` says what each one is. `source: \"contacts\"` takes the people on the Kards in `kard_ids` (all of them when omitted). Send `dry_run: true` first: the `preview` says what each row would do (create, update a client's blanks, or skip, with the reason) and what still needs choosing (`problems`). Without it, the import runs: `result` and a `message`. Nobody is messaged.\n\nProblems are `422 validation_failed` (`details.mapping` or `details.kard_ids`), `422 too_many_rows`, `422 unreadable` (a file that isn't a CSV), and `409 changed_meanwhile` (a client was added meanwhile: preview again). Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientImportInput"
              }
            },
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ClientImportInput"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "type": "string",
                        "contentMediaType": "text/csv"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview (`dry_run`), or the import's result.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "preview"
                      ],
                      "properties": {
                        "preview": {
                          "$ref": "#/components/schemas/ClientImportPreview"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "result",
                        "message"
                      ],
                      "properties": {
                        "result": {
                          "$ref": "#/components/schemas/ClientImportResult"
                        },
                        "message": {
                          "type": "string",
                          "examples": [
                            "12 clients added, 3 updated. Nobody was messaged."
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/CalendarForbidden"
          },
          "404": {
            "$ref": "#/components/responses/CalendarNotFound"
          },
          "409": {
            "description": "A client was written meanwhile (`changed_meanwhile`); preview again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendar_sync": {
      "get": {
        "operationId": "getCalendarSync",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The key's own Google Calendar or Outlook connection",
        "description": "Any key, for its own connection only: it belongs to the person, not to a calendar. Busy times in the calendars they tick block their bookable time, and new bookings land in the one they pick, for every team member linked to their account (`providers`). Connecting needs the service's consent screen, so it happens in the browser: send the owner to `connect_url`. `connection` is null until then.\n",
        "responses": {
          "200": {
            "description": "The connection and where it counts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connection",
                    "services",
                    "providers",
                    "connect_url"
                  ],
                  "properties": {
                    "connection": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/CalendarConnection"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "name",
                          "available",
                          "adds_bookings"
                        ],
                        "properties": {
                          "key": {
                            "$ref": "#/components/schemas/SyncService"
                          },
                          "name": {
                            "type": "string",
                            "examples": [
                              "Google Calendar",
                              "Outlook"
                            ]
                          },
                          "available": {
                            "type": "boolean",
                            "description": "It can be connected on this site."
                          },
                          "adds_bookings": {
                            "type": "boolean",
                            "description": "Connecting asks to add bookings to the calendar too. False for Google until Google finishes reviewing eKard's access to add events; a connection then checks busy times only."
                          }
                        }
                      }
                    },
                    "providers": {
                      "type": "array",
                      "description": "The team members linked to this account, where the sync counts.",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "calendar"
                        ],
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "calendar": {
                            "$ref": "#/components/schemas/NamedRecord"
                          }
                        }
                      }
                    },
                    "connect_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/calendar_sync/{service}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SyncService"
        }
      ],
      "patch": {
        "operationId": "updateCalendarSync",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Choose the calendars to check, and where bookings go",
        "description": "Any key, its own connection. Partial: omitted keys keep their value. `busy_calendar_ids` (up to 10 of its `calendars`; `[]` checks none), `destination_calendar_id` (`null` stops adding bookings), `add_meet_links` (a Google Meet or Microsoft Teams link on video meetings) and `invite_clients` (clients are added to the event as guests). Not connected: `409 not_connected`, with where to connect. A calendar that isn't the account's is `422 validation_failed`. `PUT` is the same. Limit: 30 changes a minute per account.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "calendar_sync"
                ],
                "properties": {
                  "calendar_sync": {
                    "$ref": "#/components/schemas/CalendarSyncInput"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The connection as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connection",
                    "message"
                  ],
                  "properties": {
                    "connection": {
                      "$ref": "#/components/schemas/CalendarConnection"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/NotConnected"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "disconnectCalendarSync",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Disconnect Google Calendar or Outlook",
        "description": "Any key, its own connection. Busy times stop blocking, and new bookings stop being added; events already added stay. Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "description": "Disconnected.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connection",
                    "message"
                  ],
                  "properties": {
                    "connection": {
                      "type": "null"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/NotConnected"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendar_sync/{service}/add_upcoming": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SyncService"
        }
      ],
      "post": {
        "operationId": "addUpcomingToCalendarSync",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Add upcoming bookings that aren't in the synced calendar yet",
        "description": "Any key, its own connection, while it adds bookings (`writes_events`). Queued in the background: `202` with how many. Not connected, or not adding bookings: `409 not_connected`, whose message says why and what to do (the connection's `add_bookings_note`). Limit: 30 changes a minute per account.",
        "responses": {
          "202": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "count",
                    "message"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/NotConnected"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendar_sync/{service}/handoff": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SyncService"
        }
      ],
      "post": {
        "operationId": "createCalendarSyncHandoff",
        "tags": [
          "Calendar setup"
        ],
        "summary": "A link that connects the service in a browser",
        "description": "Connecting needs the service's consent screen: open `url` in a browser (the app's Custom Tab). It shows who is connecting and continues to Google or Microsoft, for this account, within 10 minutes and once, without signing the browser in to eKard. `add_events: true` asks to add bookings too, where the connection checks busy times only. A service this server doesn't offer: `503 sync_unavailable`.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalendarSyncHandoffInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarSyncHandoff"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "503": {
            "description": "This server doesn't offer the service yet (`sync_unavailable`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/calendar_notifications": {
      "get": {
        "operationId": "listNotificationDevices",
        "tags": [
          "Calendar setup"
        ],
        "summary": "The key's own devices that show Calendar's notifications",
        "description": "Any key, its own devices only: they belong to the person, not to a calendar. Each device hears about every calendar the person runs or works in, as their role there allows (`calendars`): an admin or the front desk about every booking, a team member's login only about its own. What it hears: a booking made online or through the API (a series once, for all its visits; not on the devices of the account whose key made it), a request waiting for approval, and a client's own cancellation or move; an admin's or the front desk's, the waitlist's offers to send on WhatsApp too. A device set to `requests_and_cancellations` hears only the request and the cancellation. Turning a browser on is the browser's own Push API, which asks the person on that device, so it happens there: send them to `turn_on_url`. eKard's own app registers its phone with `POST /calendar_notifications`.\n",
        "responses": {
          "200": {
            "description": "The devices, the choices, and what each calendar notifies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeviceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "registerAppDevice",
        "tags": [
          "App"
        ],
        "summary": "Register the app's phone for notifications",
        "description": "eKard's own app, with the access token of the session signed in on the phone (an API key is `422 not_a_session`). The Android app sends `kind` `fcm` with its Firebase installation ID as `endpoint`; the iPhone app sends `kind` `apns` with the device token Apple gave it (lower-case hex) and its `environment`. Each app sends its own platform's kind. The same ID or token again updates the row (`200`; one another account registered moves to this one, from `everything` again); a new one for this session replaces its last, so a session has one phone. Signing out removes it, and so does the push service saying the phone is gone. 10 devices a person, browsers and phones together. Where that platform's notifications aren't set up yet: `503 push_unavailable`.",
        "security": [
          {
            "appSession": [

            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppDeviceRegistration"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The phone was on file; this is it now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeviceEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Registered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeviceEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Not an app session (`not_a_session`); a kind other than the app's platform's (`invalid_parameter`: `fcm` from Android, `apns` from iPhone); or the ID or token isn't one, the `environment` is missing or unknown, or 10 devices already (`validation_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Notifications for this platform's phones aren't set up on this server yet (`push_unavailable`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/calendar_notifications/{id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "patch": {
        "operationId": "updateNotificationDevice",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Choose what a device shows",
        "description": "Any key, its own devices: another person's id is `404`. `notify`: `everything` or `requests_and_cancellations`; anything else is `422 validation_failed`. `notify_leads`: new contacts on the person's kards (the app's phones show them). Send one or both. `PUT` is the same. Limit: 30 changes a minute per account.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationDeviceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The device as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeviceSaved"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "removeNotificationDevice",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Remove a device from Calendar's notifications",
        "description": "Any key, its own devices. It gets no more notifications until it's turned on again on the device (a lost phone, an old browser). Limit: 30 changes a minute per account.",
        "responses": {
          "200": {
            "description": "Removed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationDeviceRemoved"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/calendar_notifications/{id}/test": {
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "post": {
        "operationId": "testNotificationDevice",
        "tags": [
          "Calendar setup"
        ],
        "summary": "Send a test notification to a device",
        "description": "Any key, its own devices. Queued: `202`. It shows on the device within seconds (\"Notifications are on\", and what it will show; the app's `event` is `test`). Limit: 5 a minute per account, counted with the web's Send a test.",
        "responses": {
          "202": {
            "description": "Queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "webhooks": {
    "booking": {
      "post": {
        "operationId": "bookingWebhook",
        "tags": [
          "Bookings"
        ],
        "summary": "A booking changed",
        "description": "A booking calendar pushes every change to up to 5 endpoints its owner adds on the web (https://ekard.app/calendar/webhooks, or an organization's calendar settings). Headers follow the Standard Webhooks spec (`webhook-id`, `webhook-timestamp`, `webhook-signature: v1,<base64>`): HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{raw body}` with the base64-decoded part of the endpoint's `whsec_` secret. Answer any 2xx within 10 seconds; anything else is retried 5 more times over about 15 minutes.\n",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "The same on every retry of one event; use it to skip duplicates.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds of this attempt. Reject timestamps more than 5 minutes from now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received (any 2xx counts)."
          }
        },
        "security": [

        ]
      }
    },
    "contact": {
      "post": {
        "operationId": "contactWebhook",
        "tags": [
          "Contacts"
        ],
        "summary": "A kard got a new contact",
        "description": "A kard sends every new contact (the kard's form, a kard shared back, a booking, typed in or scanned in the app, the API) to the one address its people add on the web (https://ekard.app/kards/{share_link}/webhook, or https://ekard.app/organizations/{slug}/kards/{share_link}/webhook for a team kard). Free on every plan. Same headers and signature as the booking webhook: Standard Webhooks (`webhook-id`, `webhook-timestamp`, `webhook-signature: v1,<base64>`), HMAC-SHA256 over `{webhook-id}.{webhook-timestamp}.{raw body}` with the base64-decoded part of the address's `whsec_` secret. Answer any 2xx within 10 seconds; anything else is retried 5 more times over about 15 minutes. Up to 60 a minute per kard after a first 30 at once; more wait their turn.\n",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "description": "`msg_contact_created_{contact id}`: the same on every retry and never reused; the body's `id` too. Use it to skip duplicates.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds of this attempt. Reject timestamps more than 5 minutes from now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactWebhookEvent"
              },
              "example": {
                "id": "msg_contact_created_812",
                "type": "contact.created",
                "timestamp": "2030-01-09T06:30:00Z",
                "data": {
                  "contact": {
                    "id": 812,
                    "kard": "priya",
                    "kard_name": "Priya Sharma",
                    "kard_organization": null,
                    "source": "scan",
                    "found_via": null,
                    "name": "Ravi Mehta",
                    "email": "ravi@mehtaexports.example",
                    "country_code": null,
                    "phone_number": "+919820012345",
                    "message": null,
                    "note": null,
                    "custom_fields": {
                    },
                    "card_details": {
                      "company": "Mehta Exports",
                      "job_title": "Head of Purchasing",
                      "notes": "Wants samples by Friday"
                    },
                    "event_id": 4,
                    "event": {
                      "id": 4,
                      "name": "Auto Expo"
                    },
                    "shared_kard": null,
                    "kard_sent_at": null,
                    "follow_up_on": null,
                    "follow_up_by": null,
                    "last_reach": null,
                    "whatsapp_url": "https://wa.me/919820012345?text=Hi%20Ravi%21%20Good%20to%20meet%20you%20at%20Auto%20Expo.%20Here%27s%20my%20card%2C%20with%20all%20my%20details%3A%20...",
                    "created_at": "2030-01-09T06:30:00Z",
                    "updated_at": "2030-01-09T06:30:00Z"
                  },
                  "kard": {
                    "share_link": "priya",
                    "organization": null,
                    "name": "Priya Sharma",
                    "public_url": "https://ekard.app/priya"
                  },
                  "source_label": "Read off their paper card",
                  "found_via_label": null,
                  "answers": [

                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received (any 2xx counts)."
          }
        },
        "security": [

        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ekard_...",
        "description": "The account's API key, from https://ekard.app/account/ai."
      },
      "appSession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "eka_...",
        "description": "An access token of eKard's own app (POST /sessions/google, /sessions/apple, /sessions/password, /sessions/email_link/sign_in or /sessions/email_link/code, then /sessions/refresh). It works wherever the API key does. When it expires the answer is `401 token_expired`: refresh, then send the request again."
      }
    },
    "parameters": {
      "ShareLink": {
        "name": "share_link",
        "in": "path",
        "required": true,
        "description": "The kard's share_link, its public URL slug.",
        "schema": {
          "type": "string"
        }
      },
      "Organization": {
        "name": "organization",
        "in": "query",
        "description": "An organization's slug, when the same share_link exists in two organizations you belong to.",
        "schema": {
          "type": "string"
        }
      },
      "OrganizationSlug": {
        "name": "slug",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "Id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "DocumentId": {
        "name": "document_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "Query": {
        "name": "query",
        "in": "query",
        "description": "Every word of it, in any order and any case, in the name, email, phone number, message, `note`, `card_details` (company, job title, notes, other emails) or custom fields: `mehta ravi` finds Ravi Mehta. A query that reads as a number (digits, spaces, `+ ( ) . - /`, 3 digits or more) also matches any of the contact's numbers by its digits, punctuation and a leading 0 aside: `020 7946 0018` finds `+442079460018`.",
        "schema": {
          "type": "string"
        }
      },
      "ContactSort": {
        "name": "sort",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "name",
            "email",
            "created_at",
            "message"
          ],
          "default": "created_at"
        }
      },
      "Direction": {
        "name": "direction",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "default": "desc"
        }
      },
      "KardContactEvent": {
        "name": "event_id",
        "in": "query",
        "description": "One of this kard's events: the people met at it (an event's \"Open them in contacts\"), a returner on each event they came to, as its `contacts_count` counts them. Another kard's event is `404`.",
        "schema": {
          "type": "integer"
        }
      },
      "ContactIds": {
        "name": "ids[]",
        "in": "query",
        "description": "Only these of the list's contacts (the web's ticked rows: the bulk bar's Save to my phone and CSV), still narrowed by the other filters. Ids of another kard's contacts find nobody.",
        "style": "form",
        "explode": true,
        "schema": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      },
      "ContactFoundVia": {
        "name": "found_via",
        "in": "query",
        "description": "How they found the kard (`Contact.found_via`), one or more comma-separated: qr, nfc, signature, chat, email, search, social, brand, website, direct, unknown. Contacts with none (made before 1.8.6, typed in, scanned, booked, the API's) match none of them. Anything else is `400 invalid_parameter`.",
        "schema": {
          "type": "string"
        },
        "examples": {
          "booth": {
            "value": "qr,nfc"
          }
        }
      },
      "ContactReached": {
        "name": "reached",
        "in": "query",
        "description": "`no`: \"Not reached yet\", the web's filter on Contacts and an event's people (since 1.9.11): nobody tapped Call, Text, WhatsApp or Email on them on the web or in an app (`POST /kards/{share_link}/contacts/{id}/reaches`), and no follow-up of theirs was marked done. `yes`: the others. Anything else is `400 invalid_parameter`.",
        "schema": {
          "type": "string",
          "enum": [
            "no",
            "yes"
          ]
        }
      },
      "KardContactFollowUp": {
        "name": "follow_up",
        "in": "query",
        "description": "`due`: a follow-up reminder on the account's today or before (its zone: the person's calendar's, else the one their browser reported, else UTC), the people the morning email lists. `set`: any reminder (the web's \"To follow up\"). Anything else is `400 invalid_parameter`.",
        "schema": {
          "type": "string",
          "enum": [
            "due",
            "set"
          ]
        }
      },
      "KardContactQuestion": {
        "name": "question",
        "in": "query",
        "description": "With `answer`: the people who picked one choice of the kard's own questions (the web's filter on Contacts). The `key` of a `choice` question in the kard's `contact_form`. A key the kard doesn't have, a short answer's, or either parameter without the other is `400 invalid_parameter`.",
        "schema": {
          "type": "string",
          "examples": [
            "what_are_you_looking_for"
          ]
        }
      },
      "KardContactAnswer": {
        "name": "answer",
        "in": "query",
        "description": "With `question`: one of that question's `choices`, in its words.",
        "schema": {
          "type": "string",
          "examples": [
            "Wholesale"
          ]
        }
      },
      "KardContactProduct": {
        "name": "product",
        "in": "query",
        "description": "One of the kard's products, by its `id`: the people who said they're interested in it (ticked on the exchange sheet, or on a return, not checked; the web's \"Interested in\" filter). An id the kard doesn't have is `400 invalid_parameter`.",
        "schema": {
          "type": "integer"
        }
      },
      "Page": {
        "name": "page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "PerPage": {
        "name": "per_page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 25
        }
      },
      "From": {
        "name": "from",
        "in": "query",
        "description": "ISO 8601; now when omitted.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "To": {
        "name": "to",
        "in": "query",
        "description": "ISO 8601.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "BookingStatuses": {
        "name": "status",
        "in": "query",
        "description": "A comma-separated list of requested, booked, arrived, completed, cancelled, no_show, declined.",
        "schema": {
          "type": "string",
          "default": "requested,booked"
        }
      },
      "CalendarId": {
        "name": "calendar_id",
        "in": "path",
        "required": true,
        "description": "A calendar's id, from GET /calendars. A calendar this key has no role on answers 404, like one that doesn't exist.",
        "schema": {
          "type": "integer"
        }
      },
      "OwnerLanguage": {
        "name": "Owner-Language",
        "in": "header",
        "required": false,
        "description": "The language for the answer's words (since 1.9.13): `account` for the account's (`GET /me`'s `account.language`), or one of the eight codes, the language the app's own screens are in. Where the web's page for the same thing speaks the account's language (Your Kards, New Kard and Edit Kard, Products), the answer's refusals (`message`, `details`), notices and words (`last_30_days.words`, `settings.from_team_note`, `wallpaper_styles`) are the web's, in that language, and `Content-Language` says which. Left out, or a value not listed: English, as before, so an app whose own screens are English never shows a sentence in another language beside them. Words for developers (`invalid_parameter`'s), names you send, and the answers of routes not listed here stay as they are. A server before 1.9.13 ignores it.",
        "schema": {
          "type": "string",
          "enum": [
            "account",
            "en",
            "hi",
            "es",
            "pt",
            "fr",
            "ar",
            "id",
            "de"
          ]
        }
      },
      "HourCycle": {
        "name": "Hour-Cycle",
        "in": "header",
        "required": false,
        "description": "How the reader writes a time, as their phone is set: `24` (or CLDR's `h23`) for 24-hour time, `12` (or `h12`) for 12-hour. Every time the answer puts in words (\"Mon–Sat 10:00–19:00\", \"Blocked Maya today, 13:00–14:00\", a special day's \"12:00–19:00\") reads that way. Left out, or a value not listed: the calendar's own clock, 12- or 24-hour by its country. Messages to clients (emails, WhatsApp texts, a contact's booking line) always keep the calendar's own clock. Any route takes it; Calendar's word the most times.",
        "schema": {
          "type": "string",
          "enum": [
            "12",
            "24",
            "h11",
            "h12",
            "h23",
            "h24"
          ]
        }
      },
      "BookingId": {
        "name": "booking_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "ClientId": {
        "name": "client_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer"
        }
      },
      "CalendarDate": {
        "name": "date",
        "in": "query",
        "description": "A local date (YYYY-MM-DD) in the calendar's zone; today there when omitted.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "OfferingIds": {
        "name": "offering_ids[]",
        "in": "query",
        "description": "One or more offerings, back to back with one person. Required unless `booking_id` is sent.",
        "schema": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "style": "form",
        "explode": true
      },
      "AvailabilityMode": {
        "name": "mode",
        "in": "query",
        "description": "`front_desk`: what the business may book, ignoring notice and the booking window. `online`: what clients can book.",
        "schema": {
          "type": "string",
          "enum": [
            "front_desk",
            "online"
          ],
          "default": "front_desk"
        }
      },
      "LockVersion": {
        "name": "lock_version",
        "in": "query",
        "description": "The booking's lock_version, from its JSON. If someone changed the booking since, nothing changes (409 stale_booking).",
        "schema": {
          "type": "integer"
        }
      },
      "ClientQuery": {
        "name": "q",
        "in": "query",
        "description": "Part of a name or email, or any 3+ digits of a phone number.",
        "schema": {
          "type": "string"
        }
      },
      "TakingsRange": {
        "name": "range",
        "in": "query",
        "description": "Today, this week (Monday to Sunday) or this month; instead of `from` and `to`.",
        "schema": {
          "type": "string",
          "enum": [
            "today",
            "week",
            "month"
          ]
        }
      },
      "TakingsFrom": {
        "name": "from",
        "in": "query",
        "description": "The first local date (YYYY-MM-DD); today when omitted.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "TakingsTo": {
        "name": "to",
        "in": "query",
        "description": "The last local date, at most 366 days after `from`; `from` when omitted.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "InsightsRange": {
        "name": "range",
        "in": "query",
        "description": "The week (Monday to Sunday) or month around `date`; instead of `from` and `to`.",
        "schema": {
          "type": "string",
          "enum": [
            "week",
            "month"
          ]
        }
      },
      "InsightsDate": {
        "name": "date",
        "in": "query",
        "description": "A local date (YYYY-MM-DD) in the week or month `range` asks for; today when omitted.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "InsightsFrom": {
        "name": "from",
        "in": "query",
        "description": "The first local date (YYYY-MM-DD). Without `range`, `from` or `to`, this month.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "InsightsTo": {
        "name": "to",
        "in": "query",
        "description": "The last local date, at most 366 days after `from`; `from` when omitted.",
        "schema": {
          "type": "string",
          "format": "date"
        }
      },
      "ProviderId": {
        "name": "provider_id",
        "in": "path",
        "required": true,
        "description": "A team member's id, from GET …/providers (or the login's `your_provider`).",
        "schema": {
          "type": "integer"
        }
      },
      "SyncService": {
        "name": "service",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/SyncService"
        }
      }
    },
    "responses": {
      "Deleted": {
        "description": "Deleted.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "deleted",
                "id"
              ],
              "properties": {
                "deleted": {
                  "const": true
                },
                "id": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "A parameter is missing or unreadable (`missing_parameter`, `invalid_parameter`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The key is missing or wrong (`unauthorized`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The record exists, but this account's role can't do that (`forbidden`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such record, or it isn't this account's (`not_found`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NoCalendar": {
        "description": "No such kard (`not_found`), or the kard has no booking calendar yet (`no_calendar`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "The record didn't save (`validation_failed`); `details` has the messages per field.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PhotoNotStored": {
        "description": "File storage didn't take `kard[photo]` (`photo_not_stored`), so nothing was saved: no new kard, no change. Send the request again, or send it without the photo and add it later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PlanRequired": {
        "description": "Your own domain comes with every paid plan (`plan_required`; `upgrade_url` is the pricing page), or the record exists but this account's role can't change it (`forbidden`).",
        "content": {
          "application/json": {
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "upgrade_url": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "DomainsUnavailable": {
        "description": "Connecting a domain isn't available on this server right now (`unavailable`); try again later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "Refused, with a message written for a person: for bookings `invalid_transition`, `invalid_duration`, `offering_unavailable`, `too_late_to_request`, `invalid_recipient`, `invalid_parameter` and the booking engine's other refusals; for clients `not_a_possible_duplicate`; for setup `has_bookings`, `last_provider`, `cannot_join`, `too_many_rows`, `unreadable` and `invalid_parameter`; elsewhere `no_subscription`, `not_renewing`, `nothing_to_publish`, `nothing_to_checkpoint`, `checkpoint_limit`, `invalid_logo`, `invalid_design`, `invalid_layout`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "SlotTaken": {
        "description": "The time isn't free (`slot_taken`; `details.alternatives` lists up to 3 nearby open times, today's from now: the latest under way at most), or the booking changed meanwhile (`stale_booking`: read it again).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many booking or calendar writes, domain connects and checks, MCP messages, recorded shares, wallpapers or pictures (`rate_limited`); wait `Retry-After` seconds and send it again.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotJson": {
        "description": "The body isn't JSON (`unsupported_media_type`): the sign-in doors that take no key take `Content-Type: application/json` alone, so no form on another website can post to them. Nothing was sent, used or counted.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "EmailNotAllowed": {
        "description": "Sign-ups and sign-ins from this email's domain are blocked (`email_not_allowed`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CalendarNotFound": {
        "description": "No such calendar, or this key's person has no role on it; or no such booking, client, person or offering in it (`not_found`). The answer is the same either way, so it doesn't reveal whether a calendar exists.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CalendarForbidden": {
        "description": "This login's role on the calendar is below what the operation needs, or (staff) the booking is someone else's (`forbidden`). The message says what this login can do here and which admins to ask.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "StaleBooking": {
        "description": "The booking changed since the `lock_version` you sent (`stale_booking`): nothing was overwritten. Read it again and decide.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CalendarBooking": {
        "description": "The booking as it is now.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DeskBookingEnvelope"
            }
          }
        }
      },
      "Removed": {
        "description": "Done; `message` says what it means.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "deleted",
                "message"
              ],
              "properties": {
                "deleted": {
                  "const": true
                },
                "message": {
                  "type": "string",
                  "examples": [
                    "Sara Khan is off the team."
                  ]
                }
              }
            }
          }
        }
      },
      "TeamRefused": {
        "description": "Refused so the organization keeps an admin (`last_admin`): make someone else an admin first. Or, making a calendar login an admin (which puts them on the team), the team's places are all taken (`team_full`). The message says so in words.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InvitationRefused": {
        "description": "The invitation didn't save (`validation_failed`; `details` has the messages per field), or every one of the team's places is taken (`team_full`): the message says how to free one, or ask for more.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "JoinDecisionRefused": {
        "description": "Approving would take a place the team doesn't have (`team_full`: the message says how to free one), or another admin answered the request already (`already_decided`: the message names them).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TeamStartRefused": {
        "description": "The account can't start a team now: its email address isn't verified (`email_unverified`; POST `verify_url`, which is `POST /me/email_verification`, to email the link), or it already runs 3 teams (`team_limit`). The message says what to do.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TeamProvider": {
        "description": "The person, as their page shows them, and what to tell them.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "provider"
              ],
              "properties": {
                "provider": {
                  "$ref": "#/components/schemas/TeamProviderDetail"
                },
                "message": {
                  "type": "string",
                  "examples": [
                    "Sara Khan is on the team, working Mon–Sat 10:00–19:00 (the opening hours). Check their hours."
                  ]
                }
              }
            }
          }
        }
      },
      "SpecialDaySaved": {
        "description": "Saved (201 new, 200 replaced).",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "special_day",
                "message"
              ],
              "properties": {
                "special_day": {
                  "$ref": "#/components/schemas/SpecialDay"
                },
                "message": {
                  "type": "string",
                  "examples": [
                    "Saved Sun 20 Jan: day off."
                  ]
                }
              }
            }
          }
        }
      },
      "InvitationNow": {
        "description": "The invitation as it is now.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "invitation",
                "message"
              ],
              "properties": {
                "invitation": {
                  "$ref": "#/components/schemas/StaffInvitation"
                },
                "message": {
                  "type": "string",
                  "examples": [
                    "Invitation sent to pooja@example.com. The link works until Wed 23 Jan."
                  ]
                }
              }
            }
          }
        }
      },
      "WebhookNow": {
        "description": "The endpoint as it is now.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "webhook",
                "message"
              ],
              "properties": {
                "webhook": {
                  "$ref": "#/components/schemas/CalendarWebhook"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AiNeedsPricedPlan": {
        "description": "This runs eKard's AI, which comes with a plan with a price (`ai_needs_priced_plan`; `upgrade_url` is the pricing page). Nothing was read or counted.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AiNeedsPricedPlan"
            }
          }
        }
      },
      "MenuImportForbidden": {
        "description": "This login's role on the calendar can't (`forbidden`), or reading a price list needs a plan with a price, the person's or the calendar's organization's (`ai_needs_priced_plan`, with `upgrade_url`).",
        "content": {
          "application/json": {
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/AiNeedsPricedPlan"
                },
                {
                  "$ref": "#/components/schemas/Error"
                }
              ]
            }
          }
        }
      },
      "ImportRunning": {
        "description": "Another price list is still being read (`import_running`; `details.menu_import_id`): wait for it, then start again.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ImportFinished": {
        "description": "Already added, discarded or expired (`already_finished`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ReadingPaused": {
        "description": "The reading service is out for today (`reading_paused`); try again tomorrow, or add the offerings by hand.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotConnected": {
        "description": "Not connected to that service, or not adding bookings (`not_connected`): the message says where to connect.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "headers": {
      "PictureFileName": {
        "description": "`inline; filename=\"Priya Sharma greeting 1080x1920.png\"; filename*=UTF-8''Priya%20Sharma%20greeting%201080x1920.png`: the name to save or share the picture under, the web download's. `filename*` carries it whole in UTF-8 (RFC 8187, percent-encoded: a name in any script); `filename` is the same in plain ASCII, each other letter written `%3F` (a `?`), for a reader that takes only that.",
        "schema": {
          "type": "string"
        },
        "examples": {
          "greeting": {
            "value": "inline; filename=\"Priya Sharma greeting 1080x1920.png\"; filename*=UTF-8''Priya%20Sharma%20greeting%201080x1920.png"
          }
        }
      }
    },
    "schemas": {
      "McpMessage": {
        "type": "object",
        "description": "One JSON-RPC 2.0 message: a request (with `id`), a notification (without), or the client's answer to something (`result` or `error`).",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "method": {
            "type": "string",
            "description": "`server/discover`, `tools/list`, `tools/call`; `initialize` and `ping` before 2026-07-28; a notification's name.",
            "examples": [
              "tools/call"
            ]
          },
          "params": {
            "type": "object",
            "description": "For `tools/call`: `name` and `arguments`. In 2026-07-28, `_meta` too.",
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "object"
              },
              "_meta": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          }
        }
      },
      "McpAnswer": {
        "type": "object",
        "description": "A JSON-RPC 2.0 answer. A tool's result has `content` (the API's JSON as text), `structuredContent` (the same JSON as an object) and `isError`; in 2026-07-28 every result also has `resultType` and `_meta` naming the server.",
        "required": [
          "jsonrpc"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "description": "Per-field messages for validation_failed; alternatives (open times) for slot_taken."
              },
              "verify_url": {
                "type": "string",
                "format": "uri",
                "description": "Only with `email_unverified`: POST it with the same key or session to email the account the link that verifies its address (it's `POST /me/email_verification`). The `message` has no endpoint in it, so show it as written beside a button that does this."
              },
              "title": {
                "type": "string",
                "description": "Only with `link_gone` and a code's `410`s (`code_expired`, `code_replaced`, `code_tries_used`, `code_used`, `code_ended`): the web page's heading (\"This sign-in link doesn't work any more\", \"This code has expired\"). `message` begins with it as a sentence, so an app that shows `message` alone says it all; one that shows a heading shows this and the rest of `message` under it.",
                "examples": [
                  "This sign-in link doesn't work any more",
                  "This code has expired"
                ]
              },
              "tries_left": {
                "type": "integer",
                "description": "Only with `code_wrong` (`POST /sessions/email_link/code`): the wrong codes this ask still takes, 4 to 1. The 5th wrong code is `410 code_tries_used` instead."
              },
              "did_you_mean": {
                "type": "string",
                "format": "email",
                "description": "Only when the email typed for signing in or up (`/sessions/password`, `/sessions/email_link`) is one slip from a big email provider's address (gmial.com, gamil.com, gmail.co, gmail.con, yahooo.com, hotmial.com, outlok.com): the address the person most likely meant, such as `name@gmail.com`. With `validation_failed` (an ending that isn't a real one, such as .con) and `no_account`; on `/sessions/email_link`, with every refusal (`email_not_allowed` and `rate_limited` too), as its `202` carries it. Read from the address alone, never an account. Offer it as a button, \"Did you mean name@gmail.com?\", that puts it in the email field."
              }
            }
          }
        }
      },
      "AiNeedsPricedPlan": {
        "type": "object",
        "description": "The refusal of an endpoint that runs eKard's AI (reading a card's text, reading a price list) for an account without a plan with a price: no plan, a plan given free, or the trial. Offer what works on every plan instead: your own reading of the card, adding services by hand.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "upgrade_url"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "ai_needs_priced_plan"
                ]
              },
              "message": {
                "type": "string",
                "description": "What it needs and what still works, for the person, with no link in it: an app can show it as written (the card reader's: \"Read on your phone. A paid plan reads cards with AI.\")."
              },
              "upgrade_url": {
                "type": "string",
                "format": "uri",
                "description": "The pricing page."
              }
            }
          }
        }
      },
      "Message": {
        "type": "object",
        "description": "What happened, written for the person.",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "SignInLinkSent": {
        "type": "object",
        "description": "`POST /sessions/email_link`'s `202`: a `Message` (the same words for every address), the address the person most likely meant when the one typed is one slip from a big provider's, and, for an ask with `with_code: true`, the ask's id for its code.",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "The web's \"Check your email\" words, the same for every address, with an account or without: \"We've sent a link to meera@example.com. It works once, for 15 minutes. Open it on this phone to sign in.\" (\"If you can read email at …, a link is on its way…\" before 1.9.11)"
          },
          "did_you_mean": {
            "type": "string",
            "format": "email",
            "description": "Only when the address typed is one slip from a big email provider's (`kabir@gmial.com`): the one most likely meant (`kabir@gmail.com`), read from the typed address alone, never an account. The link went to the address as typed, as the web sends it when the person asks anyway. Offer \"Did you mean kabir@gmail.com?\" on Check your email; its press asks again for that address. Left out otherwise, and by servers before 1.9.3.",
            "examples": [
              "kabir@gmail.com"
            ]
          },
          "ask_id": {
            "type": "string",
            "description": "Only when the ask sent `with_code: true` (servers from 1.9.4): this ask's id, 22 characters. Send it with the code (`POST /sessions/email_link/code`). Keep it beside `device_nonce`, out of logs and crash reports, until a `201` or 15 minutes after the ask. A new ask from this device replaces it: only the newest ask's code works. Its `message` then says a link and a code were sent: \"We've sent a link and a code to meera@example.com. They work once, for 15 minutes. Open the link on this phone, or type the code here.\""
          },
          "code_length": {
            "type": "integer",
            "description": "With `ask_id`: the code's digits, 8. Size the field by it, and send when it's full.",
            "examples": [
              8
            ]
          }
        }
      },
      "Pagination": {
        "type": "object",
        "required": [
          "page",
          "per_page",
          "total_pages",
          "total_count"
        ],
        "properties": {
          "page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          },
          "total_count": {
            "type": "integer"
          }
        }
      },
      "NamedRecord": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "NamedPerson": {
        "type": "object",
        "description": "A person on the calendar's team, as a visit or the schedule names them.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "$ref": "#/components/schemas/ProviderFirstName"
          }
        }
      },
      "NamedClient": {
        "type": "object",
        "description": "A client as a list beside the visits names them: a waitlist entry's, a series', a new block's still-booked visits, Takings' unpaid ones. `first_name` since 1.9.13 here (absent from a server before it: use your rule on `name` then).",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "$ref": "#/components/schemas/ClientFirstName"
          }
        }
      },
      "ClientFirstName": {
        "type": "string",
        "examples": [
          "Ananya",
          "Dr. Anjali",
          "Walk-in"
        ],
        "description": "What the web's desk calls a client in a sentence (\"Mark Ananya as arrived\", \"Book Ananya for 3:15 PM\", \"Sent Ananya the confirmation again\"): the first word of their name, with a title kept (\"Dr. Anjali\"); a one-word name whole. The walk-ins' shared record (`nameless_walk_ins`) has \"Walk-in\": say \"the walk-in\" for it, as the desk does. Say it as written, in place of the app's own rule on `name`. Since 1.9.12; absent from a server before it: use your rule on `name` then."
      },
      "ProviderFirstName": {
        "type": "string",
        "examples": [
          "Priya",
          "Dr. Anjali",
          "Lakshmi's Beauty Lounge"
        ],
        "description": "What the web calls them in a sentence (\"Book with Priya\", \"with Priya\"): a person's first name, with a title kept (\"Dr. Anjali\"); a business's whole name (\"Lakshmi's Beauty Lounge\", never \"Lakshmi's\"), as `TeamProvider.first_name` has it. Say it as written. Since 1.9.9; absent from a server before it: use `name` then."
      },
      "Me": {
        "type": "object",
        "required": [
          "account",
          "subscription",
          "counts",
          "organizations",
          "brand",
          "docs_url",
          "whatsapp_hello"
        ],
        "properties": {
          "whatsapp_hello": {
            "$ref": "#/components/schemas/WhatsappHello"
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          },
          "counts": {
            "$ref": "#/components/schemas/AccountCounts"
          },
          "organizations": {
            "type": "array",
            "description": "Every organization the account belongs to, by name.",
            "items": {
              "$ref": "#/components/schemas/AccountOrganization"
            }
          },
          "brand": {
            "$ref": "#/components/schemas/Brand"
          },
          "docs_url": {
            "type": "string",
            "format": "uri"
          },
          "languages": {
            "type": "array",
            "description": "The eight languages an account may read eKard in, in Profile › Language's order, each named in itself (never translated): offer them as the web's chips, and send one's `code` as `PATCH /me`'s `language`. Left out by servers before 1.9.10.",
            "items": {
              "$ref": "#/components/schemas/AccountLanguage"
            }
          },
          "kards_to_bring": {
            "type": "array",
            "description": "The account's own kards it may bring into a team, newest first, as the web's Start a team offers them (\"Bring in Marcus Bell\", instead of \"Make me one\"): send one's `share_link` as `POST /organizations`' `kard`, or later `POST /organizations/{slug}/own_kard`. Empty: offer to make one. Read this rather than guessing from the kards' names. Left out by servers before 1.9.10.",
            "items": {
              "$ref": "#/components/schemas/KardToBring"
            }
          },
          "follow_ups": {
            "$ref": "#/components/schemas/FollowUpDays"
          },
          "email_change": {
            "description": "A change of the sign-in email, as the web's Profile shows where it stands (`POST /me/email_change`); null when there's none to show. Since 1.9.12; left out by servers before it.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailChange"
              }
            ]
          }
        }
      },
      "EmailChange": {
        "type": "object",
        "required": [
          "state",
          "old_email",
          "new_email",
          "title",
          "message",
          "expires_at",
          "confirmed_at",
          "undoable_until",
          "undone_at",
          "kards_showing_old_email",
          "kards_message"
        ],
        "description": "Where a change of the sign-in email stands, as the web's Profile shows it, in its words (English, as Profile is). Show `title` and `message` as written.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "proving",
              "pending",
              "ended",
              "done",
              "undone"
            ],
            "description": "`proving`: waiting for the code emailed to the current address (`POST /me/email_change/check`). `pending`: the link and code went to the new address; until they're used the account signs in as it did (offer the code field, Send it again and Cancel the change). `ended`: they ended unused (for a day; offer Ask again). `done`: the address changed (for 7 days, while the old address can undo it). `undone`: \"This wasn't me\" from the old address cancelled it or put it back, signed everyone out and removed the password."
          },
          "old_email": {
            "type": "string",
            "format": "email"
          },
          "new_email": {
            "type": "string",
            "format": "email"
          },
          "title": {
            "type": "string",
            "examples": [
              "We sent a link to meera@clinic.com"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "Your sign-in email changes to meera@clinic.com when you open that link, or type its code here. Until then you sign in as meera@personal.com. The link and code work until 25 Oct, 3:42 PM IST."
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the proof code (`proving`), or the link and code (`pending`, `ended`), stop working."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "undoable_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "`done`: until when the old address can undo it."
          },
          "undone_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kards_showing_old_email": {
            "type": "array",
            "description": "`done`: the account's kards whose email is still the old address (visitors who tap Email write there): `POST /me/email_change/kards` shows the new one on them.",
            "items": {
              "type": "object",
              "required": [
                "share_link",
                "organization",
                "name"
              ],
              "properties": {
                "share_link": {
                  "type": "string"
                },
                "organization": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "kards_message": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Your Kard Meera Iyer still shows meera@personal.com as its email. Visitors who tap Email write there."
            ]
          }
        }
      },
      "EmailChangeAnswer": {
        "type": "object",
        "required": [
          "email_change",
          "message"
        ],
        "properties": {
          "email_change": {
            "description": "The change as it stands now; null when Profile shows none (cancelled).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailChange"
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "What happened, in the web's words, to show as written."
          }
        }
      },
      "EmailChangeConfirmed": {
        "type": "object",
        "required": [
          "email_change",
          "message"
        ],
        "properties": {
          "email_change": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailChange"
              }
            ]
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "message": {
            "type": "string",
            "examples": [
              "Done: you sign in as meera@clinic.com from now on. We told meera@personal.com, and signed out your other browsers and phones. meera@personal.com can undo it for 7 days. If someone else reads its mail, write to support at once (the brand's support address)."
            ]
          }
        }
      },
      "EmailChangeKards": {
        "type": "object",
        "required": [
          "email_change",
          "message",
          "saved",
          "refused"
        ],
        "properties": {
          "email_change": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailChange"
              }
            ]
          },
          "message": {
            "type": "string"
          },
          "saved": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "share_link",
                "organization",
                "name"
              ],
              "properties": {
                "share_link": {
                  "type": "string"
                },
                "organization": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "refused": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "share_link",
                "organization",
                "name",
                "message"
              ],
              "properties": {
                "share_link": {
                  "type": "string"
                },
                "organization": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FollowUpDays": {
        "type": "object",
        "required": [
          "time_zone",
          "today",
          "days_off",
          "weekend",
          "choices",
          "days_off_note"
        ],
        "description": "\"Remind me\"'s quick choices as the web's contact sheet offers them to this account, and the rule behind them (since 1.9.12; left out by servers before it, where In 3 days and Next week are plain days). A choice days away (`in_3_days`, `next_week`) lands on the next day the account works when it falls on one of its `days_off`; Tomorrow stays tomorrow. One that lands on its `weekend` offers the working day after it beside it (\"In 3 days, Sun (weekend)\" and \"Mon 2 Nov instead\"). `choices` are today's: once `today` has passed in `time_zone`, work them out again from `days_off` and `weekend` (the same rule), or read `/me` again. Set the day picked as the contact's `follow_up_on`.",
        "properties": {
          "time_zone": {
            "type": "string",
            "description": "The account's own day: its personal calendar's zone, else its own, else UTC. Its morning email follows it.",
            "examples": [
              "Asia/Kolkata"
            ]
          },
          "today": {
            "type": "string",
            "format": "date",
            "description": "The account's today, in `time_zone`."
          },
          "days_off": {
            "type": "array",
            "description": "The weekdays the account's own calendar hours say it doesn't work, once its calendar is set up past its hours; empty when unknown (eKard assumes no weekend). A choice moves past them.",
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            }
          },
          "weekend": {
            "type": "array",
            "description": "Its country's weekend (`sat`, `sun`; `fri`, `sat` in much of the Gulf and North Africa, Israel, Bangladesh and the Maldives) when its calendar's hours don't say (`days_off` empty), else empty; empty with no country. A choice landing on it offers the working day after.",
            "items": {
              "type": "string",
              "enum": [
                "mon",
                "tue",
                "wed",
                "thu",
                "fri",
                "sat",
                "sun"
              ]
            }
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label",
                "on",
                "on_weekend",
                "instead_on"
              ],
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "tomorrow",
                    "in_3_days",
                    "next_week"
                  ]
                },
                "label": {
                  "type": "string",
                  "description": "The web's words for it.",
                  "examples": [
                    "In 3 days"
                  ]
                },
                "on": {
                  "type": "string",
                  "format": "date",
                  "description": "The day it lands on, its `days_off` passed: say it on the chip, as the web's \"In 3 days, Mon\"."
                },
                "on_weekend": {
                  "type": "boolean",
                  "description": "It lands on the account's `weekend`: the web's chip adds \"(weekend)\", and offers `instead_on` beside it."
                },
                "instead_on": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date",
                  "description": "With `on_weekend`: the working day after it (\"Mon 2 Nov instead\"); null otherwise."
                }
              }
            }
          },
          "days_off_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a choice lands later than its words say, as the web's sheet says it under the chips: \"Sat and Sun are off in your calendar's hours, so In 3 days is Mon and Next week is Mon.\"; null when none moved."
          }
        }
      },
      "AccountLanguage": {
        "type": "object",
        "required": [
          "code",
          "name",
          "dir"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "en",
              "hi",
              "es",
              "pt",
              "fr",
              "ar",
              "id",
              "de"
            ]
          },
          "name": {
            "type": "string",
            "description": "The language's own name.",
            "examples": [
              "हिन्दी",
              "العربية",
              "Deutsch"
            ]
          },
          "dir": {
            "type": "string",
            "enum": [
              "ltr",
              "rtl"
            ],
            "description": "Its direction, for writing its name."
          }
        }
      },
      "AccountCounts": {
        "type": "object",
        "required": [
          "kards",
          "contacts",
          "organizations",
          "bookmarks"
        ],
        "properties": {
          "kards": {
            "type": "integer"
          },
          "contacts": {
            "type": "integer"
          },
          "organizations": {
            "type": "integer"
          },
          "bookmarks": {
            "type": "integer"
          }
        }
      },
      "AccountOrganization": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "role",
          "calendar_only",
          "logo_url"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ],
            "description": "`admin` runs the organization (its Kards, team and calendar); `member` belongs to it, such as a front-desk or staff login to its calendar (GET /calendars has the calendar role)."
          },
          "calendar_only": {
            "type": "boolean",
            "description": "A member whose only way in is a calendar login: not on the team, holding none of its Kards (GET /organizations says it in words)."
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "Brand": {
        "type": "object",
        "description": "The brand of the host the request went to: eKard's name and domain for links and copy.",
        "required": [
          "key",
          "name",
          "domain"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "\"ekard\" or \"zkard\"."
          },
          "name": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          }
        }
      },
      "Account": {
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "image_url",
          "photo_chosen",
          "email_verified",
          "has_password",
          "apple_linked",
          "email_reachable",
          "member_since"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for an account made without a name (the apps' sign-up didn't ask): ask the person for one and send it with `PATCH /me`."
          },
          "name_from_kard": {
            "type": "boolean",
            "description": "The name is the one on a kard the account holds, given from it or typed the same: the web's Profile says \"Your name: Lakshmi Reddy, from your Kard\" beside Change. Left out by servers before 1.9.13."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The photo the person chose on the web's Profile › Edit, else their Google profile photo, for an account that signs in with Google."
          },
          "photo_chosen": {
            "type": "boolean",
            "description": "True when `image_url` is a photo the person chose (set with `PATCH /me`'s `account[photo]` or on the web's Profile › Edit): the one `remove_photo` takes away, so offer Remove only then. False for their Google photo or none, which there's nothing to remove from. Read this rather than guessing from `image_url`'s host."
          },
          "email_verified": {
            "type": "boolean",
            "description": "Google or Apple vouches for the address, or the person followed a link emailed to it. Until then a personal calendar holds email to the clients its owner types in (POST /me/email_verification sends the link)."
          },
          "has_password": {
            "type": "boolean",
            "description": "The account can sign in with its email and a password (otherwise with Google or Apple only)."
          },
          "apple_linked": {
            "type": "boolean",
            "description": "An Apple Account signs in to this account (Sign in with Apple), so Delete my account can be confirmed with Apple (`POST /me/deletion_request/apple`)."
          },
          "email_reachable": {
            "type": "boolean",
            "description": "False when we know mail to `email` doesn't reach the person: Apple stopped forwarding to this private relay address (they turned email forwarding off for eKard in their Apple Account's Sign in with Apple settings). Emailed links can't arrive then, so Delete my account confirms with Apple instead."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "The account's country (ISO 3166 two-letter code), as the web's Profile shows it: it reads a phone number typed without its country code, and decides what the person's Kards offer first (Text or WhatsApp, the ways to pay) and the printable card's paper. Set from the first visit, changed on Profile › Edit or with `PATCH /me`. Null: not set yet.",
            "examples": [
              "US"
            ]
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "The account's time zone (an IANA name), as the web's Profile shows it: the day a follow-up is due, when the morning email arrives (about 8 in the morning in it), and the dates and times in emails, unless the person's booking calendar has a zone of its own. Changed on Profile › Edit or with `PATCH /me`.",
            "examples": [
              "America/Chicago"
            ]
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "hi",
              "es",
              "pt",
              "fr",
              "ar",
              "id",
              "de"
            ],
            "description": "What the person reads eKard in: the web's screens converted so far and the emails sent to them (owner languages), one of the eight in `GET /me`'s `languages`. Chosen on the web's Profile › Language or with `PATCH /me`'s `language`. Left out by servers before 1.9.10: read it as optional."
          },
          "member_since": {
            "type": "string",
            "format": "date-time"
          },
          "email_bounced": {
            "description": "Mail to `email` bounced for good (the mailbox doesn't exist, or its server refuses it), so eKard has stopped emailing it, sign-in links included, as the web's Profile says at its top. Null while mail goes. Left out by servers before 1.9.2. The web's Profile (`/profile`, in `web_pages`) has \"Mailbox works now? Try it again\", and so has the API since 1.9.5: `DELETE /me/email_bounce`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EmailBounce"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EmailBounce": {
        "type": "object",
        "required": [
          "bounced_at",
          "reason",
          "message",
          "help"
        ],
        "properties": {
          "bounced_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it bounced."
          },
          "reason": {
            "type": "string",
            "description": "Why, in a few words: \"that mailbox doesn't exist\", \"it has bounced before, so our mail service won't send to it\", or \"the receiving mail server refused it\".",
            "examples": [
              "that mailbox doesn't exist"
            ]
          },
          "message": {
            "type": "string",
            "description": "The web Profile's line, as written.",
            "examples": [
              "Mail to priya@example.com bounced on 20 Oct 2026 (that mailbox doesn't exist), so we've stopped emailing it, sign-in links included."
            ]
          },
          "help": {
            "type": "string",
            "description": "The line under it, as the web's Profile writes it: what to do for another address. On the web, \"change your email\" links to Profile's Change email, which changes the address the account signs in with; the apps have no Change email of their own, so offer the web's Profile (`/profile`, in `web_pages`), where it's linked, and \"Mailbox works now? Try it again\" follows it. Servers before 1.9.9 said \"To use another address, write to\" the brand's support address, from before Change email (1.9.7).",
            "examples": [
              "To sign in with another address, change your email."
            ]
          }
        }
      },
      "AccountInput": {
        "type": "object",
        "required": [
          "account"
        ],
        "properties": {
          "account": {
            "type": "object",
            "minProperties": 1,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "The person's name, such as \"Asha Rao\"."
              },
              "remove_photo": {
                "type": "boolean",
                "description": "true removes the photo chosen on Profile › Edit; the Google photo, else initials, shows again."
              },
              "whatsapp_hello": {
                "type": "string",
                "maxLength": 500,
                "description": "The hello WhatsApp opens with beside each contact, with `{first_name}`, `{event}` and `{link}` as its only placeholders. `\"\"` goes back to the country's default.",
                "examples": [
                  "Hi {first_name}! Good to meet you at {event}. Here's my card: {link}"
                ]
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The account's country, an ISO 3166 two-letter code (any case), as Profile › Edit's \"Your country\"; null clears it (its \"Choose your country\"). One it doesn't know: `422 validation_failed`, `details.country` \"isn't one we know: choose it from the list\". Since 1.9.10.",
                "examples": [
                  "US"
                ]
              },
              "timezone": {
                "type": "string",
                "description": "The account's time zone, an IANA name (the phone's own, `TimeZone.identifier`), kept in one spelling (\"Asia/Calcutta\" is \"Asia/Kolkata\"), as Profile › Edit's \"Your time zone\". One it doesn't know: `422 validation_failed`, `details.timezone` \"isn't one we know: choose it from the list\"; empty or null: \"can't be empty: choose one from the list\". Since 1.9.10.",
                "examples": [
                  "America/Chicago"
                ]
              },
              "language": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "What the person reads eKard in, one of `GET /me`'s `languages` by its `code`, as Profile › Language; `message` is the web's notice in the language chosen (\"अब eKard आपके लिए हिन्दी में है।\"). null: the phone's own, the first of the eight in the request's `Accept-Language`, else English. Another code: `422 validation_failed` in the web's words, in the account's language (`details.language`). Since 1.9.10. Since 1.9.13 each kard that follows the account's language (`settings.languages_chosen` false) keeps what it says to others, its languages stored as they were, and `message` says so after the notice (\"आपका कार्ड दूसरों के लिए English में ही रहेगा।\"); a kard made after follows the new language.",
                "examples": [
                  "hi"
                ]
              }
            }
          }
        }
      },
      "AccountMultipart": {
        "type": "object",
        "description": "The same fields, named account[field], plus the photo (JPEG, PNG, GIF or WebP, up to 5 MB) or account[remove_photo]=1.",
        "properties": {
          "account[name]": {
            "type": "string"
          },
          "account[photo]": {
            "type": "string",
            "contentMediaType": "image/jpeg"
          },
          "account[remove_photo]": {
            "type": "string",
            "enum": [
              "1"
            ]
          },
          "account[whatsapp_hello]": {
            "type": "string",
            "maxLength": 500
          },
          "account[country]": {
            "type": "string"
          },
          "account[timezone]": {
            "type": "string"
          },
          "account[language]": {
            "type": "string",
            "enum": [
              "en",
              "hi",
              "es",
              "pt",
              "fr",
              "ar",
              "id",
              "de"
            ]
          }
        }
      },
      "WhatsappHello": {
        "type": "object",
        "description": "The hello WhatsApp opens with beside each contact (each contact's `whatsapp_url` carries it, filled in for them), as the web's Profile › Edit shows it under \"Your WhatsApp hello\": the person's own words, else the default in their country's language. Three placeholders are the only markup: `{first_name}` (the contact's first name), `{event}` (the event they were met at: for anyone not met at one, the sentence that holds it is left out) and `{link}` (the kard they came to). The person still presses send.",
        "required": [
          "text",
          "own",
          "default_text",
          "sample",
          "defaults",
          "max_length"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "The hello in force, with its placeholders, as the field shows it to edit.",
            "examples": [
              "Hi {first_name}! Good to meet you at {event}. Here's my card, with all my details: {link}"
            ]
          },
          "own": {
            "type": "boolean",
            "description": "True when the person wrote it; false while it's the default (the web's Profile says \"…, the default for now\")."
          },
          "default_text": {
            "type": "string",
            "description": "The default in the account's country's language (English where there's none of its own): what an empty hello goes back to."
          },
          "sample": {
            "type": "object",
            "description": "The hello as it reads for a sample person met at an event, with the link of the person's own first kard (the web's preview: \"For Sam, met at Expo 2026, it reads\"). Fill in `text` the same way for a live preview while it's edited.",
            "required": [
              "first_name",
              "event",
              "link",
              "text"
            ],
            "properties": {
              "first_name": {
                "type": "string",
                "examples": [
                  "Sam"
                ]
              },
              "event": {
                "type": "string",
                "examples": [
                  "Expo 2026"
                ]
              },
              "link": {
                "type": "string",
                "format": "uri"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "defaults": {
            "type": "array",
            "description": "The defaults to start again from, one per language, in the web's order (the chips under \"Start again from the default in\"). Beside the English, AI drafts.",
            "items": {
              "type": "object",
              "required": [
                "language",
                "name",
                "dir",
                "text"
              ],
              "properties": {
                "language": {
                  "type": "string",
                  "examples": [
                    "en",
                    "hi",
                    "es"
                  ]
                },
                "name": {
                  "type": "string",
                  "description": "The language's own name.",
                  "examples": [
                    "English",
                    "हिन्दी",
                    "Español"
                  ]
                },
                "dir": {
                  "type": "string",
                  "enum": [
                    "ltr",
                    "rtl"
                  ]
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "max_length": {
            "type": "integer",
            "examples": [
              500
            ]
          }
        }
      },
      "SignInNonce": {
        "type": "object",
        "required": [
          "nonce",
          "expires_at"
        ],
        "properties": {
          "nonce": {
            "type": "string",
            "description": "URL-safe. Signed by the server; it signs in once."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AppDevice": {
        "type": "object",
        "description": "The device signing in, as the person's list of devices shows it.",
        "required": [
          "platform"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60,
            "description": "Its model, such as \"Pixel 7a\" or \"iPhone 15\" (longer names are cut to 60 characters). Default \"Android phone\", or \"iPhone\"."
          },
          "platform": {
            "type": "string",
            "description": "`android`, or `ios` for the iPhone app.",
            "enum": [
              "android",
              "ios"
            ]
          },
          "app_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Such as \"1.2.0 (1203)\"."
          },
          "os_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Such as \"Android 15\" or \"iOS 26.3\"."
          }
        }
      },
      "GoogleSignInInput": {
        "type": "object",
        "required": [
          "id_token",
          "nonce",
          "device"
        ],
        "properties": {
          "id_token": {
            "type": "string",
            "description": "The Google ID token from Credential Manager (on iPhone, from Google's sign-in page for the iOS client)."
          },
          "nonce": {
            "type": "string",
            "description": "The nonce the ID token was asked for with."
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "AppleSignInInput": {
        "type": "object",
        "required": [
          "identity_token",
          "authorization_code",
          "nonce",
          "device"
        ],
        "properties": {
          "identity_token": {
            "type": "string",
            "description": "`ASAuthorizationAppleIDCredential.identityToken` as UTF-8 text: the JWT Apple signed."
          },
          "authorization_code": {
            "type": "string",
            "description": "`ASAuthorizationAppleIDCredential.authorizationCode` as UTF-8 text. It works once, for 5 minutes: the server trades it for Apple's refresh token."
          },
          "nonce": {
            "type": "string",
            "description": "The nonce from `GET /sessions/nonce` itself. The Apple request carried its SHA-256, as lower-case hex."
          },
          "name": {
            "$ref": "#/components/schemas/AppleName"
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "AppleName": {
        "type": "object",
        "description": "`credential.fullName`, which Apple gives at the first sign-in only. It names a new account, or one with no name yet; it never replaces a name.",
        "properties": {
          "given_name": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Rhea"
            ]
          },
          "family_name": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Kapoor"
            ]
          }
        }
      },
      "PasswordSignInInput": {
        "type": "object",
        "required": [
          "email",
          "password",
          "device"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "description": "8 characters or more for a new account."
          },
          "name": {
            "type": "string",
            "description": "The person's name, kept when the email makes a new account. Since 1.9.14 a name holding a web address, an email address or a phone number is refused before the account is made: `422 validation_failed` with `details.name` and a `message` to show under the name (\"Name can't hold a web address: it goes into emails we send. Take out “calendar.app.google/…” and add it to your Kard, under Links\")."
          },
          "create": {
            "type": "boolean",
            "default": false,
            "description": "Make the account when no account uses the email (the person said yes to creating one). Without it, an unknown email is `401 no_account`."
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "PasswordResetInput": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "SignInLinkInput": {
        "type": "object",
        "required": [
          "email",
          "device_nonce"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "device_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{32,128}$",
            "description": "A random value this install of the app makes for this ask (32 random bytes as base64url is 43 characters) and keeps on the device, beside the address, for 15 minutes. Send it again with the link's token, and nowhere else."
          },
          "with_code": {
            "type": "boolean",
            "default": false,
            "description": "This screen takes a code: the email carries an 8-digit code beside the link, and the `202` an `ask_id` to send it with (`POST /sessions/email_link/code`). A build without the field leaves it out, and its email has no code. A server before 1.9.4 ignores it (its `202` has no `ask_id`: show no field)."
          }
        }
      },
      "EmailCodeSignInInput": {
        "type": "object",
        "required": [
          "ask_id",
          "code",
          "device_nonce",
          "device"
        ],
        "properties": {
          "ask_id": {
            "type": "string",
            "description": "The `202`'s `ask_id` (from `POST /sessions/email_link` with `with_code: true`), as it came."
          },
          "code": {
            "type": "string",
            "description": "The code as typed, as a string: spaces, dashes and dots are fine, and so are any script's digits (Arabic-Indic, Devanagari, full-width), which the server reads as 0 to 9. Keep it out of logs, analytics, navigation arguments and crash reports.",
            "examples": [
              "4821 7390"
            ]
          },
          "device_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{32,128}$",
            "description": "The nonce this ask was made with. Another one, or none, never finds the ask."
          },
          "claim": {
            "type": "boolean",
            "default": false,
            "description": "The person pressed `button` after `409 confirm_claim`'s words: claim the account nobody had verified. Never send it before."
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "EmailLinkSignInInput": {
        "type": "object",
        "required": [
          "token",
          "device"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The `token` query parameter of the link the app opened (`/sign-in-link/open?token=…&bind=…&app=1`), percent-decoded."
          },
          "bind": {
            "type": "string",
            "description": "The `bind` query parameter of the same link, as it is, when it has one: it ties the link to the `device_nonce` it was asked with. Keep it, the token and the nonce out of logs and crash reports."
          },
          "device_nonce": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{32,128}$",
            "description": "The `device_nonce` this device asked for a link to this address with, while it keeps it (15 minutes). Leave it out when this device didn't ask."
          },
          "claim": {
            "type": "boolean",
            "default": false,
            "description": "The person pressed `button` after `409 confirm_claim`'s words: claim the account nobody had verified. Never send it before."
          },
          "confirm": {
            "type": "boolean",
            "default": false,
            "description": "The person pressed `button` after `409 confirm_sign_in`'s words: sign in with a link this device didn't ask for. Never send it before."
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "EmailLinkSignIn": {
        "type": "object",
        "required": [
          "session",
          "account",
          "created",
          "claimed",
          "message"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/AppSessionTokens"
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "created": {
            "type": "boolean",
            "description": "No account used the address, so the link made it just now (verified, with no password)."
          },
          "claimed": {
            "type": "boolean",
            "description": "This request claimed an account nobody had verified: it's this person's alone now, its password and AI key were removed, and every other device and browser signed out. False when it was verified another way before the claim reached it, even with `claim: true`."
          },
          "message": {
            "type": "string",
            "description": "What happened, in the web's words, to show as written.",
            "examples": [
              "Signed in as meera@example.com.",
              "Signed in as meera@example.com. Your eKard account is ready.",
              "Signed in as meera@example.com. Your address is confirmed, and the account is yours alone. Every other browser and phone was signed out, and the old password no longer works: set a new one any time with \"Forgot password\".",
              "Signed in as meera@example.com. Nobody has confirmed this address yet, so the account's password and other sign-ins still work. To confirm it, sign out, ask for a sign-in link on this phone and open it here."
            ]
          }
        }
      },
      "EmailLinkConfirmation": {
        "type": "object",
        "description": "`409` from `POST /sessions/email_link/sign_in`, or `confirm_claim` from `POST /sessions/email_link/code`: what the person sees before signing in. Nothing was used; the link (or the code) still works.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "email",
              "new_account",
              "button"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "confirm_claim",
                  "confirm_sign_in"
                ],
                "description": "`confirm_claim`: send again with `claim: true`. `confirm_sign_in` (the link only): send again with `confirm: true`."
              },
              "message": {
                "type": "string",
                "description": "The words to show above the button, as written. `confirm_claim`'s name only what this account has: its password, its AI key, apps it connected (before field round 1's fixes, every account heard of a password and an AI key).",
                "examples": [
                  "Signing in confirms this address is yours, and makes the account yours alone. Your other phones and browsers will be signed out. The old password stops working too: sign in there with a link or a code, and set a new password any time with “Forgot password?” on the sign-in page.",
                  "This link was asked for in a browser or on another device. It signs this phone in as meera@example.com."
                ]
              },
              "email": {
                "type": "string",
                "format": "email",
                "description": "The account the link or code signs in to (or makes)."
              },
              "new_account": {
                "type": "boolean",
                "description": "No account uses the address yet; signing in makes one."
              },
              "button": {
                "type": "string",
                "examples": [
                  "Confirm and sign in",
                  "Sign in"
                ]
              }
            }
          }
        }
      },
      "RefreshInput": {
        "type": "object",
        "description": "`device` is for `POST /sessions/refresh` (revoke ignores it): the device as at sign-in, as it is now, so the list of devices names an updated app by its new version. Its `name`, `app_version` and `os_version` replace the session's (one left out or blank keeps the session's); `platform` stays the sign-in's. Optional: a refresh without it, or with one the server can't read, still answers.",
        "required": [
          "refresh_token"
        ],
        "properties": {
          "refresh_token": {
            "type": "string"
          },
          "device": {
            "$ref": "#/components/schemas/AppDevice"
          }
        }
      },
      "AppSessionTokens": {
        "type": "object",
        "description": "A device's tokens. They are shown only here; the server keeps digests.",
        "required": [
          "id",
          "access_token",
          "access_token_expires_at",
          "refresh_token",
          "refresh_token_expires_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The session, as GET /sessions lists it."
          },
          "access_token": {
            "type": "string",
            "description": "\"eka_\" and 43 characters. Send it as `Authorization: Bearer <token>`."
          },
          "access_token_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "refresh_token": {
            "type": "string",
            "description": "\"ekr_\" and 43 characters. Store it encrypted; it is replaced on every refresh."
          },
          "refresh_token_expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AppSignIn": {
        "type": "object",
        "required": [
          "session",
          "account",
          "created"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/AppSessionTokens"
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "created": {
            "type": "boolean",
            "description": "The email was new, so the account was made just now."
          }
        }
      },
      "AppSessionRefresh": {
        "type": "object",
        "required": [
          "session"
        ],
        "properties": {
          "session": {
            "$ref": "#/components/schemas/AppSessionTokens"
          }
        }
      },
      "AppSessionSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "platform",
          "app_version",
          "os_version",
          "created_at",
          "last_used_at",
          "current"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "A phone's and a browser's ids never meet."
          },
          "name": {
            "type": "string",
            "description": "A phone's own name, or a browser and its system: \"Chrome on Windows\", \"Safari on iPhone\", \"A browser\"."
          },
          "platform": {
            "type": "string",
            "description": "`android`, `ios`, or `web` for a browser (only with `include=web`); a browser has no `app_version` or `os_version`, and is never `current`."
          },
          "app_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "os_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the device signed in."
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Within 5 minutes."
          },
          "current": {
            "type": "boolean",
            "description": "The session making this request."
          }
        }
      },
      "AppSessionList": {
        "type": "object",
        "required": [
          "sessions"
        ],
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppSessionSummary"
            }
          }
        }
      },
      "TeamInvitationEnvelope": {
        "type": "object",
        "required": [
          "invitation"
        ],
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/TeamInvitation"
          }
        }
      },
      "TeamInvitation": {
        "type": "object",
        "description": "An invitation to a calendar's team, as the invitee sees it.",
        "required": [
          "calendar",
          "organization",
          "role",
          "role_name",
          "provider",
          "invited_by",
          "invited_email_masked",
          "status",
          "expires_at",
          "matches_signed_in_account",
          "refusal"
        ],
        "properties": {
          "calendar": {
            "$ref": "#/components/schemas/NameOnly"
          },
          "organization": {
            "$ref": "#/components/schemas/NameOnly"
          },
          "role": {
            "type": "string",
            "enum": [
              "staff",
              "front_desk"
            ]
          },
          "role_name": {
            "type": "string",
            "description": "\"front desk\", or the calendar's word for a team member (\"stylist\", \"team member\"), lower case."
          },
          "provider": {
            "description": "The team member the login signs in as (staff).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NameOnly"
              }
            ]
          },
          "invited_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NameOnly"
              }
            ]
          },
          "invited_email_masked": {
            "type": "string",
            "examples": [
              "p•••••@example.com"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "expired",
              "revoked",
              "accepted"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "matches_signed_in_account": {
            "type": "boolean",
            "description": "The key's account has the invited email."
          },
          "refusal": {
            "description": "What stops the key's account (or, without a key, anyone) from joining now; null when it can.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TeamInvitationRefusal"
              }
            ]
          }
        }
      },
      "TeamInvitationRefusal": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "sign_in_required",
              "email_mismatch",
              "email_unverified",
              "expired",
              "revoked",
              "used",
              "access_removed",
              "provider_taken",
              "other_provider"
            ]
          },
          "message": {
            "type": "string",
            "description": "The web page's words for it, to show as they are."
          },
          "verify_url": {
            "type": "string",
            "format": "uri",
            "description": "Only with `email_unverified`: POST it with the same session to email the link that verifies the address (`POST /me/email_verification`)."
          }
        }
      },
      "TeamInvitationAccepted": {
        "type": "object",
        "required": [
          "calendar",
          "message"
        ],
        "properties": {
          "calendar": {
            "type": "object",
            "required": [
              "id",
              "name",
              "role"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "staff",
                  "front_desk"
                ]
              }
            }
          },
          "message": {
            "type": "string",
            "examples": [
              "You've joined Glow Studio's calendar as Priya Sharma."
            ]
          }
        }
      },
      "NameOnly": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          }
        }
      },
      "WebSessionInput": {
        "type": "object",
        "required": [
          "return_to"
        ],
        "properties": {
          "return_to": {
            "type": "string",
            "maxLength": 500,
            "description": "One of the web-only pages the app opens (`AppConfig.web_pages`), such as /calendar/settings; a query string may follow, then a fragment naming a place on the page, as the web's link has it (`/organizations/glowstudio/edit#logo`): a letter, then up to 63 letters, digits, `-` or `_`. Match the page against `web_pages` without its query and fragment."
          }
        }
      },
      "WebSession": {
        "type": "object",
        "required": [
          "url",
          "expires_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Open it once, in a Custom Tab; the page asks to continue as this account unless that browser already is."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CalendarSyncHandoffInput": {
        "type": "object",
        "properties": {
          "add_events": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CalendarSyncHandoff": {
        "type": "object",
        "required": [
          "url",
          "expires_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicKardLookup": {
        "type": "object",
        "required": [
          "kard",
          "viewer"
        ],
        "properties": {
          "kard": {
            "$ref": "#/components/schemas/PublicKard"
          },
          "viewer": {
            "$ref": "#/components/schemas/PublicKardViewer"
          }
        }
      },
      "PublicKard": {
        "type": "object",
        "description": "What the kard's public page shows. A kard switched off for a while (`is_active` false) shows its name and photo only, as its \"switched off for now\" page does: `share_link`, `organization`, `name`, `languages`, the name in `translations`, `photo_url`, `photo_thumb_url` and `public_url`; every other field null, empty or false (since 1.9.14 its page is that page wherever a visitor reaches it).",
        "required": [
          "share_link",
          "organization",
          "name",
          "tagline",
          "photo_url",
          "photo_thumb_url",
          "public_url",
          "vcard_url",
          "links",
          "payment_methods",
          "address",
          "custom_links",
          "accepts_bookings",
          "booking_url",
          "book_label",
          "is_active",
          "languages",
          "translations"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "organization": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PublicKardOrganization"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "tagline": {
            "type": [
              "string",
              "null"
            ]
          },
          "job_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kard's own company; null on a team kard means its organization's name (what its contact card's ORG says)."
          },
          "languages": {
            "$ref": "#/components/schemas/KardLanguages"
          },
          "translations": {
            "description": "The name, job title and company its owner wrote in the kard's second language, as its page shows them to a visitor reading that language: only the second language's, `{}` without one. `company` and `job_title` are null on an inactive kard, as the fields beside them are.",
            "allOf": [
              {
                "$ref": "#/components/schemas/KardTranslations"
              }
            ]
          },
          "photo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "photo_thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "A 384-pixel WebP copy, for avatars and lists."
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "google_review_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "“Review us on Google”: opens Google's review form for the business. Null without one, and on an inactive kard."
          },
          "whatsapp_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The kard's WhatsApp as its page opens it for a visitor: `https://wa.me/{digits}`, with `?text=` and the owner's first line, URL-encoded, when they've turned it on (the default in English when they wrote none). Open it as it is rather than building `wa.me` from `links.whatsapp_number`. Null without a WhatsApp number, and on an inactive kard.",
            "examples": [
              "https://wa.me/919820012345?text=Hi%20Priya%2C%20I%20found%20you%20on%20eKard%20and%20I%27d%20like%20to%20know%20more."
            ]
          },
          "vcard_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The contact card (.vcf) to save to the phone."
          },
          "links": {
            "$ref": "#/components/schemas/SocialHandles"
          },
          "payment_methods": {
            "type": "array",
            "description": "Ways to pay the owner, what their country uses first; empty on an inactive kard.",
            "items": {
              "$ref": "#/components/schemas/PaymentMethod"
            }
          },
          "address": {
            "description": "The street address as the page shows it, with its Directions link; null when the owner keeps it for the contact card only, has none, or the kard is inactive.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/KardAddress"
              },
              {
                "type": "null"
              }
            ]
          },
          "custom_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomLink"
            }
          },
          "accepts_bookings": {
            "type": "boolean"
          },
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "book_label": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Book a session",
              "Book with Priya"
            ]
          },
          "is_active": {
            "type": "boolean"
          },
          "products": {
            "type": "array",
            "description": "What the kard sells, as its page shows them (since 1.9.7): the products its plan shows, in the owner's order, each with its one button as a visitor gets it. Empty for an inactive kard.",
            "items": {
              "$ref": "#/components/schemas/PublicProduct"
            }
          },
          "products_heading": {
            "type": [
              "string",
              "null"
            ],
            "description": "The owner's heading for them, as written; null for the default (\"Products\", in the viewer's language)."
          },
          "left_team": {
            "description": "Since 1.9.14: the kard of someone who left its team, as its page draws it. Its holder moved on, and whoever still has its card or link reaches the team: `name` is the team's own kard's, and `links` its phone, email and website, `address` its address, `vcard_url` saves the team's contact; nothing of the person who left (no photo, title, products or booking; `can_share_back` false, as the page has no exchange). Show the web's line above it, \"The person on this card has moved on.\" (`left_team.moved_on` in the visitor words), and a button to the team's own kard (\"See %{team}'s card\", `left_team.team_card`). With the team's own kard switched off, a visitor gets its \"switched off for now\" page instead: its name and photo, `is_active` false, and no `left_team`. Absent on any other kard.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "organization",
                  "public_url"
                ],
                "properties": {
                  "share_link": {
                    "type": "string",
                    "description": "The team's own kard."
                  },
                  "organization": {
                    "type": "string",
                    "description": "Its organization's slug."
                  },
                  "public_url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            ]
          }
        }
      },
      "PublicProduct": {
        "type": "object",
        "required": [
          "id",
          "name",
          "line",
          "price",
          "action",
          "paid_link",
          "available",
          "condition",
          "origin_country",
          "photo"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "line": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": "object",
            "required": [
              "amount_minor",
              "currency",
              "mode",
              "text"
            ],
            "properties": {
              "amount_minor": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "currency": {
                "type": "string"
              },
              "mode": {
                "type": "string",
                "enum": [
                  "fixed",
                  "from",
                  "ask"
                ]
              },
              "text": {
                "type": "string",
                "description": "\"₹1,800\", \"From $25\", \"Ask for price\" (English)."
              }
            }
          },
          "action": {
            "description": "The one button, as the kard's page gives it: `whatsapp` (the chat with the product's line written), `pay` (UPI with the amount and the product's name as its note, or the kard's first way to pay), `ask` (the kard's exchange: `url` is null, open the kard's exchange sheet), `link` (the product's own page; `paid_link` true says the owner earns from it), or `sold_out` (no `url`). Null when the button can't work now (no WhatsApp number, no way to be paid, the exchange off).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "label",
                  "url"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "whatsapp",
                      "pay",
                      "ask",
                      "link",
                      "sold_out"
                    ]
                  },
                  "label": {
                    "type": "string",
                    "description": "The button's words, in English."
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "paid_link": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "condition": {
            "type": "string",
            "enum": [
              "new",
              "used",
              "refurbished"
            ]
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "photo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "tile_url",
                  "detail_url"
                ],
                "properties": {
                  "tile_url": {
                    "type": "string"
                  },
                  "detail_url": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "PublicKardOrganization": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "logo_url"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "PublicKardViewer": {
        "type": "object",
        "description": "The person asking, and this kard.",
        "required": [
          "is_mine",
          "bookmarked",
          "bookmark_id",
          "can_share_back",
          "my_kards"
        ],
        "properties": {
          "is_mine": {
            "type": "boolean",
            "description": "Their own, or their organization's (as an admin)."
          },
          "bookmarked": {
            "type": "boolean"
          },
          "bookmark_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "can_share_back": {
            "type": "boolean",
            "description": "They have kards to share back (POST /exchanges), this isn't theirs, and its page offers the exchange: false for a kard switched off for now (POST /exchanges answers `422 switched_off`) and for a leaver's kard (`left_team`), since 1.9.14."
          },
          "my_kards": {
            "type": "array",
            "description": "The kards they can share back, personal ones first.",
            "items": {
              "$ref": "#/components/schemas/ShareableKard"
            }
          }
        }
      },
      "ShareableKard": {
        "type": "object",
        "required": [
          "share_link",
          "name",
          "organization"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "description": "The organization's slug, for an organization's kard."
          }
        }
      },
      "ExchangeInput": {
        "type": "object",
        "required": [
          "to",
          "from_kard"
        ],
        "properties": {
          "to": {
            "description": "The other kard, as a link (any shape GET /public_kards/lookup reads) or a share_link with its organization.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "share_link"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "organization": {
                    "type": "string",
                    "description": "The organization's slug, for an organization's kard."
                  }
                }
              }
            ]
          },
          "from_kard": {
            "type": "string",
            "description": "The share_link of the account's own kard to share."
          },
          "from_organization": {
            "type": "string",
            "description": "The organization of `from_kard`, when two of the account's kards use the share_link."
          },
          "note": {
            "type": "string",
            "maxLength": 1000
          },
          "bookmark": {
            "type": "boolean",
            "default": true,
            "description": "Keep their kard in the account's bookmarks."
          }
        }
      },
      "ExchangeResult": {
        "type": "object",
        "required": [
          "contact",
          "bookmark",
          "message"
        ],
        "properties": {
          "contact": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "description": "The share-back in the other kard's contacts."
              }
            }
          },
          "bookmark": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Bookmark"
              }
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "Shared Asha Rao with Ravi Mehta. You saved their card too."
            ]
          }
        }
      },
      "KardBlock": {
        "type": "object",
        "required": [
          "id",
          "contact_id",
          "name",
          "email",
          "phone",
          "by_account",
          "known_by",
          "blocked_by",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "contact_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The contact it was blocked from; null once that contact is deleted (the block stays)."
          },
          "name": {
            "type": "string",
            "description": "Their name on that contact."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "The number they're blocked by, as + and its digits."
          },
          "by_account": {
            "type": "boolean",
            "description": "True when they're blocked by their eKard account too (they shared their own kard back)."
          },
          "known_by": {
            "type": "string",
            "description": "What they're blocked by, in words.",
            "examples": [
              "ravi@mehta.example and +919820123456"
            ]
          },
          "blocked_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "name",
                  "email"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": "string"
                  }
                }
              }
            ],
            "description": "Who blocked them (null once that account is deleted)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ContactBlockState": {
        "type": "object",
        "required": [
          "block",
          "blockable"
        ],
        "properties": {
          "block": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/KardBlock"
              }
            ]
          },
          "blockable": {
            "type": "boolean",
            "description": "False when the contact has no email address, number or shared card to block them by."
          },
          "message": {
            "type": "string",
            "description": "After a block or unblock, what happened, to show as written.",
            "examples": [
              "Ravi is blocked. What they send Asha Rao from now on is dropped, and nobody is told."
            ]
          }
        }
      },
      "ComplaintCategory": {
        "type": "object",
        "required": [
          "key",
          "label",
          "hint",
          "officer_label",
          "clock_seconds",
          "clock",
          "needs_order_reference"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "impersonation",
              "intimate",
              "order",
              "unlawful",
              "other"
            ]
          },
          "label": {
            "type": "string",
            "description": "The choice as the form words it.",
            "examples": [
              "It pretends to be me, or someone else"
            ]
          },
          "hint": {
            "type": "string"
          },
          "officer_label": {
            "type": "string",
            "examples": [
              "Impersonation"
            ]
          },
          "clock_seconds": {
            "type": "integer",
            "description": "How long we have to act on it."
          },
          "clock": {
            "type": "string",
            "examples": [
              "2 hours",
              "7 days"
            ]
          },
          "needs_order_reference": {
            "type": "boolean",
            "description": "True for a court or government order, which needs `order_reference`."
          }
        }
      },
      "ComplaintForm": {
        "type": "object",
        "required": [
          "form_url",
          "officer",
          "categories",
          "evidence",
          "reporter",
          "declaration"
        ],
        "properties": {
          "form_url": {
            "type": "string",
            "format": "uri"
          },
          "officer": {
            "type": "object",
            "required": [
              "name",
              "appointed",
              "designation",
              "email",
              "phone",
              "address_lines"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "appointed": {
                "type": "boolean"
              },
              "designation": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": "string"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "address_lines": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ComplaintCategory"
            }
          },
          "evidence": {
            "type": "object",
            "required": [
              "limit",
              "max_bytes",
              "types"
            ],
            "properties": {
              "limit": {
                "type": "integer"
              },
              "max_bytes": {
                "type": "integer"
              },
              "types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "reporter": {
            "type": "object",
            "required": [
              "name",
              "email"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": "string"
              }
            }
          },
          "declaration": {
            "type": "string",
            "examples": [
              "What I've written is true to the best of my knowledge."
            ]
          }
        }
      },
      "ComplaintFields": {
        "type": "object",
        "required": [
          "reported_url",
          "category",
          "details"
        ],
        "properties": {
          "reported_url": {
            "type": "string",
            "maxLength": 2000,
            "description": "The link to what's reported (a kard's `public_url`, its booking page or a file's link)."
          },
          "category": {
            "type": "string",
            "enum": [
              "impersonation",
              "intimate",
              "order",
              "unlawful",
              "other"
            ]
          },
          "details": {
            "type": "string",
            "maxLength": 5000,
            "description": "What's wrong, and where on the page."
          },
          "order_reference": {
            "type": "string",
            "maxLength": 500,
            "description": "For `order` only, and needed then: who issued it, its number and date."
          },
          "reporter_name": {
            "type": "string",
            "maxLength": 200
          },
          "reporter_email": {
            "type": "string",
            "maxLength": 254
          },
          "reporter_phone": {
            "type": "string",
            "maxLength": 40
          },
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "description": "Your key for this report, a random one (a UUID), never one made from the report (such as the link reported). Keys are per account: a key matches only reports this account sent, whatever `reporter_email` says, so nobody else's report is found or held back by it. Sending it again from this account answers 200 with the first case: no second case, clock or email (a retry after a lost answer)."
          }
        }
      },
      "ComplaintInput": {
        "type": "object",
        "required": [
          "grievance",
          "declaration"
        ],
        "properties": {
          "grievance": {
            "$ref": "#/components/schemas/ComplaintFields"
          },
          "declaration": {
            "type": "boolean"
          }
        }
      },
      "ComplaintMultipart": {
        "type": "object",
        "description": "The same fields as `grievance[reported_url]`, `grievance[category]` and so on, `declaration=1`, and the files in `grievance[evidence][]`.",
        "properties": {
          "grievance[reported_url]": {
            "type": "string"
          },
          "grievance[category]": {
            "type": "string"
          },
          "grievance[details]": {
            "type": "string"
          },
          "grievance[idempotency_key]": {
            "type": "string",
            "maxLength": 100
          },
          "grievance[evidence][]": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "contentMediaType": "application/octet-stream"
            }
          },
          "declaration": {
            "type": "string"
          }
        }
      },
      "ComplaintFiled": {
        "type": "object",
        "required": [
          "grievance",
          "message"
        ],
        "properties": {
          "grievance": {
            "type": "object",
            "required": [
              "reference",
              "category",
              "label",
              "received_at",
              "due_at",
              "clock",
              "evidence",
              "evidence_refused",
              "case_url"
            ],
            "properties": {
              "reference": {
                "type": "string",
                "examples": [
                  "GR-7KQ2MX"
                ]
              },
              "category": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "received_at": {
                "type": "string",
                "format": "date-time"
              },
              "due_at": {
                "type": "string",
                "format": "date-time",
                "description": "When we act on it by."
              },
              "clock": {
                "type": "string"
              },
              "evidence": {
                "type": "array",
                "description": "The names of the files kept as evidence.",
                "items": {
                  "type": "string"
                }
              },
              "evidence_refused": {
                "type": "array",
                "description": "Files the storage didn't take: the case is filed without them, and `message` asks the reporter to reply to the acknowledgement with them. Usually empty.",
                "items": {
                  "type": "string"
                }
              },
              "case_url": {
                "type": "string",
                "format": "uri",
                "description": "The reporter's own page on the case. No sign-in needed; keep it private."
              }
            }
          },
          "message": {
            "type": "string",
            "examples": [
              "We've got your complaint, GR-7KQ2MX. We act on it within 2 hours, by 19 Oct 2026, 6:05 pm IST, and we've emailed you a copy at asha@example.com."
            ]
          }
        }
      },
      "ContactCardParseInput": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 4000,
            "description": "The card's text, as the phone's text recognition read it."
          },
          "locale_hint": {
            "type": "string",
            "description": "The phone's locale, such as \"en-IN\": local numbers are read as numbers of that country."
          }
        }
      },
      "ContactCardParse": {
        "type": "object",
        "required": [
          "card",
          "confidence"
        ],
        "properties": {
          "card": {
            "$ref": "#/components/schemas/ParsedContactCard"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "description": "`high`: the card read cleanly; `medium`: a field is a guess; `low`: much of the text was garbled."
          }
        }
      },
      "ParsedContactCard": {
        "type": "object",
        "required": [
          "name",
          "job_title",
          "company",
          "website",
          "address",
          "notes",
          "phones",
          "emails"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 70
          },
          "job_title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "With `https://` when the card printed none (`www.example.com` comes as `https://www.example.com`), so it goes into a kard as it is; null when it isn't an http(s) address (`mailto:`, `javascript:`, a word)."
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "phones": {
            "type": "array",
            "maxItems": 10,
            "description": "The person's own mobile first; international form where the locale tells the country.",
            "items": {
              "type": "string"
            }
          },
          "emails": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "format": "email"
            }
          }
        }
      },
      "AppConfig": {
        "type": "object",
        "required": [
          "platform",
          "min_supported_version_code",
          "latest_version_code",
          "update_required",
          "update_available",
          "update_message",
          "store_url",
          "support_email",
          "privacy_policy_url",
          "terms_url",
          "features",
          "web_pages",
          "route_words"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "description": "The platform asked about, `android` or `ios`."
          },
          "min_supported_version_code": {
            "type": "integer",
            "description": "That platform's oldest build still allowed (Android's version code, the iPhone app's `CFBundleVersion`)."
          },
          "latest_version_code": {
            "type": "integer",
            "description": "That platform's newest build."
          },
          "update_required": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The version_code asked about is under the minimum; null without one."
          },
          "update_available": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The version_code asked about is under the latest; null without one."
          },
          "update_message": {
            "type": "string",
            "description": "What the update screen says, in the brand's words."
          },
          "store_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The app's page in its store: Google Play for `android`, the App Store for `ios`. Null until the app is in that store."
          },
          "support_email": {
            "type": "string",
            "format": "email"
          },
          "privacy_policy_url": {
            "type": "string",
            "format": "uri",
            "description": "The brand's privacy policy, for the sign-in screen and the app's settings."
          },
          "terms_url": {
            "type": "string",
            "format": "uri",
            "description": "The brand's Terms and Conditions."
          },
          "features": {
            "$ref": "#/components/schemas/AppFeatures"
          },
          "web_pages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The web-only pages the app opens signed in (`POST /web_sessions`), as path patterns: `*` is one segment, a final `**` anything below (`/organizations/*/calendar/settings`, `/kards/*/design/**`). Open any other page as it is. `/profile` (the web's Profile, where an address that bounced is tried again) since 1.9.2. `/profile/email/new` (Change sign-in email's form, so the app's Change sign-in email lands on it; the change still asks for the password, or a code emailed to the current address, since the link's sign-in isn't a recent one) since 1.9.10. `/kards/*/edit` and `/organizations/*/kards/*/edit` (Edit Kard, the page alone: send `#google_review` to land at its Google reviews panel, \"Find your business on Google\") since 1.9.13 or 1.9.14."
          },
          "route_words": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The first path segment of every page and route on this server, sorted (`account`, `bookings`, `follow-up`, `kards`, `llms.txt`, `pricing`, `teams`…): a link whose first segment is one of these is never a kard's share link or an organization's slug, so don't open it as a kard. Hyphenated words (`calendar-sync`, `follow-up`) are in it too: no share link or slug has a hyphen, and none of those pages is a kard. The server's own list, so the app's copy never goes stale.",
            "examples": [
              [
                "account",
                "admin",
                "api",
                "first-kard",
                "follow-up",
                "kards",
                "organization_invitations",
                "organizations",
                "pricing",
                "teams"
              ]
            ]
          },
          "contact_sources": {
            "type": "array",
            "description": "Every way a contact can arrive (`Contact.source`, and `GET /contacts?source=`), in eKard's words, each `label` the same as a contact's `source_label`: for a filter by source, and for a source the app has no words of its own for. The server's own list, in its order, so one added later shows with its words. Left out by servers before 1.9.3.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label"
              ],
              "properties": {
                "key": {
                  "type": "string",
                  "description": "The `source` value."
                },
                "label": {
                  "type": "string",
                  "description": "It in words."
                }
              }
            },
            "examples": [
              [
                {
                  "key": "exchange",
                  "label": "Sent their details from your Kard"
                },
                {
                  "key": "share_back",
                  "label": "Shared their own Kard back"
                },
                {
                  "key": "booking",
                  "label": "Booked a time from your Kard"
                },
                {
                  "key": "manual",
                  "label": "Typed in by hand"
                },
                {
                  "key": "api",
                  "label": "Added through the API"
                },
                {
                  "key": "suggestion",
                  "label": "Suggested a time from your Kard"
                },
                {
                  "key": "scan",
                  "label": "Read off their paper card"
                },
                {
                  "key": "agent",
                  "label": "Added by an app or AI agent"
                }
              ]
            ]
          }
        }
      },
      "AppFeatures": {
        "type": "object",
        "required": [
          "card_parse",
          "push_notifications",
          "apple_sign_in"
        ],
        "properties": {
          "card_parse": {
            "type": "boolean",
            "description": "POST /contact_cards/parse can read cards here."
          },
          "push_notifications": {
            "type": "boolean",
            "description": "The app's phone can register for notifications here (POST /calendar_notifications): through Firebase for `android`, through Apple's push service for `ios`."
          },
          "apple_sign_in": {
            "type": "boolean",
            "description": "Sign in with Apple works here (POST /sessions/apple): offer it only when true. Always false for `android`."
          },
          "email_link_sign_in": {
            "type": "boolean",
            "description": "Sign-in links by email work here (POST /sessions/email_link): offer \"Email me a sign-in link\" only when true. A server from before them leaves it out: read that as false."
          }
        }
      },
      "AccountDeletionInput": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "description": "Why they're leaving, if they say."
          }
        }
      },
      "AccountDeletionAppleInput": {
        "type": "object",
        "required": [
          "identity_token",
          "authorization_code",
          "nonce"
        ],
        "properties": {
          "identity_token": {
            "type": "string",
            "description": "`ASAuthorizationAppleIDCredential.identityToken` as UTF-8 text, from an Apple request made just now for this confirmation."
          },
          "authorization_code": {
            "type": "string",
            "description": "`ASAuthorizationAppleIDCredential.authorizationCode` as UTF-8 text: the server trades it at once to end the account's link with Apple."
          },
          "nonce": {
            "type": "string",
            "description": "The nonce from `GET /sessions/nonce` itself. The Apple request carried its SHA-256, as lower-case hex."
          },
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "description": "Why they're leaving, if they say."
          }
        }
      },
      "AccountDeletionRequested": {
        "type": "object",
        "required": [
          "message",
          "deletion_request"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "What happens next, for the person."
          },
          "deletion_request": {
            "$ref": "#/components/schemas/AccountDeletionStatus"
          }
        }
      },
      "AccountDeletionStatus": {
        "type": "object",
        "required": [
          "status",
          "requested_at",
          "confirmed_at",
          "deleted_by"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "awaiting_confirmation",
              "confirmed"
            ]
          },
          "requested_at": {
            "type": "string",
            "format": "date-time"
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deleted_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "The latest the account is deleted, once confirmed."
          }
        }
      },
      "Subscription": {
        "description": "The paid plan; null on the free tier.",
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "object",
            "required": [
              "plan",
              "kind",
              "status",
              "active",
              "renews"
            ],
            "properties": {
              "plan": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "kind": {
                "type": "string"
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "active": {
                "type": "boolean",
                "description": "The plan's features are on. A cancelled Professional plan stays active until current_period_end."
              },
              "renews": {
                "type": "boolean",
                "description": "Razorpay may charge again at current_period_end. False for a plan paid once, or once Razorpay confirms a cancellation; true while one waits for Razorpay."
              },
              "current_period_end": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "cancelled_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        ]
      },
      "KardSummary": {
        "type": "object",
        "required": [
          "share_link",
          "name",
          "is_active",
          "organization",
          "organization_name",
          "organization_front_door",
          "public_url",
          "photo_url",
          "photo_thumb_url",
          "qr_image_url",
          "accepts_bookings",
          "booking_url",
          "book_label",
          "can_edit",
          "can_delete",
          "contacts_count",
          "created_at"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tagline": {
            "type": [
              "string",
              "null"
            ]
          },
          "job_title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Under the name on the kard's page, and TITLE in its contact card (`urls.vcard`). Null: the contact card's TITLE is the tagline; a card made offline should do the same."
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Under the name on the kard's page, and ORG in its contact card. Null on a team kard: ORG is `organization_name`; a card made offline should do the same. Only the organization's admins change a team kard's company (`can_edit_company`)."
          },
          "is_active": {
            "type": "boolean",
            "description": "False: switched off for a while; its visitors see a \"switched off for now\" page (`is_active` on the kard)."
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "description": "The organization's slug, for an organization's kard."
          },
          "organization_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "organization_front_door": {
            "type": "boolean",
            "description": "True for an organization's own kard, the one at its slug that stands for the business rather than a person; false for a team kard or a personal one. Its contact card (`urls.vcard`) files it under the business's name (`N` holds the name as the family name, nothing else); a card made offline should do the same."
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "photo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "photo_thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "A 384-pixel WebP copy of the photo, for avatars and lists."
          },
          "qr_image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The designed QR code image (PNG), once it's generated; the plain one is at public_url + /qr."
          },
          "accepts_bookings": {
            "type": "boolean",
            "description": "The kard's page shows a Book button that leads somewhere bookable now."
          },
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "book_label": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Book an appointment",
              "Book with Priya"
            ]
          },
          "can_edit": {
            "type": "boolean",
            "description": "The key's person may change the kard (its owner, an admin of its organization)."
          },
          "can_edit_company": {
            "type": "boolean",
            "description": "The key's person may change `company`: whoever edits a personal kard; on a team kard, its organization's admins only (its holder edits the rest)."
          },
          "can_delete": {
            "type": "boolean",
            "description": "The key's person may delete the kard (`DELETE /kards/{share_link}`): a personal kard's owner; a team kard's organization admins, not the member holding it; an organization's own kard (`organization_front_door`), nobody but a site admin, as it goes only with the organization. Show Delete only when it's true; anyone else gets 403 forbidden, whose message says why."
          },
          "message_first": {
            "type": "string",
            "enum": [
              "text",
              "whatsapp"
            ],
            "description": "Which way to message a number leads on this kard's page and its contacts' rows, as the web decides per kard: the owner's choice in Edit Kard (Social links, \"Text or WhatsApp first\"), else where the kard's phone number is from, else its holder's country: `text` in the US, Canada and Puerto Rico, `whatsapp` elsewhere. Lead with Text (an `sms:` link) or WhatsApp in this order wherever the app offers both for this kard. Left out for a kard hidden after a complaint, and by servers before 1.9.10."
          },
          "yours": {
            "type": "boolean",
            "description": "The key's person holds the kard: it's theirs (a personal kard they own, or the team kard they hold), not one they edit as a team's admin or see as a bookmark. The web's words follow it: \"Show me on “Our team”\" and \"your photo, name and job title\" for their own, \"Show this Kard on “Our team”\" and \"its photo…\" for one an admin edits. Left out by servers before 1.9.3."
          },
          "contacts_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Its contacts, for a kard the person may edit; null otherwise."
          },
          "last_30_days": {
            "description": "Its last 30 days as the web's Kards list says them under each kard, on every plan (since 1.9.13): the visits, and the contacts by how they came. For a kard the person may edit; null otherwise (a bookmark). Left out by servers before 1.9.13.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/KardRecentCounts"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "unavailable": {
            "type": "boolean",
            "description": "Only in bookmarks: true for a kard hidden after a complaint, while it's looked into. Only share_link and public_url are its own; name says it's hidden, and the rest is empty."
          },
          "switched_off": {
            "type": "boolean",
            "description": "Only in bookmarks (since 1.9.14): true for a kard switched off for a while, as its \"switched off for now\" page shows it: its share_link, name, photo_url, photo_thumb_url and public_url, `is_active` false, and the rest empty. Say it's switched off for now, with no way to reach them; switched back on, it's listed as before, without this key."
          }
        }
      },
      "KardRecentCounts": {
        "type": "object",
        "required": [
          "visits",
          "contacts",
          "left_details",
          "added",
          "booked",
          "words",
          "sentence"
        ],
        "description": "A kard's last 30 days. `contacts` is every contact made in them; `left_details`, `added` and `booked` split them by how they came, as the web's Contacts says them: left their details on the kard (its exchange, a card shared back, a time suggested), added by its people (typed in, scanned, by API or an app's agent), booked a time. Visits are its page's own, opened in a browser (crawlers and link taps aren't counted).",
        "properties": {
          "visits": {
            "type": "integer",
            "examples": [
              41
            ]
          },
          "contacts": {
            "type": "integer",
            "examples": [
              6
            ]
          },
          "left_details": {
            "type": "integer",
            "examples": [
              2
            ]
          },
          "added": {
            "type": "integer",
            "examples": [
              4
            ]
          },
          "booked": {
            "type": "integer",
            "examples": [
              0
            ]
          },
          "words": {
            "type": "string",
            "description": "The web's line on a phone, where the list's heading says \"in the last 30 days\" once: the visits, then each way someone came that has any (\"you added\" is \"added by hand\" on a kard the reader doesn't hold); \"No visits or contacts\" with neither. In the language `Owner-Language` asks for, else English.",
            "examples": [
              "41 visits · 2 left their details · 4 you added"
            ]
          },
          "sentence": {
            "type": "string",
            "description": "The web's line on a computer, with the period said: \"41 visits · 2 left their details · 4 you added in the last 30 days\", \"No visits or contacts in the last 30 days\".",
            "examples": [
              "41 visits · 2 left their details · 4 you added in the last 30 days"
            ]
          }
        }
      },
      "KardList": {
        "type": "object",
        "required": [
          "kards"
        ],
        "properties": {
          "kards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KardSummary"
            }
          }
        }
      },
      "Kard": {
        "allOf": [
          {
            "$ref": "#/components/schemas/KardSummary"
          },
          {
            "$ref": "#/components/schemas/SocialHandles"
          },
          {
            "$ref": "#/components/schemas/PaymentHandles"
          },
          {
            "$ref": "#/components/schemas/KardAddressFields"
          },
          {
            "type": "object",
            "required": [
              "indexable",
              "settings",
              "custom_links",
              "urls",
              "custom_design",
              "counts",
              "custom_domain",
              "updated_at",
              "payment_methods",
              "address",
              "launch_checklist",
              "search_offer",
              "wallpaper_styles",
              "picture_occasions",
              "contact_form",
              "languages",
              "translations"
            ],
            "properties": {
              "languages": {
                "$ref": "#/components/schemas/KardLanguages"
              },
              "translations": {
                "$ref": "#/components/schemas/KardTranslations"
              },
              "contact_form": {
                "$ref": "#/components/schemas/ContactForm"
              },
              "picture_occasions": {
                "type": "array",
                "description": "The greetings a picture to post can carry (`GET /kards/{share_link}/picture.png?occasion=`), in the web's order and words: `none` first, then the region-neutral ones, then each festival's, alphabetically. `greeting` and `message` are the words drawn when none of your own are sent, in the Kard's main language (an Arabic Kard's `eid` greeting is \"عيد مبارك\"); `label` is English.",
                "items": {
                  "$ref": "#/components/schemas/PictureOccasion"
                }
              },
              "launch_checklist": {
                "description": "\"Get your Kard seen: 2 of 6 done\", for the kard's holder only, as the web shows it on the Kards list and the Share tab: null for anyone else, once all six are done, or once the holder hid it (`DELETE /kards/{share_link}/launch_checklist`).",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LaunchChecklist"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "search_offer": {
                "description": "\"Let people find this Kard on Google\", while the web asks it (its Share tab and the Kards list): for the kard's holder and its organization's admins, while the kard is a business's (a company, an address it shows, a Google Business or review link, a way to pay or a Book button), hidden from search engines, live, and nobody has answered. Null otherwise: once anyone answers it here or on the web, or once the search-engine switch is used (`indexable`).",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SearchOffer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "wallpaper_styles": {
                "type": "array",
                "description": "The lock-screen wallpaper's colours (`GET /kards/{share_link}/wallpaper.png?style=`), in the web's order and words, the default first.",
                "items": {
                  "$ref": "#/components/schemas/WallpaperStyle"
                }
              },
              "address": {
                "description": "The street address ready to show, whether the page shows it or not (`address_public`); null when the kard has none.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/KardAddress"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "payment_methods": {
                "type": "array",
                "description": "The ways to pay as the kard's page shows them, UPI too, what the owner's country uses first (the kard's phone number's country, else the account's).",
                "items": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              },
              "nickname": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Private; only the owner sees it."
              },
              "licence_number": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "A licence or registration number, as written (\"TREC #0612345\"): under the job title on the kard's page, and in the contact people save. Left out by servers before 1.9.13 or 1.9.14."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The About section, as plain text."
              },
              "indexable": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "Whether search engines may index the public page."
              },
              "layout_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "google_review_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "The Google review link: “Review us on Google” on the page, and the printable card's counter card. Null without one."
              },
              "google_place_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The kard's business on Google Maps, as Google's place ID: with it, the page shows the business's Google rating under “Review us on Google” (“★ 4.7 · 132 reviews on Google”) with the business's name as Google gives it, and up to five of its Google reviews on a tap, fetched from Google for each visitor and never kept, on any active plan. Null without one.",
                "examples": [
                  "ChIJN1t_tDeuEmsRUsoyG83frY4"
                ]
              },
              "address_place_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The place of the street address picked from Google's suggestions (`POST /address_suggestions/pick`), never a business's (that's `google_place_id`): Directions open it when the kard has no `google_place_id`. Cleared by the server when the address moves. Null without one."
              },
              "settings": {
                "type": "object",
                "properties": {
                  "allow_connect_popup": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "allow_email_notifications": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "allow_reviews": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "visitor_email_line": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The owner's own line at the top of the email each visitor gets (\"Here's Priya's card\"), shown under the kard's name and signed with it, as written; null without one (the web's Settings: \"The email your visitors get\"). Set it with `visitor_email_line_setting`. The email carries it only while the account that wrote it last has a verified address (`/me`'s `email_verified`), and only while any address in it is still the kard's own page (a changed share link drops it from the email); it shows here either way.",
                    "examples": [
                      "Thanks for stopping by our stall: show this email for 10% off this week."
                    ]
                  },
                  "visitor_email_line_held_back": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "unverified",
                      "foreign_link",
                      null
                    ],
                    "description": "Why `visitor_email_line` isn't going out, as the web's Settings says it: `unverified` (the account that saved it last hasn't verified its address, or none is known; the web's words, to that account: \"Your line isn't going out yet: verify your email address, and it goes at the top of your visitors' emails.\", with \"Email me the link\" (`POST /me/email_verification`); to anyone else who manages the kard: \"Your line isn't going out: whoever saved it last hasn't verified their email address. Save it again and it goes out as yours.\"), `foreign_link` (an address in it isn't the kard's own page any more, after its share link changed: \"Your line isn't going out: it links to an address that isn't your Kard's any more. Change it to <its address>, or take the link out.\", the address being `urls.public` without `https://`). Null while it goes out, and without a line. A value you don't know: say the line isn't going out, without a reason.",
                    "examples": [
                      "unverified"
                    ]
                  },
                  "picture_greeting": {
                    "description": "The greeting saved on the kard for its picture to post (the web's \"Save my greeting\" on Picture to post), for every manager of it on any device: the web's page opens with it, and so can the app's. `occasion`, `greeting` and `message` go as they are to `GET /kards/{share_link}/picture.png`; a null `message` is no line under the greeting (send `message=`, empty). Null when none is saved, or its occasion is no longer offered. Saved on the web, or with `picture_greeting_setting` (`PATCH /kards/{share_link}`), which sends it back as read.",
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PictureGreeting"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "photo_logo": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "How the photo is drawn now, as the web's \"This is a logo\" beside it is ticked: `true` whole, as a logo, on a plain background (the kard's page, its link preview, the printed card, the saved contact); `false` as a portrait, cropped to each layout's frame. The owner's answer (`photo_logo_setting`) when there is one, else the photo's judgement (made in the background a moment after it arrives), else, until then, its shape. Null without a photo.",
                    "examples": [
                      false
                    ]
                  },
                  "photo_logo_by": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "owner",
                      "judged",
                      null
                    ],
                    "description": "Whose answer `photo_logo` is: `owner`, given with `photo_logo_setting` (`true` or `false`: the web's \"This is a logo\" tick, which the web's form sends with every save of a kard with a photo, or an app's switch); `judged`, the photo's judgement, made in the background a moment after it arrives without an answer (and, until then, its shape). For a kept photo, an app can offer \"Decide from the picture\" beside the two answers: it's the choice while this is `judged`, and choosing it sends `photo_logo_setting` null, alone, to have the photo judged again (read the kard again a moment later). An answer kept before 1.9.9 reads `owner`: whose it was wasn't recorded. Null without a photo. New in 1.9.9: absent from a server before it.",
                    "examples": [
                      "judged"
                    ]
                  },
                  "live_panel_dismissed": {
                    "type": "boolean",
                    "description": "\"Your Kard is live\" hidden for good by the kard's holder, on the web or in an app (`DELETE /kards/{share_link}/live_panel`). The web shows the panel to the holder on the page Create opens, until then; an app that shows its own after Create shows it only while this is false, so hiding it on one device hides it on every one."
                  },
                  "visitor_whatsapp_line_on": {
                    "type": "boolean",
                    "description": "Whether a visitor's WhatsApp to this kard opens with a first line already written, which they can change before they send (the web's Settings: \"WhatsApp from your Kard\"). Off by default. Set it with `visitor_whatsapp_line_on_setting`."
                  },
                  "visitor_whatsapp_line": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The owner's own first line for it, as written; null for the default (`visitor_whatsapp_line_default`). Kept while the line is off, for when it's turned on again. Set it with `visitor_whatsapp_line_setting`.",
                    "examples": [
                      "Hi Studio 7x12, I found you on eKard and I'd like to book a session."
                    ]
                  },
                  "message_first_setting": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "text",
                      "whatsapp",
                      null
                    ],
                    "description": "\"Text or WhatsApp first\" as the owner chose it in Edit Kard (Social links), set with `message_first_setting` (`PATCH /kards/{share_link}`); null when it follows where the owner is (`message_first_country`). `message_first` is the one in force. The web's words: legend \"Text or WhatsApp first\", the choices \"Text first\" and \"WhatsApp first\", and under the legend which its country leads with. Left out by servers before 1.9.13."
                  },
                  "message_first_country": {
                    "type": "string",
                    "enum": [
                      "text",
                      "whatsapp"
                    ],
                    "description": "What `message_first_setting` null means for this kard: where its phone number is from, else its holder's country (`text` in the US, Canada and Puerto Rico, `whatsapp` elsewhere). Choosing it sends null, as the web keeps it, so the kard follows its country. Left out by servers before 1.9.13."
                  },
                  "languages_chosen": {
                    "type": "boolean",
                    "description": "Its `languages` were chosen (Kard Settings, or `languages` in `PATCH /kards/{share_link}`); false while they follow its holder's account language, with English second (the web's \"Until you choose, it follows your account's language, with English second.\"). Left out by servers before 1.9.13."
                  },
                  "languages_choosable": {
                    "type": "boolean",
                    "description": "The key's person chooses its languages: a personal kard's holder, a team kard's organization admins (and site admins). A team kard's holder reads them, and the web says who chooses: \"Bell Realty's admins choose this Kard's language.\" Left out by servers before 1.9.13."
                  },
                  "from_team": {
                    "type": "array",
                    "description": "On a team kard, its parts that came from the team's own kard when it was made and still read as they do there: `address` (with its place for Directions), `website`, `company`. The web's Edit Kard puts `from_team_note` under each. Empty on any other kard, and once a part is changed. Left out by servers before 1.9.13 (the team's checklist has it for its own kard, `own_kard.from_team`).",
                    "items": {
                      "type": "string",
                      "enum": [
                        "address",
                        "website",
                        "company"
                      ]
                    }
                  },
                  "from_team_note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The note Edit Kard puts under each of `from_team`, for the reader: \"From Bell Realty's Kard. Change it if yours is different.\" (to its holder), \"… if Kim's is different.\" (to an admin on Kim's), \"… if it's different for this Kard.\" (one under the team's name). Null with `from_team` empty. Left out by servers before 1.9.13.",
                    "examples": [
                      "From Bell Realty's Kard. Change it if yours is different."
                    ]
                  },
                  "visitor_whatsapp_line_default": {
                    "type": "string",
                    "description": "The line a visitor's WhatsApp opens with when it's on and the owner wrote none, in English, with the kard's name (and the brand's, unless the kard hides its brand line). On the kard's page it's in the visitor's language. For a preview.",
                    "examples": [
                      "Hi Priya, I found you on eKard and I'd like to know more."
                    ]
                  },
                  "show_on_our_team": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "A team kard on its team's \"Our team\" list (shown publicly once its admins switch the page on: the organization's `settings.our_team_public`): with its photo, name and job title, linking to it. On for a new kard; its holder and the team's admins switch it (`show_on_our_team_setting`). It goes off when its holder leaves the team, and back on once the kard goes to someone new and no longer shows who held it before (another name, and not their photo), unless one of the team's admins (not its holder) switched it off. Null on a personal kard and on the team's main kard, which have none."
                  }
                }
              },
              "photo_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              },
              "custom_links": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CustomLink"
                }
              },
              "urls": {
                "type": "object",
                "required": [
                  "public",
                  "qr_png",
                  "vcard"
                ],
                "properties": {
                  "public": {
                    "type": "string",
                    "format": "uri"
                  },
                  "qr_png": {
                    "type": "string",
                    "format": "uri"
                  },
                  "vcard": {
                    "type": "string",
                    "format": "uri"
                  },
                  "preview_image": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri",
                    "description": "The link preview's picture (1200 × 630 JPEG, served as `image/jpeg`; servers before 1.9.9 called it a PNG here, and it was a JPEG then too): what chat apps and social sites show beside the kard's link, as the web's \"Your Kard is live\" shows it. Null until it's drawn, in the background a moment after Create (read the kard again), and while the kard's words have letters no print font draws (chats show the brand's own card then). Drawn again after a change it shows (the name, job title, company, photo, layout, address), at a new address."
                  }
                }
              },
              "custom_design": {
                "type": "object",
                "required": [
                  "published"
                ],
                "properties": {
                  "published": {
                    "type": "boolean"
                  },
                  "published_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                }
              },
              "counts": {
                "type": "object",
                "required": [
                  "contacts",
                  "events",
                  "documents",
                  "custom_links"
                ],
                "properties": {
                  "contacts": {
                    "type": "integer"
                  },
                  "events": {
                    "type": "integer"
                  },
                  "documents": {
                    "type": "integer"
                  },
                  "custom_links": {
                    "type": "integer"
                  },
                  "upcoming_bookings": {
                    "type": "integer",
                    "description": "Bookings made from the kard that are still to come (booked, or requested and not yet answered, starting from now on), as the web's \"Delete this Kard…\" counts them: \"2 upcoming bookings made from it stay in the calendar.\" (shown when there are any). Deleting the kard keeps them in the calendar, without the kard. New in 1.9.9: absent from a server before it.",
                    "examples": [
                      2
                    ]
                  }
                }
              },
              "custom_domain": {
                "description": "Its own domain (a personal kard's), or null.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/CustomDomain"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        ]
      },
      "KardEnvelope": {
        "type": "object",
        "required": [
          "kard"
        ],
        "properties": {
          "kard": {
            "$ref": "#/components/schemas/Kard"
          },
          "message": {
            "type": "string",
            "description": "Only from `PATCH /kards/{share_link}` with `languages`, by whoever chooses them (since 1.9.13): Kard Settings' notice (\"Saved. Your printed cards, pictures and QR screen now say العربية + English.\", a right-to-left name held whole between FSI and PDI), in the language `Owner-Language` asks for, else English, and, when the name, job title and company written in the second language before went out of sight with it, that they're kept for its return.",
            "examples": [
              "Saved. Your printed cards, pictures and QR screen now say हिन्दी + English."
            ]
          }
        }
      },
      "LaunchChecklist": {
        "type": "object",
        "description": "Six steps that put a kard in front of people, each ticked from what really happened, in this order: `photo` (a photo or logo on the kard), `chat` (sent on WhatsApp, through the share sheet, by email or as a copied link: `POST /kards/{share_link}/shares`), `signature` (its email signature copied: `email_signature`), `in_person` (its lock-screen wallpaper or printable card downloaded), `visit` (someone opened it), `contact` (someone sent their details through it, not one its people typed in, scanned or added through the API).",
        "required": [
          "done",
          "total",
          "next",
          "steps"
        ],
        "properties": {
          "done": {
            "type": "integer",
            "description": "How many steps are done.",
            "examples": [
              2
            ]
          },
          "total": {
            "type": "integer",
            "description": "How many steps there are (6).",
            "examples": [
              6
            ]
          },
          "next": {
            "type": "string",
            "enum": [
              "photo",
              "chat",
              "signature",
              "in_person",
              "visit",
              "contact"
            ],
            "description": "The first step not done yet, the one to offer."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LaunchChecklistStep"
            }
          }
        }
      },
      "LaunchChecklistStep": {
        "type": "object",
        "required": [
          "key",
          "done",
          "done_on"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "photo",
              "chat",
              "signature",
              "in_person",
              "visit",
              "contact"
            ]
          },
          "done": {
            "type": "boolean"
          },
          "done_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The day it happened, in the account's time zone (its calendar's, else the one its browser reported, else UTC), where that's known: the first visit's and the first contact's. Null for the other steps, and for a step not done."
          },
          "made": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "lock_screen",
                "print"
              ]
            },
            "description": "`in_person` only (absent on the other steps): which were made, in this order: `lock_screen` (the lock-screen wallpaper, `GET /kards/{share_link}/wallpaper.png` or the web's download), `print` (printable cards, from the web). Empty while the step is to do. The web's words for the done step: \"Lock-screen wallpaper made\", \"Printable cards made\", \"Lock-screen wallpaper and printable cards made\".",
            "examples": [
              [
                "lock_screen"
              ],
              [
                "lock_screen",
                "print"
              ]
            ]
          }
        }
      },
      "WallpaperStyle": {
        "type": "object",
        "required": [
          "key",
          "label",
          "description"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "kard",
              "porcelain",
              "ink",
              "seal"
            ],
            "description": "`style` for `GET /kards/{share_link}/wallpaper.png`."
          },
          "label": {
            "type": "string",
            "description": "The web's name for it.",
            "examples": [
              "Your Kard's colours",
              "Light",
              "Dark",
              "Terracotta"
            ]
          },
          "description": {
            "type": "string",
            "description": "What it gives, in the web's words.",
            "examples": [
              "The colours of your Kard's Letterhead layout.",
              "Dark words on an off-white background."
            ]
          }
        }
      },
      "PictureOccasion": {
        "type": "object",
        "required": [
          "key",
          "label",
          "greeting",
          "message"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "none",
              "wishes",
              "thanks",
              "christmas",
              "diwali",
              "eid",
              "lunar_new_year",
              "new_year"
            ],
            "description": "`occasion` for `GET /kards/{share_link}/picture.png`."
          },
          "label": {
            "type": "string",
            "description": "The web's name for it.",
            "examples": [
              "No greeting",
              "Warm wishes",
              "Diwali"
            ]
          },
          "greeting": {
            "type": [
              "string",
              "null"
            ],
            "description": "The greeting drawn when you send none (null for `none`).",
            "examples": [
              "Happy Diwali"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "The line under it when you send no `message` (null for `none`).",
            "examples": [
              "May the festival of lights bring you joy and prosperity"
            ]
          }
        }
      },
      "PictureGreeting": {
        "type": "object",
        "required": [
          "occasion",
          "greeting",
          "message"
        ],
        "properties": {
          "occasion": {
            "type": "string",
            "description": "One of `picture_occasions`' keys, never `none`.",
            "examples": [
              "diwali"
            ]
          },
          "greeting": {
            "type": "string",
            "description": "The greeting as saved: the owner's own words, or the occasion's when they kept those (at most 40 letters).",
            "examples": [
              "शुभ दीपावली"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "The line under it as saved (at most 90 letters), the occasion's or the owner's; null for no line.",
            "examples": [
              "Wishing you and your family a bright year ahead"
            ]
          }
        }
      },
      "PictureGreetingInput": {
        "type": "object",
        "required": [
          "occasion"
        ],
        "properties": {
          "occasion": {
            "type": "string",
            "description": "One of the kard's `picture_occasions` keys but `none`.",
            "enum": [
              "wishes",
              "thanks",
              "christmas",
              "diwali",
              "eid",
              "lunar_new_year",
              "new_year"
            ],
            "examples": [
              "diwali"
            ]
          },
          "greeting": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Your own words for the greeting, at most 40 letters (any script the print fonts carry; emoji are left off). Left out, null or empty: the occasion's own (`picture_occasions[].greeting`).",
            "examples": [
              "शुभ दीपावली"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 90,
            "description": "The line under the greeting, at most 90 letters. Left out: the occasion's own (`picture_occasions[].message`). Null or empty: no line.",
            "examples": [
              "Wishing you and your family a bright year ahead"
            ]
          }
        }
      },
      "KardShareInput": {
        "type": "object",
        "required": [
          "channel"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "share_sheet",
              "copy_link",
              "whatsapp",
              "email",
              "sms",
              "email_signature",
              "qr_download"
            ],
            "description": "How it went: `share_sheet` (the phone's share sheet), `copy_link` (the kard's link copied), `whatsapp` (sent to someone on WhatsApp), `email` (an email with its link), `sms` (a text message with its link, from the phone's messages app), `email_signature` (its email signature copied), `qr_download` (its QR code saved). The first five tick the checklist's `chat` step, `email_signature` its `signature` step; any of them ticks a team's `out` step (`launch_checklist` on the organization)."
          }
        }
      },
      "SocialHandles": {
        "type": "object",
        "description": "A web address written without a scheme, as cards print it (`www.example.com`, `example.com/about`), is saved with `https://` in front: `website`, `google_business_url`, `linkedin_url`, `youtube_url`, `facebook_url` (and `google_review_url`, a custom link's `url`). One with a scheme of its own (`http://`) stays as sent; anything that isn't a web address (`mailto:…`, a name) is `422 validation_failed` on its field.",
        "properties": {
          "phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "whatsapp_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Saved, and answered, as wa.me reads it: `+` and digits (`+62 812-1088-4521` is `+6281210884521`). One that isn't a valid number is `422 validation_failed`."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagram_handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "google_business_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Google Maps or Business Profile link: google.com/maps (or a Google country domain), maps.app.goo.gl, g.page, g.co or share.google. Checked when it changes."
          },
          "linkedin_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "On linkedin.com or lnkd.in. Checked when it changes."
          },
          "upi_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "description": "`www.example.com` is saved, and answered, as `https://www.example.com`."
          },
          "telegram_handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtube_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "On youtube.com or youtu.be. Checked when it changes."
          },
          "facebook_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "On facebook.com, fb.com or fb.me. Checked when it changes."
          },
          "twitter_handle": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PaymentHandles": {
        "type": "object",
        "description": "Ways to get paid beyond `upi_id` (in SocialHandles). Each is checked against its app's rules and kept in one form: a pasted link, @ or $ comes off; an IBAN loses its spaces. An empty string clears one. No money passes through the kard: visitors pay in their own app or bank.",
        "properties": {
          "paypal_handle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "The PayPal.Me name, the part after paypal.me/: letters and digits."
          },
          "venmo_handle": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Venmo username without the @: 5 to 30 letters, digits, - or _."
          },
          "cash_app_handle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "The $Cashtag without the $: letters and digits, at least one a letter."
          },
          "pix_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Pix key: a CPF (11 digits) or CNPJ (14) with valid check digits, an email, a phone as +55 and digits, or a random key (a UUID)."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "description": "Capitals, no spaces. Checked for the country's length and the check digits."
          },
          "iban_bic": {
            "type": [
              "string",
              "null"
            ],
            "description": "The BIC (SWIFT), 8 or 11 characters. Only with an IBAN."
          },
          "iban_account_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 70,
            "description": "The account's name, for the transfer. Only with an IBAN."
          },
          "zelle_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "The email enrolled with Zelle."
          },
          "mpesa_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "phone",
              "till",
              "paybill",
              null
            ],
            "description": "How M-Pesa pays the owner: `phone` (Send Money to a phone number), `till` (Buy Goods at a Till) or `paybill` (Pay Bill, with `mpesa_account`). Required with `mpesa_number`; cleared with it."
          },
          "mpesa_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `phone`, a phone number, kept as +254… (written without its code, it's read in the owner's country); for `till` and `paybill`, 5 to 8 digits."
          },
          "mpesa_account": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "The account number payers type after the Paybill. Required with `paybill`; kept only with it."
          },
          "clabe": {
            "type": [
              "string",
              "null"
            ],
            "description": "A Mexican CLABE for SPEI transfers: 18 digits, kept without spaces, its last digit checked against the other 17."
          }
        }
      },
      "KardAddressFields": {
        "type": "object",
        "description": "The kard's street address: a shop, an office, a clinic. Every part is optional and free text, written the owner's way (no country's format is assumed); spaces and line breaks are tidied, and an empty string clears a part. The page shows it with Directions while `address_public` is true. The contact card (vCard ADR) carries it either way, so anyone who saves the contact gets it.",
        "properties": {
          "address_line1": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "examples": [
              "Shop 4, 12 Market Road"
            ]
          },
          "address_line2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Building, floor or landmark."
          },
          "address_city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Town or city."
          },
          "address_region": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "State, province or region."
          },
          "address_postcode": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20,
            "description": "Postal code."
          },
          "address_country": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2 code, returned in capitals. An alpha-3 code or the country's name in several languages (\"India\", \"Deutschland\") is read as its code; an unknown one is refused (422), and so is a country with every other part empty.",
            "examples": [
              "IN",
              "DE"
            ]
          },
          "address_public": {
            "type": "boolean",
            "default": true,
            "description": "true: the kard's page shows the address, with a Directions link. false: the contact card only."
          }
        }
      },
      "KardAddress": {
        "type": "object",
        "description": "A kard's street address, ready to show.",
        "required": [
          "lines",
          "text",
          "directions_url"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "description": "The street lines as written, then town, region and postal code on one line, then the country's name.",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "Shop 4, 12 Market Road",
                "Pune, Maharashtra, 411001",
                "India"
              ]
            ]
          },
          "text": {
            "type": "string",
            "description": "The lines on one line, comma-separated."
          },
          "directions_url": {
            "type": "string",
            "format": "uri",
            "description": "A universal maps link (Google Maps URLs, no key) that opens the visitor's maps app at the address, as the page's Directions does. When the kard is linked to its business on Google (`google_place_id`), it opens that business on Google Maps (`destination_place_id`), with the address as its destination; else, when the address was picked from Google's suggestions (`address_place_id`), that exact place."
          }
        }
      },
      "AddressSuggestions": {
        "type": "object",
        "required": [
          "suggestions",
          "notice",
          "off",
          "reason"
        ],
        "properties": {
          "suggestions": {
            "type": "array",
            "maxItems": 5,
            "description": "Up to five, in Google's order; empty when Google has no street address for the words (say so: \"Google Maps has no street address for “12 Markt”. Type it yourself: it saves the same.\"), or when `off`.",
            "items": {
              "$ref": "#/components/schemas/AddressSuggestion"
            }
          },
          "notice": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why suggestions are paused, in the account's language, to show once under line 1. Null unless `off` is `paused`.",
            "examples": [
              "Address suggestions are paused until tomorrow: eKard's allowance for Google Maps today is used up. Type your address yourself: it saves the same."
            ]
          },
          "off": {
            "enum": [
              "not_set_up",
              "paused",
              null
            ],
            "description": "`not_set_up`: the server has no Google Maps key; `paused`: see `notice`. Either way stop asking until the screen opens again. Null while suggestions are on."
          },
          "reason": {
            "enum": [
              "today",
              "month",
              "free_calls",
              "person",
              "person_share",
              "session",
              "unavailable",
              null
            ],
            "description": "Why `paused`: the day's or the month's allowance for Google Maps, an account without a plan past the month's free calls (with a See plans button on a person's own kard), the person's day (100 requests, 10 picks), the person's share of the day's allowance (a quarter of what owners may spend on Google Maps in a day, so one person can't take it all), this session's 15 requests, or Google not answering. Null otherwise."
          }
        }
      },
      "AddressSuggestion": {
        "type": "object",
        "required": [
          "place_id",
          "main",
          "secondary",
          "street_only"
        ],
        "properties": {
          "place_id": {
            "type": "string",
            "description": "Google's place ID, for the pick."
          },
          "main": {
            "type": "string",
            "description": "The first line, as Google writes it in the language asked for. Show it with its own direction (`dir=\"auto\"`).",
            "examples": [
              "12, Laxmi Road"
            ]
          },
          "secondary": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rest, smaller.",
            "examples": [
              "Shaniwar Peth, Pune, Maharashtra, India"
            ]
          },
          "street_only": {
            "type": "boolean",
            "description": "A street without a number (Google's `route`): the person adds theirs after the pick."
          }
        }
      },
      "AddressPickInput": {
        "type": "object",
        "required": [
          "place_id",
          "session"
        ],
        "properties": {
          "place_id": {
            "type": "string",
            "description": "A suggestion's `place_id`: a street address. A business's or a landmark's place (a kard's `google_place_id`, say) is never one: `422 not_a_street_address`."
          },
          "session": {
            "type": "string",
            "format": "uuid",
            "description": "The session its suggestions were asked with."
          },
          "kard": {
            "type": "string",
            "description": "As `GET /address_suggestions`."
          },
          "organization": {
            "type": "string",
            "description": "As `GET /address_suggestions`."
          }
        }
      },
      "AddressPick": {
        "type": "object",
        "required": [
          "address",
          "missing_number",
          "notice",
          "off",
          "reason"
        ],
        "properties": {
          "address": {
            "description": "The parts to fill, or null when `off`.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "address_line1",
                  "address_line2",
                  "address_city",
                  "address_region",
                  "address_postcode",
                  "address_country",
                  "address_place_id"
                ],
                "properties": {
                  "address_line1": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "examples": [
                      "12, Laxmi Road"
                    ]
                  },
                  "address_line2": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "Google's further lines, else its neighbourhood: fill line 2 with it only if it's empty.",
                    "examples": [
                      "Shaniwar Peth"
                    ]
                  },
                  "address_city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 100,
                    "examples": [
                      "Pune"
                    ]
                  },
                  "address_region": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 100,
                    "examples": [
                      "Maharashtra"
                    ]
                  },
                  "address_postcode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20,
                    "examples": [
                      "411030"
                    ]
                  },
                  "address_country": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "ISO 3166-1 alpha-2.",
                    "examples": [
                      "IN"
                    ]
                  },
                  "address_place_id": {
                    "type": "string",
                    "description": "The picked street address's place, never a business's (that's `google_place_id`). Send it as the kard's `address_place_id` with the save."
                  }
                }
              }
            ]
          },
          "missing_number": {
            "type": "boolean",
            "description": "Google knew the street but not the number."
          },
          "notice": {
            "type": [
              "string",
              "null"
            ],
            "description": "As `AddressSuggestions`."
          },
          "off": {
            "enum": [
              "not_set_up",
              "paused",
              null
            ]
          },
          "reason": {
            "enum": [
              "today",
              "month",
              "free_calls",
              "person",
              "person_share",
              "session",
              "unavailable",
              null
            ]
          }
        }
      },
      "PaymentMethod": {
        "type": "object",
        "description": "One way to pay, ready to show: a button that opens `url` (an https link the app claims, so a phone without the app opens the web page; UPI's is upi://), and/or one that copies `copy`.",
        "required": [
          "method",
          "label",
          "value",
          "url",
          "copy",
          "details"
        ],
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "upi",
              "paypal",
              "venmo",
              "cash_app",
              "pix",
              "iban",
              "zelle",
              "mpesa",
              "clabe"
            ]
          },
          "label": {
            "type": "string",
            "description": "The method's own name; M-Pesa's says how it's paid (\"M-Pesa\" to a phone number, \"M-Pesa Till\", \"M-Pesa Paybill\").",
            "examples": [
              "Venmo",
              "IBAN",
              "M-Pesa Till"
            ]
          },
          "value": {
            "type": "string",
            "description": "What to show, e.g. \"@jane-doe\", \"paypal.me/janedoe\", \"$janedoe\", an IBAN in groups of four, an M-Pesa phone number as its country dials it (\"0712 345678\"), a CLABE in its parts (\"032 180 00011835971 9\")."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opens the payment app at the owner (upi, paypal, venmo, cash_app); null for a key to copy."
          },
          "copy": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to copy (upi, pix, iban without spaces, zelle, mpesa in digits, clabe without spaces); null for an app."
          },
          "details": {
            "type": "array",
            "description": "An IBAN's account name and BIC, when set; an M-Pesa Paybill's account number.",
            "items": {
              "type": "object",
              "required": [
                "label",
                "value"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "enum": [
                    "Account name",
                    "BIC",
                    "Account number"
                  ]
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "KardLanguages": {
        "type": "array",
        "description": "The kard's languages, its main first (at most two): what its printed cards, pictures and QR screen say, chosen in the web's Kard Settings, else its holder's account language plus English. The second is where `translations` belongs.",
        "minItems": 1,
        "maxItems": 2,
        "items": {
          "type": "string",
          "enum": [
            "en",
            "hi",
            "es",
            "pt",
            "fr",
            "ar",
            "id",
            "de"
          ]
        },
        "examples": [
          [
            "ar",
            "en"
          ]
        ]
      },
      "KardTranslations": {
        "type": "object",
        "description": "The name, job title and company its owner wrote in the kard's second language, by language (`{}` with none): the second language's (`languages[1]`) only. A field not written is null. A copy written for a language that isn't the second any more (the kard's languages changed, or its holder's account language) is kept, unlisted, and comes back when that language is the second again.",
        "propertyNames": {
          "enum": [
            "en",
            "hi",
            "es",
            "pt",
            "fr",
            "ar",
            "id",
            "de"
          ]
        },
        "additionalProperties": {
          "$ref": "#/components/schemas/KardTranslation"
        },
        "examples": [
          {
            "en": {
              "name": "Yousef Al-Haddad",
              "company": "Al-Haddad Oud & Perfumes",
              "job_title": "Owner"
            }
          }
        ]
      },
      "KardTranslation": {
        "type": "object",
        "required": [
          "name",
          "company",
          "job_title"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "job_title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          }
        }
      },
      "KardInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SocialHandles"
          },
          {
            "$ref": "#/components/schemas/PaymentHandles"
          },
          {
            "$ref": "#/components/schemas/KardAddressFields"
          },
          {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 4,
                "maxLength": 100
              },
              "tagline": {
                "type": "string"
              },
              "job_title": {
                "type": "string",
                "maxLength": 100,
                "description": "Under the name, and the contact card's TITLE (the tagline when empty). An empty string clears it."
              },
              "company": {
                "type": "string",
                "maxLength": 100,
                "description": "Under the name, and the contact card's ORG (a team kard's organization when empty). On a team kard only the organization's admins may change it (`can_edit_company`); anyone else gets 403 forbidden."
              },
              "translations": {
                "description": "The name, job title and company in the kard's second language (`languages[1]`), by language: `{\"en\": {\"name\": \"Yousef Al-Haddad\", \"company\": \"Al-Haddad Oud & Perfumes\"}}`. Each field sent replaces its copy (null or `\"\"` clears it) and one left out stays; a language sent as null clears its copy, and `translations: null` every copy. Only the kard's second language takes one: another is 422 with the reason in `details.base`, a kard with one language too. Lengths as the main fields': a refusal is keyed `<field>_in_<language>` in `details` (`name_in_en`). A team kard's company copy is its organization's admins' to set, as its company is (403 for anyone else). Visitors reading that language see the copy; those reading neither of the kard's languages see it when it alone is in Latin letters. The contact card keeps the name in N and FN, and the copy as its phonetic name only (not NICKNAME, which an iPhone may show in place of the name).",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "propertyNames": {
                      "enum": [
                        "en",
                        "hi",
                        "es",
                        "pt",
                        "fr",
                        "ar",
                        "id",
                        "de"
                      ]
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 100
                            },
                            "company": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 100
                            },
                            "job_title": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 100
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              },
              "languages": {
                "type": "array",
                "minItems": 1,
                "maxItems": 2,
                "description": "Its languages, as the web's Kard Settings chooses them (since 1.9.13): the main first, and a second or none, each one of the eight once. Saved, its printed cards, pictures and QR screen say them, its second is where `translations` belongs, and the answer has `message` (Settings' notice). Not a list of one or two codes: `422 invalid_parameter`; a code that isn't one of the eight, more than two, or one twice: `422 validation_failed` with `details.languages`. A team kard's are its organization's admins' to choose (`settings.languages_choosable`): anyone else sending other ones gets `403 forbidden` (\"Bell Realty's admins choose this Kard's language.\"), and the same ones are ignored. Visitors still read the kard in their own language.",
                "items": {
                  "type": "string",
                  "enum": [
                    "en",
                    "hi",
                    "es",
                    "pt",
                    "fr",
                    "ar",
                    "id",
                    "de"
                  ]
                },
                "examples": [
                  [
                    "ar",
                    "en"
                  ]
                ]
              },
              "message_first_setting": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "text",
                  "whatsapp",
                  null
                ],
                "description": "\"Text or WhatsApp first\" on its page and its contacts' rows, as Edit Kard's choice (since 1.9.13): `text` or `whatsapp`; null (or `\"\"`) follows where the owner is, and so does sending the one its country leads with (`settings.message_first_country`), as the web keeps it. Anything else: `422 validation_failed` with `details.message_first_setting`."
              },
              "nickname": {
                "type": "string"
              },
              "licence_number": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 100,
                "description": "A licence or registration number, shown as written under the job title (Edit Kard's \"Licence or registration number\"); null or \"\" removes it. Over 100 characters: `422 validation_failed` with `details.licence_number`. Since 1.9.13 or 1.9.14."
              },
              "description": {
                "type": "string",
                "description": "Plain text or simple HTML."
              },
              "is_active": {
                "type": "boolean",
                "description": "False: switched off for a while (Kard Settings' switch, or `is_active` false here): every page of it a visitor reaches (its link, a printed QR's, its files, its vCard, its exchange, its booking pages, its pay links) is one \"switched off for now\" page with its name and photo only, 200, never cached; switched back on, the live page at once. Its holder, its organization's admins and site admins see it as it is. A team kard switched off leaves its team's \"Our team\" page; an organization's own kard switched off takes \"Our team\" off with it (its members' kards stay as they are). Bookings already made stand; no new one, bookmark or share-back is taken (since 1.9.14; before, its page still opened without its links)."
              },
              "indexable": {
                "type": "boolean",
                "description": "Allow search engines to index the public page."
              },
              "layout_type": {
                "type": "string",
                "enum": [
                  "default",
                  "links",
                  "restaurant",
                  "letterhead",
                  "jharokha",
                  "mohur",
                  "yantra"
                ],
                "description": "A new personal kard starts on letterhead unless one is sent; a team kard sent none wears its organization's."
              },
              "allow_connect_popup_setting": {
                "type": "boolean"
              },
              "allow_email_notifications_setting": {
                "type": "boolean"
              },
              "allow_reviews_setting": {
                "type": "boolean"
              },
              "photo_logo_setting": {
                "type": [
                  "boolean",
                  "null"
                ],
                "description": "The web's \"This is a logo\" beside the photo. `true`: the photo is a logo, drawn whole on a plain background on the kard's page, its link preview, the printed card and the saved contact. `false`: a portrait, cropped to each layout's frame. `null`, or not sent with a new photo: the photo is judged in the background, by its shape, transparency and flat colour, and the answer kept. A new photo sent without it forgets the answer about the one before. Sent alone, for the photo the kard has (as the app's own \"This is a logo\" switch does), it's saved alone, as `show_on_our_team_setting` is (since 1.9.5): the kard's other fields aren't checked again, so one an older rule would now refuse (more links than today's limit) still takes it, and `photo_logo` in the answer says how the photo is drawn now."
              },
              "picture_greeting_setting": {
                "description": "Saves a greeting on the kard for its picture to post, as the web's \"Save my greeting\" on Picture to post does: read back as `settings.picture_greeting`, the web's page opens with it, and so can an app's, for every manager of the kard on any device. `null` forgets it (the page opens with no greeting again). With the web's checks, each a `422 validation_failed` with `details.picture_greeting_setting` and the sentence in `message`: an occasion with a greeting (`none` or none sent: \"Not saved: pick a greeting first, then save it.\"; one it doesn't offer: the sentence names those it does), words that fit (\"Not saved: the greeting is at most 40 letters; this is 41.\") and letters the picture's fonts draw (\"Not saved: the picture's fonts don't draw Ꮜ. Change those letters, then save.\"); nothing in the request is saved then. Whoever may change the kard (its holder, its team's admins). Only the greeting is written: the kard's pages, its `updated_at` and its link preview don't change. Sent back as read (`settings.picture_greeting`), it saves the same greeting.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PictureGreetingInput"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "show_on_our_team_setting": {
                "type": "boolean",
                "description": "A team kard on its team's \"Our team\" list (`settings.show_on_our_team`), or off it. Its holder and the team's admins switch it, on the web too (the kard's Settings)."
              },
              "visitor_email_line_setting": {
                "type": "string",
                "description": "A line of your own at the top of the email each visitor gets (`settings.visitor_email_line`), with the web's rules: one line (line breaks become spaces; control characters and direction overrides are taken out), at most 280 characters, plain text, and no web or email address but the kard's own page on the brand's domain (`https://ekard.app/priya`). Not its website, its own domain or its email address: the email already links the kard and its website. Anything a mail app would make a link (an address with `https://` or `www.`, an email address, a bare `example.com`, an IP address, a domain in another script or with wide dots) is refused with the web's words and the text to take out (`422 validation_failed`, `details.visitor_email_line_setting`). Checked when it's written only. Saved with who wrote it, as the web's Settings saves it: it goes into visitors' emails while that account's address is verified (`/me`'s `email_verified`; `POST /me/email_verification` sends the link). An empty string takes the line out.",
                "examples": [
                  "Thanks for stopping by our stall: show this email for 10% off this week."
                ]
              },
              "visitor_whatsapp_line_on_setting": {
                "type": "boolean",
                "description": "`true`: a visitor's WhatsApp to this kard opens with a first line already written, which they can change before they send: `visitor_whatsapp_line_setting` if there is one, else the default in the visitor's language (`settings.visitor_whatsapp_line_default`). `false`: an empty chat, as before. Off by default."
              },
              "visitor_whatsapp_line_setting": {
                "type": "string",
                "maxLength": 200,
                "description": "Your own first line for a visitor's WhatsApp (`settings.visitor_whatsapp_line`), with the web's rules: one line (line breaks become spaces; control characters and direction overrides are taken out), at most 200 characters, plain text. Longer: `422 validation_failed`, `details.visitor_whatsapp_line_setting` (\"is 201 characters long. Keep it to 200\"). An empty string goes back to the default. Sending it doesn't turn the line on: that's `visitor_whatsapp_line_on_setting`.",
                "examples": [
                  "Hi Studio 7x12, I found you on eKard and I'd like to book a session."
                ]
              },
              "google_review_url": {
                "type": "string",
                "maxLength": 500,
                "description": "The Google review link, what a Google Business Profile's “Ask for reviews” gives: g.page/r/<id>/review, g.page/<name>/review or search.google.com/local/writereview?placeid=…. A bare g.page/r/<id> (which opens the Maps page) is saved with /review added. The page shows “Review us on Google” with it, and the printable card prints it as a counter card. A link elsewhere, a Maps share link (maps.app.goo.gl/…, which can open the Maps page instead of the form), or a link to the business on Google but not its review form (a google.com/maps page), is refused with why. Checked when it changes; an empty string clears it.",
                "examples": [
                  "https://g.page/r/CUZk4ff5ANH1EBM/review"
                ]
              },
              "google_place_id": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 500,
                "description": "The kard's own business on Google Maps, as Google's place ID (what Google's Places API, or the web's “Find your business on Google” in the kard's Google reviews panel, gives: `ChIJ…`, letters, digits, `-` and `_`). Only the business the kard is for: the page shows its Google rating with its name as Google gives it and, on a tap, up to five of its Google reviews, on any active plan; a free kard's visitors don't see them. Anything else is `422 validation_failed`, `details.google_place_id`. `null` or an empty string removes it.",
                "examples": [
                  "ChIJN1t_tDeuEmsRUsoyG83frY4"
                ]
              },
              "address_place_id": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 500,
                "description": "The `address_place_id` of the address picked from Google's suggestions (`POST /address_suggestions/pick`), sent with the parts it filled, so Directions open the exact place. Anything but a place ID is `422 validation_failed`, `details.address_place_id`; `null` or an empty string removes it. **The server clears it** on any save that moves the address, unless the same save sends a new one: the town or city, postal code or country changed; line 1 changed other than by growing (\"Shop 4, 12 Market Road\" after \"12 Market Road\" keeps it), case and spaces aside, or typed where there was none; or the address emptied. Line 2 and the region change freely.",
                "examples": [
                  "ChIJ5501BurnetRdAustinTX78756a"
                ]
              },
              "organization_id": {
                "type": "integer",
                "description": "Only for an organization you administer. Moving a kard out of its organization (null, or another id) needs the admin role there too."
              },
              "contact_form": {
                "description": "The kard's own questions on its exchange sheet, the whole list in order: it replaces the questions the kard has. Send a question's `key` to keep it (edited or not: its answers stay its own); a question sent without one is new; one left out is removed (its answers stay on the contacts who gave them). An answer keeps the words it was asked in: new words on a question someone has answered make it a new question with a new `key` (read it back from the response), and the old words stay with their answers, under the old key, in `custom_fields` and in the web's CSV and filters; words asked before bring back that earlier key. `null` or `{\"questions\": []}` removes them all. On a team kard only the organization's admins may change them (`contact_form.can_edit`); anyone else sending a change gets 403 forbidden, and the list as it stands is accepted from anyone. What's wrong is a 422 with `details.contact_form`, one sentence per problem, naming the question by its number (\"question 2 needs 2 to 6 choices, one per box\").",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ContactFormInput"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "custom_links_attributes": {
                "type": "array",
                "maxItems": 20,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Edits or removes that link; without it, a link is added."
                    },
                    "title": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "description": "A web address; without a scheme (`example.com/menu`) it's saved with `https://`."
                    },
                    "_destroy": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ContactForm": {
        "type": "object",
        "description": "The kard's own questions on its exchange sheet (the web's Edit Kard › Exchange, free on every plan): visitors answer them after their name, email and number when they send their details. The questions show in the owner's words as written; the sheet's own words (\"Optional\", what's missing) follow the visitor's language. Answers land in each contact's `custom_fields` by `key`, in the new-contact email, the CSV, the contact file's NOTE and the webhook.",
        "required": [
          "questions",
          "can_edit",
          "limits"
        ],
        "properties": {
          "questions": {
            "type": "array",
            "description": "In the sheet's order. Empty when the kard asks none.",
            "items": {
              "$ref": "#/components/schemas/ContactFormQuestion"
            }
          },
          "can_edit": {
            "type": "boolean",
            "description": "Whether this account may change them: a personal kard's owner, a team kard's organization admins (a team kard's holder reads them)."
          },
          "other_fields": {
            "type": "array",
            "description": "The other fields of a form made by hand before the editor (a checkbox, a select list), which the sheet never shows and the editor never changes, then each earlier wording of a question someone answered before its words changed (kind `text` or `radio`; the latest first), kept so their answers read in the words they were asked: read only, so a contact's answer to one (`custom_fields` under its `key`) can be worded as the web words it. In the form's order; empty for a kard whose form the editor made and never reworded, or that has none. Never send them back: `contact_form.questions` leaves them as they are.",
            "items": {
              "$ref": "#/components/schemas/ContactFormOtherField"
            }
          },
          "limits": {
            "type": "object",
            "required": [
              "questions",
              "choices_min",
              "choices_max",
              "question_length",
              "choice_length"
            ],
            "properties": {
              "questions": {
                "type": "integer",
                "description": "The most a kard asks (2). A form made by hand before the editor may hold more: it keeps them, and takes no more."
              },
              "choices_min": {
                "type": "integer"
              },
              "choices_max": {
                "type": "integer"
              },
              "question_length": {
                "type": "integer"
              },
              "choice_length": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ContactFormQuestion": {
        "type": "object",
        "required": [
          "key",
          "question",
          "kind",
          "required",
          "choices"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Where its answers are kept (`custom_fields` on a contact), from the question's first words when it was added. It never changes.",
            "examples": [
              "which_company_are_you_with"
            ]
          },
          "question": {
            "type": "string",
            "description": "In the owner's words."
          },
          "kind": {
            "type": "string",
            "enum": [
              "short_answer",
              "choice"
            ]
          },
          "required": {
            "type": "boolean",
            "description": "A visitor can't send their details without answering it."
          },
          "choices": {
            "type": "array",
            "description": "A choice question's choices, in its order, each in its words (a visitor picks one). Empty for a short answer.",
            "items": {
              "type": "string"
            }
          },
          "choice_values": {
            "type": "array",
            "description": "What an answer keeps for each choice (`custom_fields` under `key`), in the order of `choices`: `choice_values[i]` is kept for `choices[i]`. A choice the editor made keeps its words; a form made by hand before the editor may keep its own value (`buyer` for \"Buyer\", `opt_1`). Word an answer with the choice whose value it is, else show it as kept. Empty for a short answer. Read only: send `choices` alone, and each choice left as it was keeps its value.",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "buyer",
                "seller"
              ]
            ]
          },
          "answer_count": {
            "type": "integer",
            "description": "How many of the kard's contacts answered it in these words, as Edit Kard's line under it says (\"3 people have answered it in these words.\", shown only when there are any; since 1.9.13 Edit Kard then asks, once its words change, whether it's the same question reworded or a new one: `reworded` on ContactFormQuestionInput). Reworded as a new question, a question answered in its old words comes back with a new `key` and starts at 0, its old words listed in `other_fields` with their count. Read only. Left out by servers before 1.9.10, which can't say it: show no rewording line then (1.9.7 relabels the answers instead).",
            "examples": [
              3
            ]
          }
        }
      },
      "ContactFormOtherField": {
        "type": "object",
        "description": "A field of a hand-made form that the sheet doesn't show (see `ContactForm.other_fields`).",
        "required": [
          "key",
          "question",
          "kind",
          "answer_words"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Where its answers are kept (`custom_fields` on a contact).",
            "examples": [
              "interested_in_newsletter"
            ]
          },
          "question": {
            "type": "string",
            "description": "In the owner's words: its label, else its placeholder, else its key made readable, as the web's contact page names it.",
            "examples": [
              "Subscribe to Newsletter"
            ]
          },
          "kind": {
            "type": "string",
            "description": "The form's own field type, as made by hand: checkbox, select, textarea, email... Not a closed list; `answer_words` is all an app needs to word an answer.",
            "examples": [
              "checkbox"
            ]
          },
          "answer_words": {
            "type": "object",
            "description": "The words for an answer kept as one of these values, as the web's contact page, the CSV and the new-contact email say it: a checkbox's `1` is Yes, its `0` No. Any other answer reads as kept. Empty when every answer reads as kept.",
            "additionalProperties": {
              "type": "string"
            },
            "examples": [
              {
                "1": "Yes",
                "0": "No"
              }
            ]
          },
          "answer_count": {
            "type": "integer",
            "description": "How many of the kard's contacts answered it. Edit Kard lists an earlier wording someone answered with it and `asked_until`: \"Earlier wordings, kept with their answers: “What do you need packed?” (2 answers, asked until Wed 28 Oct).\" Left out by servers before 1.9.10.",
            "examples": [
              2
            ]
          },
          "choices": {
            "type": "array",
            "description": "An earlier wording of a choice question (kind `radio`): its choices' words, as the web's contacts list offers them as filters after the questions asked now, its line saying \"· asked until Wed 28 Oct\" (`?question=` its `key`, `?answer=` a choice's words); empty for any other field. Left out by servers before 1.9.13.",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "Buying",
                "Selling"
              ]
            ]
          },
          "choice_values": {
            "type": "array",
            "description": "Each of `choices`' kept value, in the same order: what `custom_fields` holds for it (a form made by hand may keep other values than the words). Left out by servers before 1.9.13.",
            "items": {
              "type": "string"
            }
          },
          "asked_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "For an earlier wording of a question (kind `text` or `radio`), the last day it was asked, in the account's own zone (its follow-ups' zone: the booking calendar's, else `account.timezone`), as Edit Kard words it (\"asked until Wed 28 Oct\"). Null for a hand-made form's field, which is no earlier wording. Left out by servers before 1.9.10.",
            "examples": [
              "2026-10-28"
            ]
          }
        }
      },
      "ContactFormInput": {
        "type": "object",
        "required": [
          "questions"
        ],
        "properties": {
          "questions": {
            "type": "array",
            "description": "At most `limits.questions` (2), unless the kard already holds more (a form made by hand): then no more than it holds.",
            "items": {
              "$ref": "#/components/schemas/ContactFormQuestionInput"
            }
          }
        }
      },
      "ContactFormQuestionInput": {
        "type": "object",
        "required": [
          "question"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "An existing question's key, to keep it; leave it out to add a question."
          },
          "question": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "kind": {
            "type": "string",
            "enum": [
              "short_answer",
              "choice"
            ],
            "description": "Without it: a choice when `choices` are sent, else a short answer."
          },
          "required": {
            "type": "boolean",
            "default": false
          },
          "reworded": {
            "type": "boolean",
            "default": false,
            "description": "With a `key`, new words for the same question (a typo fixed; since 1.9.13): it keeps its `key`, so its answers stay with it and read under the new words, in the same CSV column. Without it, new words for a question someone answered start a new `key` and the old words go to `other_fields` with their answers. Edit Kard asks the same once an answered question's words change: \"Same question, reworded\" or \"A new question\". Older servers ignore it."
          },
          "choices": {
            "type": "array",
            "description": "For a choice question: 2 to 6 (blanks dropped), each up to 60 characters, none twice; ignored for a short answer. A choice whose words stay as they were keeps the value its answers hold.",
            "items": {
              "type": "string",
              "maxLength": 60
            }
          }
        }
      },
      "KardMultipart": {
        "type": "object",
        "description": "The same fields as JSON, named kard[field], plus the photo (JPEG, PNG, GIF or WebP, up to 5 MB) or kard[remove_photo]=1.",
        "properties": {
          "kard[name]": {
            "type": "string"
          },
          "kard[idempotency_key]": {
            "type": "string",
            "maxLength": 100,
            "description": "On create only, as `idempotency_key` in JSON."
          },
          "kard[photo]": {
            "type": "string",
            "contentMediaType": "image/jpeg"
          },
          "kard[remove_photo]": {
            "type": "string",
            "enum": [
              "1"
            ]
          },
          "kard[photo_logo_setting]": {
            "type": "string",
            "enum": [
              "1",
              "0"
            ],
            "description": "\"This is a logo\" for the photo sent with it (`photo_logo_setting` in JSON)."
          }
        }
      },
      "CustomLink": {
        "type": "object",
        "required": [
          "id",
          "title",
          "url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AccountAnalytics": {
        "type": "object",
        "required": [
          "kards",
          "totals"
        ],
        "properties": {
          "kards": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "kard",
                "name",
                "organization",
                "organization_name",
                "visits",
                "contacts",
                "contacts_last_30_days",
                "history"
              ],
              "properties": {
                "kard": {
                  "type": "string",
                  "description": "The kard's share_link."
                },
                "name": {
                  "type": "string"
                },
                "organization": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The kard's organization's slug; null for a personal kard. A personal kard and a team's can share a share_link."
                },
                "organization_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "visits": {
                  "type": "object",
                  "required": [
                    "last_7_days",
                    "last_30_days",
                    "lifetime"
                  ],
                  "properties": {
                    "last_7_days": {
                      "type": "integer"
                    },
                    "last_30_days": {
                      "type": "integer"
                    },
                    "lifetime": {
                      "type": "integer",
                      "description": "Every visit, with history. Without it (history false), the last 30 days' visits: show it as lifetime only when history is true. An integer either way, as apps built before history read it."
                    }
                  }
                },
                "contacts": {
                  "type": "integer",
                  "description": "Every contact the kard has."
                },
                "contacts_last_30_days": {
                  "type": "integer",
                  "description": "Contacts the kard got in the last 30 days."
                },
                "history": {
                  "type": "boolean",
                  "description": "Whether the kard's plan includes its history (lifetime visits, and visits by day, devices, places, sources and link clicks in GET /kards/{share_link}/analytics). False without a plan (a team kard: its organization's): only the last 7 and 30 days."
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "required": [
              "kards",
              "visits_last_30_days",
              "visits_lifetime",
              "contacts",
              "contacts_last_30_days",
              "history"
            ],
            "properties": {
              "kards": {
                "type": "integer"
              },
              "visits_last_30_days": {
                "type": "integer"
              },
              "visits_lifetime": {
                "type": "integer",
                "description": "The rows' lifetime added up. Every visit only when history is true."
              },
              "contacts": {
                "type": "integer"
              },
              "contacts_last_30_days": {
                "type": "integer"
              },
              "history": {
                "type": "boolean",
                "description": "Whether every kard listed has history, so visits_lifetime is every visit."
              }
            }
          }
        }
      },
      "KardAnalytics": {
        "type": "object",
        "required": [
          "time_range",
          "history",
          "totals",
          "visits_by_day",
          "device_types",
          "browsers",
          "countries",
          "regions",
          "cities",
          "referrers",
          "custom_link_clicks",
          "taps",
          "google"
        ],
        "properties": {
          "time_range": {
            "type": "string",
            "enum": [
              "7_days",
              "30_days",
              "lifetime"
            ],
            "description": "The range answered. Without history, lifetime is answered as 30_days."
          },
          "products": {
            "type": "array",
            "description": "With history, each of the kard's products, most tapped first: its taps in the range (a product's button, once per visit), the window before's (null for lifetime), and `asked`, the range's contacts who said they were interested. The web's Products panel. `[]` without history and for a kard without products. Left out by servers before products.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "available",
                "taps",
                "taps_previous",
                "asked"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "available": {
                  "type": "boolean",
                  "description": "False when it's Sold out."
                },
                "taps": {
                  "type": "integer"
                },
                "taps_previous": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "asked": {
                  "type": "integer"
                }
              }
            }
          },
          "google": {
            "description": "\"Your Kard on Google\": what Google Search Console says about the kard, from eKard's daily read of it, on every plan (history or not), whatever time_range asks: Google's own last 28 days. Only for the kard's holder and its organization's admins, as the web's Analytics panel is: null for anyone else (a site admin looking at another account's kard), and before the first read.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/KardGoogle"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "type": "boolean",
            "description": "Whether the kard's plan includes its history. False without a plan (a team kard: its organization's): the range's visits and contacts only, visits_lifetime the last 30 days', and every series, breakdown and link-click list empty."
          },
          "totals": {
            "type": "object",
            "required": [
              "visits",
              "visits_lifetime",
              "contacts",
              "contacts_in_range",
              "taps"
            ],
            "properties": {
              "visits": {
                "type": "integer"
              },
              "taps": {
                "type": "integer",
                "description": "The range's taps on the kard's buttons, every kind in taps added up. On every plan."
              },
              "visits_lifetime": {
                "type": "integer",
                "description": "Every visit, with history. Without it (history false), the last 30 days' visits, as lifetime is answered then: show it as lifetime only when history is true. An integer either way, as apps built before history read it."
              },
              "contacts": {
                "type": "integer"
              },
              "contacts_in_range": {
                "type": "integer"
              },
              "visits_while_off": {
                "type": "integer",
                "description": "The range's visits to the kard's \"switched off for now\" page while it was switched off (since 1.9.14), on every plan. Not in visits: say them apart (the web's \"While it was switched off: 3 visits to its “switched off for now” page\"). Left out by servers before 1.9.14."
              }
            }
          },
          "visits_by_day": {
            "$ref": "#/components/schemas/Counts"
          },
          "device_types": {
            "$ref": "#/components/schemas/Counts"
          },
          "browsers": {
            "$ref": "#/components/schemas/Counts"
          },
          "countries": {
            "$ref": "#/components/schemas/Counts"
          },
          "regions": {
            "$ref": "#/components/schemas/Counts"
          },
          "cities": {
            "$ref": "#/components/schemas/Counts"
          },
          "referrers": {
            "$ref": "#/components/schemas/Counts"
          },
          "custom_link_clicks": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "title",
                "url",
                "clicks"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "clicks": {
                  "type": "integer"
                }
              }
            }
          },
          "taps": {
            "type": "object",
            "description": "The range's taps on the kard's buttons, by kind, on every plan (history or not): what visitors did next on the kard's page. Each kind counts once per visit (a visitor who taps Call twice called once); robots, link previews and the kard's holder never count. Only kinds with taps appear, most first: call, whatsapp, sms (Text), email, directions (the address's Directions), google_business, google_review, website, instagram, facebook, linkedin, twitter (X), telegram, youtube, pay_<method> (a way to pay opened or copied: pay_upi, pay_paypal, pay_venmo, pay_cash_app, pay_pix, pay_iban, pay_zelle, pay_mpesa, pay_clabe), file (one of its files), link (one of its custom links), save_contact, book and product (a product's button: each product once per visit, 10 products a visit at most; per product in `products`). Only which button and when are kept, never the number or anything typed. Counted from the release that added them, so a range from before shows fewer. The web's taps line leaves out save_contact, book and link, which it counts on their own rows (vCard downloads, booking-page opens, custom_link_clicks).",
            "additionalProperties": {
              "type": "integer"
            },
            "propertyNames": {
              "enum": [
                "call",
                "whatsapp",
                "sms",
                "email",
                "directions",
                "google_business",
                "google_review",
                "website",
                "instagram",
                "facebook",
                "linkedin",
                "twitter",
                "telegram",
                "youtube",
                "pay_upi",
                "pay_paypal",
                "pay_venmo",
                "pay_cash_app",
                "pay_pix",
                "pay_iban",
                "pay_zelle",
                "pay_mpesa",
                "pay_clabe",
                "file",
                "link",
                "save_contact",
                "book",
                "product"
              ]
            },
            "example": {
              "call": 12,
              "whatsapp": 8,
              "directions": 3,
              "pay_upi": 2
            }
          },
          "taps_previous": {
            "type": [
              "object",
              "null"
            ],
            "description": "The taps of the window just before the range's, as long as it (7_days: the 7 days before the last 7), by kind, as `taps` counts them: for the web's change chip beside \"Taps on your buttons\". The web compares the kinds its line shows (all but save_contact, book and link) added up, the range's against these: \"▲ 25%\" (rounded), \"▼ 10%\", \"· same\", \"▲ new\" when there were none before and some now, and no chip when both are none. Null where the web shows no chip: lifetime (no window before) and without history (history false). Only kinds with taps appear; `{}` means none.",
            "additionalProperties": {
              "type": "integer"
            },
            "examples": [
              {
                "call": 9,
                "whatsapp": 8,
                "directions": 1
              }
            ]
          },
          "taps_counting_since": {
            "type": "string",
            "format": "date",
            "description": "The day taps were first counted, on any kard: before it, buttons were tapped uncounted, so a range reaching back past it shows fewer. The web's footnote: \"Counting since Oct 19.\" Today, until the first tap anywhere.",
            "examples": [
              "2026-10-19"
            ]
          },
          "saves": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The web Analytics' \"Saved you to their phone\": the range's people who downloaded the kard's contact (its Save contact), the same number the web shows the same person for the same range. Robots, link previews, prefetches and automated browsers never count, and nor does a download from before `saves_counting_since`. Not `taps.save_contact` (a tap, once per visit): a save is the file itself, from the page, an email signature's link or a code scanned off a screen. Null without history (history false), where the web shows no saves, and from servers before 1.9.3. The web's row: \"Saved you to their phone\", under it \"People who downloaded your contact · counting since 19 Oct\".",
            "examples": [
              14
            ]
          },
          "saves_uncounted": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The range's contact downloads from before `saves_counting_since`, which `saves` leaves out: robots and people were recorded alike then. The web says, only when it's more than 0: \"Not in this number: 12 downloads from before 19 Oct. Until then, search engines following your Save contact button were recorded with people, and the two can't be told apart.\" Null when `saves` is.",
            "examples": [
              0
            ]
          },
          "saves_counting_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The day saves were first counted, on any kard (the first save counted anywhere; today until then): the web's \"counting since 19 Oct\". Null when `saves` is.",
            "examples": [
              "2026-10-19"
            ]
          }
        }
      },
      "KardGoogle": {
        "type": "object",
        "description": "What Google Search Console said about the kard at eKard's last daily read: over the 28 days from `from` to `to` (Google's own days; its numbers run about 2 days behind), the times Google showed the kard in its search results and the times someone opened it from there, and the searches it was shown for. A failed read changes nothing: the last numbers stay, with their days. The web's words: \"Google showed your Kard 1,496 times between 22 Sep and 19 Oct, and 11 people opened it.\" (1 person; with none, \", but nobody opened it from there.\"), then \"People searched\" and each search with its impressions. With `impressions` 0: \"Google hasn't shown your Kard yet.\", and while the kard is hidden from search engines (`indexable` false on the kard) \"It's hidden from search engines now, so Google leaves it out of its results. Anyone with its link or QR code can still open it.\" with a \"Show it on Google\" button (`PATCH /kards/{share_link}/search_offer` with `yes`). Not counted (`counted` false): \"Google's numbers aren't counted for this Kard. Its address is on {own_domain}, its own domain. eKard reads Google's numbers for addresses on its own domain only.\" Free on every plan.",
        "required": [
          "counted",
          "own_domain",
          "impressions",
          "clicks",
          "from",
          "to",
          "read_at",
          "searches"
        ],
        "properties": {
          "counted": {
            "type": "boolean",
            "description": "False when the kard's address is on its own domain or its organization's (`own_domain`): those aren't in the Search Console property eKard reads, so `impressions` and `clicks` are 0 and `searches` is empty."
          },
          "own_domain": {
            "type": [
              "string",
              "null"
            ],
            "description": "The domain the kard's address is on when it isn't eKard's own (the kard's, or for an organization's own kard the organization's); null otherwise.",
            "examples": [
              "priya.com"
            ]
          },
          "impressions": {
            "type": "integer",
            "description": "The times Google showed the kard in its search results from `from` to `to`, its address and its tagged copies (`?via=chat`, `?utm_source=qr`) added up.",
            "examples": [
              1496
            ]
          },
          "clicks": {
            "type": "integer",
            "description": "The times someone opened the kard from those results.",
            "examples": [
              11
            ]
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The first of the 28 days the numbers cover. Null before the first read that found the kard and no read since (never so while `google` is present).",
            "examples": [
              "2026-09-22"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The last of them, about 2 days before the read.",
            "examples": [
              "2026-10-19"
            ]
          },
          "read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When eKard read them."
          },
          "searches": {
            "type": "array",
            "maxItems": 5,
            "description": "The searches Google showed the kard for, the most shown first, five at most. Google keeps rare searches private, so these can add up to less than `impressions`; with none named the web says \"Google didn't name the searches: it keeps searches few people make private.\"",
            "items": {
              "$ref": "#/components/schemas/KardGoogleSearch"
            }
          },
          "never_shown": {
            "type": "boolean",
            "description": "True while no read has ever found the kard: with `impressions` 0 the web says \"Google hasn't shown your Kard yet.\"; false for a kard an earlier read found and this one didn't: \"Google didn't show your Kard between 22 Sep and 19 Oct.\" (`from`, `to`). Always false while `impressions` is above 0, and never true while `numbers_from` is set."
          },
          "page_title": {
            "type": "string",
            "description": "The kard page's title, the one Google shows as its result: its name, then its company or job title, and its town while its address is shown, joined with \" · \". With `impressions` above 0 and `clicks` 0 the web says \"People pick a result by its title. Google shows yours as “Priya Sharma · Glow Studio · Pune”: your name, then your job title or company, and your town while your address is shown. If they don't say what you do, edit your Kard.\"",
            "examples": [
              "Priya Sharma · Glow Studio · Pune"
            ]
          },
          "address_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The day the kard took its address, while Google's numbers for it wait: it took it within the newest read's 28 days, so the numbers would mix its old address's. Null otherwise (a new kard Google hasn't shown has none). With it the web says \"Google's numbers for your Kard start around 18 Nov\" (`numbers_from`) and \"Your Kard has been at https://ekard.app/priya since 19 Oct. Google counts 28 days at a time, so its numbers show here once all 28 are from that address. Nothing to do: they appear on their own.\"",
            "examples": [
              "2026-10-19"
            ]
          },
          "numbers_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "About when its numbers show, while they wait (`address_since` plus 28 days and Google's 2); null otherwise.",
            "examples": [
              "2026-11-18"
            ]
          }
        }
      },
      "KardGoogleSearch": {
        "type": "object",
        "required": [
          "query",
          "impressions",
          "clicks"
        ],
        "properties": {
          "query": {
            "type": "string",
            "description": "What was typed into Google, as Google reports it.",
            "examples": [
              "yoga classes near me"
            ]
          },
          "impressions": {
            "type": "integer",
            "description": "The times Google showed the kard for it."
          },
          "clicks": {
            "type": "integer",
            "description": "The times someone opened the kard from it."
          }
        }
      },
      "SearchOffer": {
        "type": "object",
        "description": "\"Let people find this Kard on Google\" (the web's \"Be found on Google\"), asked once, free on every plan. The web's words: \"Switch it on, and people searching for “{search}” can find this page in Google's results. Today it's hidden from search engines. Anyone with its link or QR code can already open it: only Google's results change.\", then what Google would read (`preview`), then \"Free on every plan. Google decides what it shows and when. You can switch it off any time.\", and three answers: \"Show it on Google\" (`yes`), \"Not now\" (`not_now`), \"No, keep it hidden\" (`no`), sent with `PATCH /kards/{share_link}/search_offer`.",
        "required": [
          "search",
          "town",
          "preview"
        ],
        "properties": {
          "search": {
            "type": "string",
            "description": "What people would type to find it, as the web words it, \"{company or name} in {town}\" (the town only while the kard shows its address).",
            "examples": [
              "Sweta Studio in Anand"
            ]
          },
          "town": {
            "type": [
              "string",
              "null"
            ],
            "description": "The town the kard's title names, from the address it shows; null without one. Then the web adds: \"Many searches name a town, like “salon in Austin”. Add your address to put yours in the title.\"",
            "examples": [
              "Anand"
            ]
          },
          "preview": {
            "type": "object",
            "description": "What Google would read, as the web's preview shows it.",
            "required": [
              "url",
              "title",
              "description"
            ],
            "properties": {
              "url": {
                "type": "string",
                "description": "The kard's one address for search engines, without https:// (as `urls.public` is, on the brand's own domain or the kard's)."
              },
              "title": {
                "type": "string",
                "examples": [
                  "Sweta · Sweta Studio · Anand"
                ]
              },
              "description": {
                "type": "string",
                "examples": [
                  "Sweta, Anand: Hair, colour and bridal makeup."
                ]
              }
            }
          }
        }
      },
      "SearchOfferAnswerInput": {
        "type": "object",
        "required": [
          "answer"
        ],
        "properties": {
          "answer": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "not_now"
            ],
            "description": "`yes` lets search engines in (the kard's `indexable` becomes true), `no` keeps it hidden, `not_now` asks no more. Each ends the offer for good."
          }
        }
      },
      "SearchOfferAnswer": {
        "type": "object",
        "required": [
          "answer",
          "indexable",
          "message"
        ],
        "properties": {
          "answer": {
            "type": "string",
            "enum": [
              "yes",
              "no",
              "not_now"
            ],
            "description": "The answer kept: `yes` whenever search engines can see the kard, however they came to (the Settings switch, an earlier yes)."
          },
          "indexable": {
            "type": "boolean",
            "description": "Whether search engines may index the kard's page now."
          },
          "message": {
            "type": "string",
            "description": "The web's words for it, to show as written.",
            "examples": [
              "Thanks. Sweta is open to Google now. It can take Google a few days to notice it and show it in search results."
            ]
          }
        }
      },
      "Counts": {
        "type": "object",
        "description": "Label (or date) to count.",
        "additionalProperties": {
          "type": "integer"
        }
      },
      "Contact": {
        "type": "object",
        "required": [
          "id",
          "kard",
          "kard_name",
          "kard_organization",
          "source",
          "found_via",
          "name",
          "email",
          "country_code",
          "phone_number",
          "message",
          "note",
          "custom_fields",
          "card_details",
          "event_id",
          "event",
          "shared_kard",
          "kard_sent_at",
          "follow_up_on",
          "follow_up_by",
          "last_reach",
          "whatsapp_url",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kard": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kard's share_link. Null for a contact whose kard was deleted: kept for the account (a team kard's for the team), `GET /contacts` lists them since 1.9.5. Show \"From a deleted Kard\" where the kard's name goes; such a contact has no kard to open, and no `/kards/{share_link}/contacts/{id}`: it's `/contacts/{id}` (open, note, remind, delete; since 1.9.5)."
          },
          "kard_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kard's name, for lists across kards; null with `kard`."
          },
          "deleted_kard_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name the contact's kard had when it was deleted, on the contacts it left the account (`kard` null): show \"From the deleted Kard Diwali Fair\" where the kard's name goes. Null on a live kard's contact, and on one whose kard was deleted before 1.9.12 (show \"From a deleted Kard\"). Left out by servers before 1.9.12."
          },
          "kard_organization": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kard's organization's slug; null for a personal kard, and with `kard`. A personal kard and a team kard can have the same share_link, so `kard` and this together say which one (`?kard=…&organization=…`)."
          },
          "kard_message_first": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "text",
              "whatsapp",
              null
            ],
            "description": "The contact's kard's `message_first`: whether Text or WhatsApp leads on this contact's row, as the web's rows lead by the contact's kard. Null with `kard` (a deleted kard's contact: the account's own country decides). Left out by servers before 1.9.10."
          },
          "source": {
            "type": "string",
            "description": "How they arrived: `exchange` (the kard's connect form), `share_back` (they shared their own kard back), `booking` (they booked), `suggestion` (they suggested a time), `manual` (typed in by the kard's people), `scan` (read off their paper card), `api` (added through the API without a source; an `exchange` before 1.8.6), `agent` (added by an app or AI agent with the account's key, such as the MCP server's add_contact). In words: `source_label`, and every source's in `GET /app/config`'s `contact_sources`."
          },
          "source_label": {
            "type": "string",
            "description": "`source` in eKard's words, the same as a contact webhook's `data.source_label` and the \"How they came\" line of a contact sent to Google Contacts or HubSpot: \"Sent their details from your Kard\" (`exchange`), \"Shared their own Kard back\" (`share_back`), \"Booked a time from your Kard\" (`booking`), \"Suggested a time from your Kard\" (`suggestion`), \"Typed in by hand\" (`manual`), \"Read off their paper card\" (`scan`), \"Added through the API\" (`api`), \"Added by an app or AI agent\" (`agent`). Show it as written for a source the app has no words of its own for. Left out by servers before 1.9.3.",
            "examples": [
              "Read off their paper card"
            ]
          },
          "found_via": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "qr",
              "nfc",
              "signature",
              "chat",
              "email",
              "search",
              "social",
              "brand",
              "website",
              "direct",
              "unknown",
              null
            ],
            "description": "How they found the kard, read from their browser's visit to its page as the web's exchange, a kard shared back on the web, or Suggest a time made them (only the visit's link tag and the referring site's kind; nothing else about them is kept): `qr` (the kard's QR code, `?utm_source=qr`), `nfc` (an NFC tag, `?utm_source=nfc`), `signature` (the email signature's links, `?via=signature`), `chat` (`?via=chat`, or sent from a chat app: WhatsApp, Telegram, Messenger, Slack, ...), `email` (`?via=email`, or sent from a mail app or webmail), `search` (Google or another search engine), `social` (Instagram, Facebook, LinkedIn, X, YouTube, ...), `brand` (a link on eKard's own pages), `website` (a link on any other site), `direct` (no tag and no site named: typed in, a bookmark, an app that doesn't say), `unknown` (no visit of their browser to the kard was recorded). `null` for everyone else (typed in, scanned, booked, the API's, shared back from the app) and for contacts made before 1.8.6: show nothing for them. The web's words, on the contact sheet after \"Found your Kard through\": your QR code, your NFC tag, your email signature, a link in a chat (WhatsApp or another chat app), an email, a search (Google or another search engine), a social network (Instagram, Facebook, LinkedIn or another), a link on eKard, a link on another website, your link, opened directly, not known. A value you don't know: show nothing."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "What they wrote when they shared their details. For someone typed in or scanned (`manual`, `scan`) it's the owner's note, the same as `note`."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000,
            "description": "The owner's own note on this person (\"Met at the expo, wants 200 units\"); they never see it. For someone typed in or scanned (`manual`, `scan`) it's their `message`, where the apps have kept the owner's note; for anyone else it sits beside their message. Searchable (`query`), and in the contact file (NOTE) and the CSV (`note`)."
          },
          "custom_fields": {
            "type": "object",
            "description": "Their answers to the kard's own questions on its exchange sheet (`contact_form` on the kard), by each question's `key`: a short answer's text, a choice's words (a form made by hand before the editor may keep its own value for a choice: `choice_values` beside its `choices` says which words it stands for; a hand-made form's other fields, `contact_form.other_fields`). Answers to a question since removed stay under its key. A booking's answers to its calendar's questions are here too. Every answer is text: one an integration sent as a number or a yes/no reads as its digits or `true`/`false`, and a list as its items joined with \", \".",
            "additionalProperties": {
              "type": "string"
            }
          },
          "answers": {
            "type": "array",
            "description": "Their answers as the web's contact row and sheet say them (since 1.9.12), so an app needn't rebuild them from `custom_fields` and each kard's `contact_form`: the products they ticked first (`{\"key\": \"products\", \"question\": \"Interested in\", \"answer\": \"Mailer box, Kraft pouch\"}`; a return's ticks aren't here, they're `unchecked` in `products`), then the kard's questions in its exchange sheet's order, each in the words it was asked (an answer to an earlier wording under that wording, kept since the question was reworded), the answer in the owner's words (a choice's words, not its kept value), then any other answer kept (a question since removed, a booking's own) under its key made readable. Blank answers are left out; empty when there are none. The web's row shows the answers joined with \" · \" on one line (\"Mailer box, Kraft pouch · Buying · Within 3 months\"), each `question: answer` for a screen reader; the same list as a contact webhook's `data.answers`. A contact from a deleted kard has no questions left: each answer under its key.",
            "items": {
              "$ref": "#/components/schemas/ContactAnswer"
            }
          },
          "card_details": {
            "$ref": "#/components/schemas/CardDetails"
          },
          "event_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "event": {
            "description": "The event they were collected at.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NamedRecord"
              }
            ]
          },
          "shared_kard": {
            "description": "Their own kard, when they shared it back.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SharedKard"
              }
            ]
          },
          "products": {
            "type": "array",
            "description": "The kard's products they said they're interested in (since 1.9.7): ticked on the exchange sheet (\"Which of these interest you?\") or the one they tapped Ask about this on, in that order; `unchecked` ones were ticked on a return, by someone who typed their email or number, and wait to be checked like `card_details`' unchecked lists. `id` is null once the product is deleted; `name` is as they saw it.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "unchecked"
              ],
              "properties": {
                "id": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "unchecked": {
                  "type": "boolean"
                }
              }
            }
          },
          "kard_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When they were emailed the kard (a \"Here's ...'s card\" email)."
          },
          "came_back_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When they last came back and sent their details again through the kard (a return joins their first contact: its words go under theirs as \"Came back Sat 24 Oct: …\"), as the event recaps say it; null if they never came back. Left out by servers before 1.9.13."
          },
          "follow_up_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "\"Remind me\": the day to follow up with them, in the reminded person's own calendar. That morning, at about 8 in their time zone, one email lists everyone due that day or overdue (with WhatsApp, Call and Email), and their phones with the app get one push (event `follow_ups`). An overdue reminder is named on its day and the morning after, then only counted in the email (\"And 12 more from earlier days\"), so the same names don't come every morning; it stays here until cleared. `null`: no reminder."
          },
          "follow_up_by": {
            "description": "Who set the reminder last, or `null` with no reminder. The morning email and push go to them while they may open the Kard's contacts; once they can't (the Kard handed on, removed from the team, made a member), to the Kard's holder.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "last_reach": {
            "description": "\"Reached out\" (since 1.9.11): the latest time the kard's people tapped Call, Text, WhatsApp or Email on them on the web or in an app, or marked their follow-up done; `null` for someone not reached yet (`?reached=no` lists them). Read-only: an app adds its own taps with `POST /kards/{share_link}/contacts/{id}/reaches`. Show it as the web does, `words` and the day: \"Opened WhatsApp · Fri 23 Oct\" (never \"messaged\" or \"called\": a tap isn't a message sent).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ContactReach"
              }
            ]
          },
          "email_typo": {
            "description": "Their email looks mistyped (since 1.9.13): one slip from a big provider's address (`rohit.sharma@gmial.com`), by the check the web's exchange sheet makes as a visitor types it. The web's contact sheet says it under the email, `title` then `message` (\"rohit.sharma@gmial.com · looks like a typo for gmail.com\" / \"Email to it may never reach Rohit. Fixing it here sends Rohit nothing.\"), with **Fix**: Edit with `did_you_mean` in the email field, saved with `PATCH /kards/{share_link}/contacts/{id}` (`contact.email`), which sends the person nothing. `null` while the email reads right, and with none. Left out by servers before 1.9.13.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ContactEmailTypo"
              }
            ]
          },
          "reaches": {
            "description": "Only in one contact's own answers (`GET` and `PATCH /kards/{share_link}/contacts/{id}`, `GET /contacts/{id}`, a reach recorded, a merge), never in a list (since 1.9.13): the contact sheet's \"Reached out\", its newest lines and how many there are. Left out by servers before 1.9.13: show `last_reach` alone.",
            "$ref": "#/components/schemas/ContactReaches"
          },
          "same_person": {
            "description": "Only in one contact's own answers, as `reaches` (since 1.9.13): \"Same person?\", the web's notice atop the contact sheet. A visitor's send through the kard and someone its people added (typed in, Send to a number, scanned) share an email or a number, and stay two contacts until the owner merges them (`POST /kards/{share_link}/contacts/{id}/merge`); or two of a visitor's own sends from before 1.9.6, suggested (`suggested`), which can also be kept apart. `null` with none, and for a contact from a deleted kard. Left out by servers before 1.9.13.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SamePerson"
              }
            ]
          },
          "whatsapp_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their WhatsApp chat with a hello already written, for the person to send (the web's WhatsApp buttons beside a contact open the same): `https://wa.me/{digits}?text=…`, the words URL-encoded. The words are the account's own hello from the web's Profile › Edit, else the default in its country's language, filled in for this contact: their first name, the event they were met at (for anyone not met at one, the sentence naming it is left out) and the kard's link, tagged `?via=chat` for Analytics. In a `contact.created` webhook, the kard holder's hello. For a contact from a deleted kard (`kard` null), the chat with nothing written, `https://wa.me/{digits}`: there's no kard to send. `null` when WhatsApp can't open their number, or they gave none."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ContactAnswer": {
        "type": "object",
        "required": [
          "key",
          "question",
          "answer"
        ],
        "description": "One of a contact's answers, as the web says it.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The question's `key` in the kard's `contact_form` (an earlier wording's in `other_fields`); `products` for the products they ticked.",
            "examples": [
              "buying_or_selling"
            ]
          },
          "question": {
            "type": "string",
            "description": "The question in the words it was asked; \"Interested in\" for the products.",
            "examples": [
              "Buying or selling?"
            ]
          },
          "answer": {
            "type": "string",
            "description": "Their answer in the owner's words (a choice's words); the products' names joined with \", \".",
            "examples": [
              "Buying"
            ]
          }
        }
      },
      "ContactReach": {
        "type": "object",
        "required": [
          "way",
          "words",
          "at",
          "via",
          "by"
        ],
        "description": "One \"Reached out\" line on a contact.",
        "properties": {
          "way": {
            "type": "string",
            "enum": [
              "whatsapp",
              "text",
              "call",
              "email",
              "followed_up",
              "booking_link",
              "booked",
              "marked"
            ],
            "description": "What was tapped (`followed_up`: their follow-up marked done, on the web, in an app or from the morning email; `booking_link`, since 1.9.13: a booking link made for them on the web's Contacts; `booked`, since 1.9.14: a booking the desk made from the contact did their follow-up (an online booking leaves it set); `marked`, since 1.9.14: \"I reached them\", a call or a text from the person's own phone, on the web or from an app)."
          },
          "words": {
            "type": "string",
            "description": "The way in the web's words: \"Opened WhatsApp\", \"Opened a text\", \"Tapped Call\", \"Opened an email\", \"Followed up\", \"Made a booking link\", \"Booked\", \"Marked reached\"."
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "via": {
            "type": "string",
            "enum": [
              "web",
              "android",
              "ios",
              "api"
            ],
            "description": "Where it was tapped."
          },
          "by": {
            "description": "Who tapped it; `null` once their account is gone.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "ContactReaches": {
        "type": "object",
        "required": [
          "recent",
          "count"
        ],
        "description": "The contact sheet's \"Reached out\" (since 1.9.13). The web lists `recent` one per line, each its `words`, day and time in the reader's zone, and who when it wasn't the reader (\"Opened WhatsApp · Fri 23 Oct, 10:42 AM · by Priya Shah\"); under them, when `count` is more, \"And 3 earlier.\" (`count` less the lines shown; \"And 1 earlier.\"), then \"eKard sees the tap, not whether the call or the message went.\" With none: \"Not reached yet. A tap on Call, Text, WhatsApp or Email here puts a dated line here, and so does Done on Ravi's reminder.\"",
        "properties": {
          "recent": {
            "type": "array",
            "maxItems": 5,
            "description": "Its newest lines, newest first, at most 5 (the web's sheet lists as many).",
            "items": {
              "$ref": "#/components/schemas/ContactReach"
            }
          },
          "count": {
            "type": "integer",
            "description": "Every line it has.",
            "examples": [
              8
            ]
          }
        }
      },
      "ContactEmailTypo": {
        "type": "object",
        "required": [
          "did_you_mean",
          "title",
          "message"
        ],
        "properties": {
          "did_you_mean": {
            "type": "string",
            "format": "email",
            "description": "The address the person most likely meant, which the sheet's Fix puts in the email field.",
            "examples": [
              "rohit.sharma@gmail.com"
            ]
          },
          "title": {
            "type": "string",
            "description": "The web sheet's first line, to show as written.",
            "examples": [
              "rohit.sharma@gmial.com · looks like a typo for gmail.com"
            ]
          },
          "message": {
            "type": "string",
            "description": "Its second line, before Fix.",
            "examples": [
              "Email to it may never reach Rohit. Fixing it here sends Rohit nothing."
            ]
          }
        }
      },
      "SamePerson": {
        "type": "object",
        "required": [
          "contact_id",
          "name",
          "source",
          "created_at",
          "shared",
          "suggested",
          "kept_id",
          "names",
          "title",
          "message"
        ],
        "description": "The contact this one may be the same person as, on the same kard. Show `title` and `message` as the web's sheet does, with **Merge them**: the web's page then sets the two side by side (each one's name, role, email, number, event, words and note: `GET /kards/{share_link}/contacts/{contact_id}`), says what one contact keeps, and asks which name to keep when `names` has two.",
        "properties": {
          "contact_id": {
            "type": "integer",
            "description": "The other contact's id, which `POST …/merge` takes as `with`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "The other contact's `source`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "shared": {
            "type": "string",
            "description": "What they share, in the web's words.",
            "examples": [
              "the number +91 98201 33457",
              "the email rahul@snackwell.in",
              "the number +91 98201 33457 and the email rahul@snackwell.in"
            ]
          },
          "suggested": {
            "type": "boolean",
            "description": "Two of a visitor's own sends from before 1.9.6, which no return joined (`DELETE …/merge` keeps them apart for good). `false`: a visitor's send and someone added, found again by what they share while they're two."
          },
          "kept_id": {
            "type": "integer",
            "description": "The one that stays once merged: the visitor's send (the first, for a suggested pair), as they sent it, taking from the other what it lacks; the other is deleted."
          },
          "names": {
            "type": "array",
            "description": "The names to keep, the added one's (the later send's) first, which a merge without `name` keeps; one when they're the same. The web's \"Keep the name\".",
            "items": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "title": {
            "type": "string",
            "examples": [
              "Same person as Rahul Verma?"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "Rahul Verma was added by hand on 3 Oct, with the number +91 98201 33457."
            ]
          }
        }
      },
      "ContactMergeResult": {
        "type": "object",
        "required": [
          "contact",
          "merged_id",
          "message"
        ],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "merged_id": {
            "type": "integer",
            "description": "The contact merged into it, now deleted."
          },
          "message": {
            "type": "string",
            "examples": [
              "Merged: Rahul Verma is one contact now, with what they sent and what you added."
            ]
          }
        }
      },
      "ContactKeptApart": {
        "type": "object",
        "required": [
          "contact",
          "message"
        ],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "message": {
            "type": "string",
            "examples": [
              "Kept apart: Rahul Verma and Rahul V stay two contacts, and they won't be asked about again."
            ]
          }
        }
      },
      "ContactReachInput": {
        "type": "object",
        "required": [
          "way"
        ],
        "properties": {
          "way": {
            "type": "string",
            "enum": [
              "whatsapp",
              "text",
              "call",
              "email",
              "marked"
            ],
            "description": "A tap, or `marked` (since 1.9.14; a server before it answers `422`): \"I reached them\", for a call or a text the person made outside eKard; it takes the contact off \"Not reached yet\" as a tap does."
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When it was tapped, for a tap sent later from the app's outbox. Left out: now. Never later than now, nor earlier than 30 days ago (a time outside is taken as the nearest end)."
          }
        }
      },
      "ContactReachResult": {
        "type": "object",
        "required": [
          "reach",
          "contact"
        ],
        "properties": {
          "reach": {
            "description": "The line kept (the one already kept, on a `200`); `null` for a site admin's tap, which isn't kept.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ContactReach"
              }
            ]
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          }
        }
      },
      "ContactBulkInput": {
        "type": "object",
        "required": [
          "verb"
        ],
        "properties": {
          "verb": {
            "type": "string",
            "enum": [
              "event",
              "follow_up",
              "done",
              "delete"
            ],
            "description": "`event`: put them in an event (`move_to_event_id`) or take them off theirs (`clear_event`). `follow_up`: one reminder for them all on `follow_up_on`, or clear theirs (`clear_follow_up`). `done`: their follow-ups marked done, the web's Done on To follow up's bar: their reminders cleared (off To follow up and the morning email), in Done's words, with the hour's undo (since 1.9.10). `delete`: delete them, for good."
          },
          "ids": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "integer"
            },
            "description": "The contacts picked (the web's ticked rows). Ignored with `all`."
          },
          "all": {
            "type": "boolean",
            "default": false,
            "description": "Every contact the list holds, on every page, as `query`, `event_id`, `follow_up`, `question` with `answer`, `found_via`, `product` and `reached` narrow it (the web's \"Select all 340 contacts matching “mehta”\")."
          },
          "query": {
            "type": "string",
            "description": "The list's search, as `GET /kards/{share_link}/contacts` takes it."
          },
          "event_id": {
            "type": "integer",
            "description": "The list narrowed to one of the kard's events' people (another kard's event: `404`). Not where they go: that's `move_to_event_id`."
          },
          "follow_up": {
            "type": "string",
            "enum": [
              "due",
              "set"
            ],
            "description": "The list narrowed to reminders: `due` (on the account's today or before), `set` (any)."
          },
          "question": {
            "type": "string",
            "examples": [
              "what_are_you_looking_for"
            ],
            "description": "With `answer`: the list narrowed to the people who picked one choice of the kard's own questions, as `GET /kards/{share_link}/contacts` takes it: the `key` of a `choice` question in the kard's `contact_form`. A key the kard doesn't have, a short answer's, or either without the other is `400 invalid_parameter`, and nothing changes: the action never falls back to the whole list."
          },
          "answer": {
            "type": "string",
            "examples": [
              "Wholesale"
            ],
            "description": "With `question`: one of that question's `choices`, in its words."
          },
          "found_via": {
            "type": "string",
            "description": "The list narrowed to how they found the kard, one or more comma-separated, as `GET /kards/{share_link}/contacts` takes it."
          },
          "reached": {
            "type": "string",
            "enum": [
              "no",
              "yes"
            ],
            "description": "The list narrowed to the people not reached yet (`no`) or the others, as `GET /kards/{share_link}/contacts` takes it (since 1.9.11)."
          },
          "product": {
            "type": "integer",
            "description": "The list narrowed to the people interested in one of the kard's products, by its `id`, as `GET /kards/{share_link}/contacts` takes it (the web's \"Interested in\"), so `all: true` acts on exactly them. An id the kard doesn't have is `400 invalid_parameter`, and nothing changes: the action never falls back to the whole list. Taken since 1.9.8; documented since 1.9.10."
          },
          "count": {
            "type": "integer",
            "description": "How many you showed as picked (the dry run's `count`, or the ticked ones). Needed unless `dry_run`; when it's no longer true: `409 count_changed`, and nothing changes."
          },
          "dry_run": {
            "type": "boolean",
            "default": false,
            "description": "Say what it would do, and change nothing: the web's step before the button."
          },
          "move_to_event_id": {
            "type": "integer",
            "description": "With `event`: one of the kard's events, not archived. Those already in it stay; the others move to it, from no event or another."
          },
          "clear_event": {
            "type": "boolean",
            "description": "With `event`, instead of `move_to_event_id`: take them off their events (the web's No event). It wins over a `move_to_event_id` beside it, as on one contact."
          },
          "follow_up_on": {
            "type": "string",
            "format": "date",
            "examples": [
              "2030-01-10"
            ],
            "description": "With `follow_up`: the day (YYYY-MM-DD), your own today or later, at most 2 years ahead. The reminder is yours (`follow_up_by`): that morning one email lists them all, and your phones with the app get one push. Those with a reminder on another day move to this one."
          },
          "clear_follow_up": {
            "type": "boolean",
            "description": "With `follow_up`, instead of `follow_up_on`: clear their reminders (no morning email about them)."
          }
        }
      },
      "ContactBulkResult": {
        "type": "object",
        "required": [
          "verb",
          "dry_run",
          "count",
          "changed",
          "unchanged",
          "who",
          "now",
          "message",
          "undo"
        ],
        "properties": {
          "verb": {
            "type": "string",
            "enum": [
              "event",
              "follow_up",
              "done",
              "delete"
            ]
          },
          "dry_run": {
            "type": "boolean"
          },
          "count": {
            "type": "integer",
            "description": "How many are picked."
          },
          "changed": {
            "type": "integer",
            "description": "How many it changed (with `dry_run`: would change). `delete`: how many were (would be) deleted."
          },
          "unchanged": {
            "type": "integer",
            "description": "How many had it already, and stay as they were (always 0 for `delete`)."
          },
          "who": {
            "type": "string",
            "description": "Who's picked, in the web's words.",
            "examples": [
              "Asha Rao, Om Prakash and Ravi Mehta.",
              "Asha Rao, Om Prakash and 10 others.",
              "All 340 contacts matching “mehta”, on every page of the list."
            ]
          },
          "now": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where they stood when you asked (before this change), in the web's words; null for `delete`.",
            "examples": [
              "9 have no event · 2 are in Trade Fair",
              "3 of the 12 have a reminder",
              "3 of the 12 have a reminder, 2 of them from an earlier day"
            ]
          },
          "message": {
            "type": "string",
            "description": "With `dry_run`, what the choice does (the web's words under the choices); otherwise what was done, as the web's list says it after.",
            "examples": [
              "11 go in Auto Expo. 1 is there already.",
              "This is permanent: there's no undo.",
              "Put 11 contacts in Auto Expo.",
              "Nothing changed: all 12 were already in Auto Expo.",
              "Marked 3 follow-ups done: they're off To follow up and the morning email.",
              "Nothing changed: none of the 3 had a reminder to mark done.",
              "Deleted 12 contacts."
            ]
          },
          "undo": {
            "description": "For a change to `event`, `follow_up` or `done` that changed someone (not a dry run): how to undo it, within the hour. Null otherwise.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "token",
                  "expires_at"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "For `POST /kards/{share_link}/contacts/bulk/undo`; it's yours, for this kard."
                  },
                  "expires_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            ]
          }
        }
      },
      "ContactBulkCountChanged": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "count"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "count_changed"
                ]
              },
              "message": {
                "type": "string",
                "examples": [
                  "The list changed since you looked: this is now 341 contacts, not 340. Check who's in it, then confirm again.",
                  "Nobody left to change: the contacts you picked were deleted or changed since you looked."
                ]
              },
              "count": {
                "type": "integer",
                "description": "How many it picks now."
              }
            }
          }
        }
      },
      "ContactBulkUndone": {
        "type": "object",
        "required": [
          "restored",
          "kept",
          "message"
        ],
        "properties": {
          "restored": {
            "type": "integer",
            "description": "How many went back as they were."
          },
          "kept": {
            "type": "integer",
            "description": "How many were changed or deleted since, and stay as they are."
          },
          "message": {
            "type": "string",
            "examples": [
              "Undone: 11 contacts are back as they were.",
              "Undone: 10 contacts are back as they were. 1 changed since, so it keeps its newer change.",
              "Nothing to put back: 2 changed since, so they keep their newer change."
            ]
          }
        }
      },
      "CardDetails": {
        "type": "object",
        "description": "The contact's other details: as an app read them off a paper card, and as the owner corrected them (`job_title` and `company` on the web's contact sheet too). Unknown keys are dropped, blanks too. On PATCH only the keys sent change; `\"\"` clears one.",
        "properties": {
          "job_title": {
            "type": "string",
            "maxLength": 100
          },
          "company": {
            "type": "string",
            "maxLength": 200
          },
          "website": {
            "type": "string",
            "maxLength": 300,
            "description": "Without a scheme (`www.example.com`), saved with `https://`; one that isn't an `http(s)` address (`mailto:`, `javascript:`, a word) is left out."
          },
          "address": {
            "type": "string",
            "maxLength": 300
          },
          "notes": {
            "type": "string",
            "maxLength": 1000
          },
          "phones": {
            "type": "array",
            "maxItems": 10,
            "description": "Numbers beyond phone_number.",
            "items": {
              "type": "string",
              "maxLength": 30
            }
          },
          "emails": {
            "type": "array",
            "maxItems": 10,
            "description": "Addresses beyond email.",
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 255
            }
          },
          "unchecked_phones": {
            "type": "array",
            "maxItems": 10,
            "description": "Numbers a visitor typed when they came back to the Kard's exchange (from another phone, or after half an hour) that the contact didn't have. Nothing shows they're the person's: anyone who knows their email or number can send it. Never `phone_number` or `phones`: show them as not checked. On PATCH, `\"\"` or `[]` clears them, and so for each `unchecked_*` (since 1.9.10; before, the keys were dropped and nothing changed). They're never written: the value the contact has already (`card_details` sent back as read) is accepted and left as it is, and any other value (text, a number, `true` or `false`) is `422 invalid_parameter`; to keep a number as theirs, add it to `phones`.",
            "items": {
              "type": "string",
              "maxLength": 30
            }
          },
          "unchecked_emails": {
            "type": "array",
            "maxItems": 10,
            "description": "Addresses typed the same way, never `email` or `emails`: show them as not checked.",
            "items": {
              "type": "string",
              "format": "email",
              "maxLength": 255
            }
          },
          "unchecked_companies": {
            "type": "array",
            "maxItems": 10,
            "description": "Companies typed the same way, never `company`: show them as not checked.",
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "unchecked_answers": {
            "type": "array",
            "maxItems": 10,
            "description": "Answers to the kard's questions typed the same way, as the question and the answer (`\"Looking for: Retail\"`), never in `custom_fields`: show them as not checked.",
            "items": {
              "type": "string",
              "maxLength": 640
            }
          }
        }
      },
      "SharedKard": {
        "type": "object",
        "required": [
          "share_link",
          "name",
          "public_url"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ContactInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Needs a dot in its domain: `kabir@mehtaevents` is `422`, `details.email` asking for the ending. A contact saved before keeps its address until it changes."
          },
          "country_code": {
            "type": "string",
            "examples": [
              "+91"
            ],
            "description": "The dialing code picked beside a number typed without one (the web's connect form)."
          },
          "phone_country": {
            "type": "string",
            "examples": [
              "IN"
            ],
            "description": "The country (ISO 3166 alpha-2) a number typed without its country code is read in: send the phone's region (its SIM, else its locale). `9876543210` with `IN` saves as `+919876543210`."
          },
          "phone_number": {
            "type": "string",
            "description": "A number that starts with `+` stands as typed. One without it is read with `country_code`, else `phone_country`; otherwise it's `422` asking for the country code (`details.phone_number`)."
          },
          "message": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000,
            "description": "The owner's own note (see `Contact.note`). `\"\"` or `null` clears it. For a `manual` or `scan` contact it is the `message`: sent with a `message`, `note` wins. Longer than 1000 characters: `422 validation_failed`, `details.note`."
          },
          "event_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "One of the kard's events (GET /kards/{share_link}/events); another kard's is `422 validation_failed`, in `details.event`. `null` takes the contact off its event, as `clear_event` does."
          },
          "clear_event": {
            "type": "boolean",
            "description": "`true` takes the contact off its event, as `\"event_id\": null` does, for a client that leaves nulls out rather than send them. Sent with an `event_id`, it wins. `false`, or left out, changes nothing. On create, `true` also keeps it off the event running then: without an `event_id`, a new contact is tagged with the kard's running event."
          },
          "custom_fields": {
            "type": "object",
            "description": "Answers to the kard's own form fields, by name (`key`): a field the kard's form doesn't have is left out. Each is kept as text: a number or a yes/no is kept as its digits or `true`/`false`, a null as no answer (`\"\"`)."
          },
          "card_details": {
            "$ref": "#/components/schemas/CardDetails"
          },
          "follow_up_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "examples": [
              "2030-01-10"
            ],
            "description": "\"Remind me\" on this day (YYYY-MM-DD, the person's own today or later, at most 2 years ahead): the reminder becomes the sender's (`follow_up_by`). `null` or `\"\"` clears it (\"Done\"). Another value: `422 invalid_parameter`; a past day or one too far: `422 validation_failed`, `details.follow_up_on`."
          }
        }
      },
      "KeptContactInput": {
        "type": "object",
        "description": "What changes on a contact from a deleted kard (`PATCH /contacts/{id}`): your note and the reminder, nothing the person sent. Only the fields sent change; any other is `422 invalid_parameter`.",
        "properties": {
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000,
            "description": "Your own note on them (see `Contact.note`; for someone typed in or scanned, their `message`). `\"\"` or `null` clears it. Longer than 1000 characters: `422 validation_failed`, `details.note`."
          },
          "follow_up_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "examples": [
              "2030-01-10"
            ],
            "description": "\"Remind me\" on this day, as on a kard's contact (`ContactInput.follow_up_on`): YYYY-MM-DD, your own today or later, at most 2 years ahead, and the reminder becomes yours (`follow_up_by`). `null` or `\"\"` clears it (\"Done\"). Another value: `422 invalid_parameter`; a past day or one too far: `422 validation_failed`, `details.follow_up_on`."
          }
        }
      },
      "ContactCreateInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ContactInput"
          },
          {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "manual",
                  "scan",
                  "agent"
                ],
                "description": "`manual`: typed in by the kard's people; `scan`: read off the person's paper card; both from the app's sign-in only. From the account's key (an AI agent, a Zap, a script) either is saved as `agent`: what an app or agent passes on may be someone else's words, so a contact found in a connected app (HubSpot, Google Contacts) gets a note, never its empty fields. The owner isn't emailed about any of the three. Leave it out for a lead from elsewhere: it is saved as `api`, the owner is emailed, and the person gets the kard unless `send_my_kard` is `false`, by the same rules as `send_my_kard`."
              },
              "idempotency_key": {
                "type": "string",
                "maxLength": 100,
                "description": "Your key for this contact on this kard. Sending it again answers 200 with the first contact, nothing saved or sent twice."
              },
              "captured_at": {
                "type": "string",
                "format": "date-time",
                "examples": [
                  "2026-11-07T20:30:00+05:30"
                ],
                "description": "When the app made it (since 1.9.13), for one sent later from the upload queue: without an `event_id`, it's tagged with the event running then (its days and hours), not when the request arrives. Left out, the request's time. A time ahead of now is read as now; one more than 31 days back leaves it off any event (no event running now is its); one that isn't ISO 8601 is `400 invalid_parameter`."
              },
              "send_my_kard": {
                "type": "boolean",
                "default": false,
                "description": "Email the person this kard (a \"Here's ...'s card\" email): with a source, only when `true`; without one, unless `false`. Sent only from an account whose email is verified, at most once a day per person and kard, 200 a day per account, and never from a kard hidden after a complaint; `message` says when it wasn't."
              }
            }
          }
        ]
      },
      "ContactCreateRequest": {
        "type": "object",
        "required": [
          "contact"
        ],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/ContactCreateInput"
          }
        }
      },
      "ContactCreated": {
        "type": "object",
        "required": [
          "contact",
          "message"
        ],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "message": {
            "type": "string",
            "description": "What happened, for the person: \"Saved Ravi Mehta and sent them your Kard.\", or why the kard wasn't sent."
          }
        }
      },
      "ContactEnvelope": {
        "type": "object",
        "required": [
          "contact"
        ],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "message": {
            "type": "string",
            "description": "Only from `PATCH /kards/{share_link}/contacts/{id}` when the email or the number changed (since 1.9.13), the web sheet's words after its Edit: \"Saved Rohit's email. Nothing was sent to Rohit.\"",
            "examples": [
              "Saved Rohit's email. Nothing was sent to Rohit."
            ]
          }
        }
      },
      "ContactPage": {
        "type": "object",
        "required": [
          "contacts",
          "pagination"
        ],
        "properties": {
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "Event": {
        "type": "object",
        "required": [
          "id",
          "name",
          "archived",
          "starts_on",
          "ends_on",
          "time_zone",
          "status",
          "tags_new_contacts",
          "recap_sent_at",
          "contacts_count",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "starts_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Its first day (event mode), in `time_zone`. null for an event without days."
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Its last day, the same as `starts_on` for a one-day event. null without days."
          },
          "time_zone": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Asia/Kolkata"
            ],
            "description": "The IANA zone its days run in, midnight to midnight. null without days."
          },
          "status": {
            "type": "string",
            "enum": [
              "running",
              "upcoming",
              "ended",
              "undated"
            ],
            "description": "Where it stands now, from its days alone (an archived event has one too)."
          },
          "tags_new_contacts": {
            "type": "boolean",
            "description": "True while it runs and isn't archived: every new contact the kard collects is tagged with it."
          },
          "recap_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When its recap went (the morning after its last day, by email and as an `event_recap` push). null until then, or when nobody was tagged. An event of two days or more also has a recap each evening, not stamped here."
          },
          "contacts_count": {
            "type": "integer"
          },
          "visitor_email_line": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its own line at the top of the email each visitor met there gets (a contact tagged with it), with the kard's name. Those people never get the kard's own line (`settings.visitor_email_line`), which goes to everyone met outside an event. null: no line from the owner for them."
          },
          "visitor_email_line_held_back": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "unverified",
              "foreign_link",
              null
            ],
            "description": "Why `visitor_email_line` isn't going out, as for the kard's line: `unverified` (whoever wrote it last hasn't verified their address), `foreign_link` (an address in it isn't the kard's own page any more). null while it goes out, and without a line."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EventInput": {
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "description": "On create: your key for this one. Sending it again answers 200 with the first, nothing made twice (a retry after a lost answer)."
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "note": {
            "type": "string"
          },
          "archived": {
            "type": "boolean"
          },
          "starts_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "examples": [
              "2026-10-21"
            ],
            "description": "Its first day (YYYY-MM-DD). With `ends_on`, both or neither: while it runs, every new contact the kard collects is tagged with it. Not a date: `422 invalid_parameter`."
          },
          "ends_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "examples": [
              "2026-10-23"
            ],
            "description": "Its last day, on or after `starts_on`, at most 31 days in all; otherwise `422 validation_failed`, `details.ends_on`. Changing it sends the recap again after the new last day."
          },
          "time_zone": {
            "type": "string",
            "examples": [
              "Asia/Kolkata"
            ],
            "description": "The IANA zone its days run in. Left out: the caller's own (their calendar's, else their browser's). Unknown: `422 validation_failed`, `details.time_zone`."
          },
          "visitor_email_line": {
            "type": [
              "string",
              "null"
            ],
            "description": "Its own line for the people met there (`Event.visitor_email_line`), with the kard's line's rules: one line, at most 280 characters, no web or email address but the kard's own page (`422 validation_failed`, `details.visitor_email_line`). Saved with you as its writer: it goes out while your address is verified. An empty string or null takes it out."
          }
        }
      },
      "EventEnvelope": {
        "type": "object",
        "required": [
          "event"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/Event"
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "name",
          "line",
          "price",
          "action",
          "paid_link",
          "available",
          "hidden",
          "shown",
          "position",
          "kind",
          "origin_country",
          "condition",
          "sku",
          "photo",
          "problem",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "description": "As the owner wrote it, never translated."
          },
          "line": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 140,
            "description": "The one line under the name."
          },
          "price": {
            "type": "object",
            "required": [
              "amount_minor",
              "currency",
              "mode",
              "text"
            ],
            "properties": {
              "amount_minor": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "In the currency's minor units (49900 for ₹499). null with `mode` `ask`."
              },
              "currency": {
                "type": "string",
                "examples": [
                  "INR"
                ],
                "description": "ISO 4217, one of the currencies eKard prices in."
              },
              "mode": {
                "type": "string",
                "enum": [
                  "fixed",
                  "from",
                  "ask"
                ],
                "description": "`fixed`: one figure. `from`: \"From\" before it. `ask`: \"Ask for price\", no figure."
              },
              "text": {
                "type": "string",
                "examples": [
                  "₹1,800",
                  "From $499",
                  "Ask for price"
                ],
                "description": "The price as the owner's pages show it."
              }
            }
          },
          "action": {
            "type": "object",
            "required": [
              "kind",
              "label",
              "url"
            ],
            "description": "The product's one button.",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "whatsapp",
                  "pay",
                  "ask",
                  "link"
                ],
                "description": "`whatsapp`: WhatsApp opens with the product and its price written. `pay`: the kard's way to get paid, with the price. `ask`: the exchange form, this product ticked. `link`: the product's own page (`url`)."
              },
              "label": {
                "type": "string",
                "examples": [
                  "Order on WhatsApp",
                  "Pay",
                  "Ask about this",
                  "Open link"
                ]
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "The page that sells it, for `link`."
              }
            }
          },
          "paid_link": {
            "type": "boolean",
            "description": "\"I earn from this link\": the product shows \"Paid link\". Only a `link` carries it."
          },
          "available": {
            "type": "boolean",
            "description": "False: Sold out, its button greyed; it stays on the kard."
          },
          "hidden": {
            "type": "boolean",
            "description": "Off the kard by the owner's choice; kept."
          },
          "shown": {
            "type": "boolean",
            "description": "On the kard now: not hidden, and among the first the plan shows (6 without a plan, 200 with one). A plan that ends hides those past six; none is deleted."
          },
          "position": {
            "type": "integer",
            "description": "Its place in the kard's order, from 0."
          },
          "kind": {
            "type": "string",
            "enum": [
              "goods",
              "service"
            ]
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"Made in\", ISO 3166-1 alpha-2."
          },
          "condition": {
            "type": "string",
            "enum": [
              "new",
              "used",
              "refurbished"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "The owner's own code for it."
          },
          "photo": {
            "type": [
              "object",
              "null"
            ],
            "required": [
              "tile_url",
              "detail_url"
            ],
            "description": "null without a photo.",
            "properties": {
              "tile_url": {
                "type": "string",
                "format": "uri",
                "description": "A 320-pixel square WebP, for lists and the kard."
              },
              "detail_url": {
                "type": "string",
                "format": "uri",
                "description": "Up to 800 pixels on its long side, WebP."
              }
            }
          },
          "problem": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Order on WhatsApp needs your WhatsApp number on your Kard."
            ],
            "description": "Why its button can't work now, in words to show beside it (the kard's WhatsApp number removed since, no way to get paid); null when it can."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductInput": {
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "description": "On create: your key for this one. Sending it again answers 200 with the first, nothing made twice (a retry after a lost answer)."
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "line": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 140
          },
          "price": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "examples": [
              "1,800",
              "40.50"
            ],
            "description": "The amount as people type it, in `currency`. Not an amount: `422 validation_failed`, `details.price`."
          },
          "price_minor": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Or the amount in the currency's minor units (49900 for ₹499)."
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "from",
              "ask"
            ]
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217. Left out on create: the kard's country's (its phone number's, else its holder's)."
          },
          "action": {
            "type": "string",
            "enum": [
              "whatsapp",
              "pay",
              "ask",
              "link"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `link`: the page that sells it. Written without https:// (\"myshop.com/lip-tint\"), it's saved with it."
          },
          "paid_link": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "hidden": {
            "type": "boolean"
          },
          "kind": {
            "type": "string",
            "enum": [
              "goods",
              "service"
            ]
          },
          "origin_country": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"Made in\", two letters."
          },
          "condition": {
            "type": "string",
            "enum": [
              "new",
              "used",
              "refurbished"
            ]
          },
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "remove_photo": {
            "type": "boolean",
            "description": "true takes the photo away."
          }
        }
      },
      "ProductMultipart": {
        "type": "object",
        "description": "The same fields as JSON, named product[field], plus the photo (JPEG, PNG, GIF or WebP, up to 5 MB) or product[remove_photo]=1.",
        "properties": {
          "product[name]": {
            "type": "string"
          },
          "product[price]": {
            "type": "string"
          },
          "product[idempotency_key]": {
            "type": "string",
            "maxLength": 100,
            "description": "On create only, as `idempotency_key` in JSON."
          },
          "product[photo]": {
            "type": "string",
            "contentMediaType": "image/jpeg"
          },
          "product[remove_photo]": {
            "type": "string",
            "enum": [
              "1"
            ]
          }
        }
      },
      "ProductEnvelope": {
        "type": "object",
        "required": [
          "product"
        ],
        "properties": {
          "product": {
            "$ref": "#/components/schemas/Product"
          },
          "message": {
            "type": "string",
            "examples": [
              "Mailer box is added to your products.",
              "Mailer box is saved.",
              "Mailer box is marked Sold out: it stays on your Kard with its button greyed."
            ],
            "description": "What happened, in words to show. On a create or a change; a change of `available` or `hidden` alone says that switch, as the web's list does."
          }
        }
      },
      "ProductList": {
        "type": "object",
        "required": [
          "products",
          "heading",
          "on_exchange",
          "prices_include_taxes",
          "can_edit",
          "limits"
        ],
        "properties": {
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "heading": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Products section's heading in the owner's words; null for ours (\"Products\", in each visitor's language)."
          },
          "on_exchange": {
            "type": "boolean",
            "description": "The exchange asks visitors which products interest them."
          },
          "prices_include_taxes": {
            "type": "boolean",
            "description": "\"Prices include taxes\" shows under the products. Until the owner says, on where prices are shown with taxes in (India, the EU, the UK)."
          },
          "can_edit": {
            "type": "boolean",
            "description": "The key's person may change these products: false for a team kard's member who isn't one of its admins."
          },
          "currency": {
            "type": "string",
            "examples": [
              "INR",
              "USD"
            ],
            "description": "ISO 4217: the currency a product added now starts in when `currency` is left out, for Add to show before the first product. The kard's country's (its phone number's, else its holder's); USD when neither says one. A product keeps its own (`price.currency`), so the list's products may be in others. Always sent since 1.9.9; absent from a server before it: then read it from a product, or leave the choice to the server."
          },
          "currency_name": {
            "type": "string",
            "examples": [
              "Indian rupee",
              "US dollar"
            ],
            "description": "`currency`'s name, as the web's product form names each currency it offers (its option reads \"₹ INR\", this its title): in the language `Owner-Language` asks for, else English. Left out by servers before 1.9.13."
          },
          "limits": {
            "type": "object",
            "required": [
              "shown",
              "max",
              "count",
              "shown_count"
            ],
            "properties": {
              "shown": {
                "type": "integer",
                "description": "How many the kard shows on its plan: 6 without one, 200 with one."
              },
              "max": {
                "type": "integer",
                "description": "How many a kard holds, on any plan: 200."
              },
              "count": {
                "type": "integer",
                "description": "How many it has, hidden ones too."
              },
              "shown_count": {
                "type": "integer",
                "description": "How many it shows now."
              }
            }
          }
        }
      },
      "Document": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "public_url",
          "landing_page_published",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "byte_size": {
            "type": [
              "integer",
              "null"
            ]
          },
          "public_url": {
            "type": "string",
            "format": "uri"
          },
          "landing_page_published": {
            "type": "boolean"
          },
          "position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DocumentEnvelope": {
        "type": "object",
        "required": [
          "document"
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/Document"
          }
        }
      },
      "Design": {
        "type": "object",
        "required": [
          "published"
        ],
        "properties": {
          "draft_html": {
            "type": [
              "string",
              "null"
            ]
          },
          "published": {
            "type": "boolean"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "draft_saved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DesignEnvelope": {
        "type": "object",
        "required": [
          "design"
        ],
        "properties": {
          "design": {
            "$ref": "#/components/schemas/Design"
          },
          "sanitizer_removals": {
            "type": "array",
            "description": "On publish, what the sanitizer stripped for safety.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DesignInput": {
        "type": "object",
        "required": [
          "design"
        ],
        "properties": {
          "design": {
            "type": "object",
            "required": [
              "draft_html"
            ],
            "properties": {
              "draft_html": {
                "type": "string",
                "maxLength": 150000
              }
            }
          },
          "publish": {
            "type": "boolean",
            "description": "Publish the saved draft in the same call."
          }
        }
      },
      "DesignVersion": {
        "type": "object",
        "required": [
          "id",
          "source",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "enum": [
              "draft_save",
              "publish",
              "checkpoint",
              "restore",
              "ai_edit"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Qr": {
        "type": "object",
        "required": [
          "id",
          "properties",
          "logo_attached",
          "public_png_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "design_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "properties": {
            "type": "object",
            "description": "The design keys set so far."
          },
          "logo_attached": {
            "type": "boolean"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "public_png_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "QrEnvelope": {
        "type": "object",
        "required": [
          "qr"
        ],
        "properties": {
          "qr": {
            "$ref": "#/components/schemas/Qr"
          }
        }
      },
      "SignatureEnvelope": {
        "type": "object",
        "required": [
          "signature"
        ],
        "properties": {
          "signature": {
            "$ref": "#/components/schemas/Signature"
          }
        }
      },
      "Signature": {
        "type": "object",
        "required": [
          "layout",
          "layouts",
          "html",
          "text",
          "kard_url",
          "photo_url",
          "qr_url"
        ],
        "properties": {
          "layout": {
            "type": "string",
            "enum": [
              "qr",
              "button",
              "text"
            ]
          },
          "layouts": {
            "type": "array",
            "description": "Every layout, in the order to offer them.",
            "items": {
              "type": "object",
              "required": [
                "key",
                "label"
              ],
              "properties": {
                "key": {
                  "type": "string",
                  "enum": [
                    "qr",
                    "button",
                    "text"
                  ]
                },
                "label": {
                  "type": "string",
                  "description": "For people, e.g. \"Photo and QR code\"."
                }
              }
            }
          },
          "html": {
            "type": "string",
            "description": "The signature as HTML, to put on the clipboard as text/html."
          },
          "text": {
            "type": "string",
            "description": "The same as plain text, lines separated by \\n, for the clipboard's text/plain."
          },
          "kard_url": {
            "type": "string",
            "format": "uri"
          },
          "photo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The photo the signature shows (always the kard's current one, a JPEG); null when the kard has none."
          },
          "qr_url": {
            "type": "string",
            "format": "uri",
            "description": "The kard's QR as a PNG (always its current address)."
          },
          "file": {
            "type": [
              "object",
              "null"
            ],
            "description": "The file the web offers as the signature's line: the kard's first shown file, by position. Null when the kard shows none. Left out by servers before 1.9.13 or 1.9.14.",
            "required": [
              "name",
              "url"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "As the line says it, e.g. \"Résumé\"."
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "The file's page under the kard's address."
              }
            }
          },
          "with_file": {
            "type": "boolean",
            "description": "Whether `html` and `text` carry the file's line (`file=1` on a kard with a file). Left out by servers before 1.9.13 or 1.9.14."
          }
        }
      },
      "QrDesign": {
        "type": "object",
        "description": "Strings; booleans as \"1\"/\"0\"; colours as #RRGGBB. Only send the keys you change.",
        "properties": {
          "module_px_size": {
            "type": "string",
            "description": "4 to 20"
          },
          "qr_shape": {
            "type": "string",
            "enum": [
              "square",
              "circle",
              "rounded_square"
            ]
          },
          "quiet_zone": {
            "type": "string",
            "description": "0 to 8"
          },
          "error_correction": {
            "type": "string",
            "enum": [
              "l",
              "m",
              "q",
              "h"
            ]
          },
          "background_color": {
            "type": "string"
          },
          "transparent_background": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "foreground_color": {
            "type": "string"
          },
          "canvas_color": {
            "type": "string"
          },
          "canvas_color_transparent": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "qr_corner_radius": {
            "type": "string",
            "description": "0 to 64"
          },
          "show_border": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "border_color": {
            "type": "string"
          },
          "border_width": {
            "type": "string",
            "description": "0 to 12"
          },
          "finder_pattern_style": {
            "type": "string",
            "enum": [
              "square",
              "circle",
              "rounded"
            ]
          },
          "finder_pattern_color": {
            "type": "string"
          },
          "dot_style": {
            "type": "string",
            "enum": [
              "classic",
              "circle",
              "square",
              "rounded_square",
              "rounded",
              "triangle",
              "diamond",
              "star",
              "hexagon",
              "cube"
            ]
          },
          "dot_size": {
            "type": "string",
            "description": "1 to 12"
          },
          "dot_corner_radius": {
            "type": "string",
            "description": "0 to 12"
          },
          "center_space_enabled": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "center_space_size": {
            "type": "string",
            "description": "4 to 14"
          },
          "show_center_text": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "center_text": {
            "type": "string",
            "maxLength": 30
          },
          "center_text_color": {
            "type": "string"
          },
          "center_text_font_size": {
            "type": "string",
            "description": "8 to 48"
          },
          "center_text_line_spacing": {
            "type": "string",
            "description": "0 to 60"
          },
          "center_text_rotation": {
            "type": "string",
            "description": "-180 to 180"
          },
          "show_logo": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "use_default_logo": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "logo_size": {
            "type": "string",
            "description": "4 to 14"
          },
          "show_footer": {
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "footer_text": {
            "type": "string",
            "maxLength": 60
          },
          "footer_color": {
            "type": "string"
          },
          "footer_font_size": {
            "type": "string",
            "description": "8 to 48"
          },
          "footer_position": {
            "type": "string"
          }
        }
      },
      "Organization": {
        "type": "object",
        "required": [
          "slug",
          "name",
          "role",
          "calendar_only",
          "calendar_login",
          "membership_summary",
          "admin_names",
          "settings",
          "kards_count",
          "custom_domain",
          "created_at",
          "launch_checklist"
        ],
        "properties": {
          "launch_checklist": {
            "description": "\"Set up your team: 2 of 5 done\", for the team's admins only, as the web shows it on the team's page and on Members: null for anyone else (a member, a site admin who isn't one of its admins), once all five are done, or once an admin hid it (`DELETE /organizations/{slug}/launch_checklist`: hidden for every admin).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/TeamLaunchChecklist"
              },
              {
                "type": "null"
              }
            ]
          },
          "our_team_offer": {
            "description": "\"Show your team on one page\" (the team's \"Our team\" page offered while it's off), for the team's admins only, as the web shows it on the team's page: null for anyone else (a member, a site admin who isn't one of its admins), once \"Our team\" is public (`settings.our_team_public`), once an admin hid it (`DELETE /organizations/{slug}/our_team_offer`: hidden for every admin), or while fewer than 2 of its kards would be listed (one person's list isn't a team's page yet). Its Turn on is `PATCH /organizations/{slug}` with `our_team_public_setting: true`. Left out by servers before 1.9.2.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/OurTeamOffer"
              },
              {
                "type": "null"
              }
            ]
          },
          "our_team_listed": {
            "description": "How many of the team's kards \"Our team\" lists now, of how many, as the team's Settings say it (\"9 of 10 team Kards listed.\"), for the team's admins only: null for anyone else (a member, a site admin who isn't one of its admins). The page public or not. Left out by servers before 1.9.5.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/OurTeamListed"
              },
              {
                "type": "null"
              }
            ]
          },
          "our_team_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The team's \"Our team\" page while it's public (`settings.our_team_public`), for everyone the organization answers: `https://ekard.app/<slug>/our-team`. Null while it's for the team's members only. A team kard's switch (`show_on_our_team`) says it as the web's does: listed, \"Listed on Glow Studio's Our team page, https://ekard.app/glowstudio/our-team, with your photo, name and job title, linking here.\"; else \"Listed for Glow Studio's members signed in…\". Left out by servers before 1.9.3.",
            "examples": [
              "https://ekard.app/glowstudio/our-team"
            ]
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "layout_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "description": "This account's role in it.",
            "enum": [
              "admin",
              "member",
              "none"
            ]
          },
          "calendar_only": {
            "type": "boolean",
            "description": "This account is a member whose only way in is a calendar login (front desk or staff): not on the team, holding none of its Kards, as the admins' members list says. Show `membership_summary`, not \"You're a member\"."
          },
          "calendar_login": {
            "description": "This account's login to its calendar, if any.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrganizationCalendarLogin"
              }
            ]
          },
          "membership_summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "This account's place in it, in the words of its own organization page; null for a site admin outside it.",
            "examples": [
              "You sign in to Glow Studio's calendar as front desk. You're not on Glow Studio's team, so you hold none of its Kards.",
              "You're a member of Glow Studio. You sign in to its calendar as stylist.",
              "You're an admin of Glow Studio."
            ]
          },
          "admin_names": {
            "type": "string",
            "description": "Who to ask for a Kard, a place on the team or a change only its admins make, as the web's pages name them after \"Ask\": up to two admins by name (else email), joined with \"or\"; the support address when it has no admin.",
            "examples": [
              "Rhea Kapoor",
              "Rhea Kapoor or Sam Lee"
            ]
          },
          "settings": {
            "type": "object",
            "properties": {
              "show_logo_on_kards": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "allow_dynamic_layouts": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "our_team_public": {
                "type": "boolean",
                "description": "Whether the team's \"Our team\" page is public: `https://ekard.app/<slug>/our-team` (and `/our-team` on its own domain), a list of its kards with each one's photo, name and job title, linked from its main kard as \"Meet the team\". Off for a new team. Its members see the list on the web's team page either way."
              }
            }
          },
          "kards_count": {
            "type": "integer"
          },
          "custom_domain": {
            "description": "Its own domain, or null (always null for an account that isn't its admin).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomDomain"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TeamLaunchChecklist": {
        "type": "object",
        "description": "A new team's first week: five steps, each ticked from what really happened, in this order: `logo` (the team's logo added), `own_kard` (the admin asking holds a team kard with more on it than the name and email a kard starts with: a job title, a phone or WhatsApp number, or a photo; each admin sees their own, so two admins can see different counts), `people` (someone else on the team who can hold its kards; since 1.9.13 an invitation or a request to join still waiting no longer ticks it), `out` (any of the team's kards printed or sent on its way: `POST /kards/{share_link}/shares`, its wallpaper, picture or printable card) and `contact` (the first contact someone sent through one of the team's kards, not one its people typed in, scanned or added through the API).",
        "required": [
          "done",
          "total",
          "next",
          "steps",
          "own_kard",
          "people",
          "printed",
          "sent",
          "first_contact_kard"
        ],
        "properties": {
          "done": {
            "type": "integer",
            "examples": [
              2
            ]
          },
          "total": {
            "type": "integer",
            "examples": [
              5
            ]
          },
          "next": {
            "type": "string",
            "enum": [
              "logo",
              "own_kard",
              "people",
              "out",
              "contact"
            ],
            "description": "The first step not done yet, the one to offer."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamLaunchChecklistStep"
            }
          },
          "own_kard": {
            "description": "The admin's own team kard: one they hold that's filled in, else the one with their email, else the first they took; null when they hold none (the web offers \"Make my Kard\" then).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name",
                  "filled_in"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "filled_in": {
                    "type": "boolean",
                    "description": "More than the name and email: false is \"Fill it in\"."
                  },
                  "has_email": {
                    "type": "boolean",
                    "description": "Whether it has an email. Not filled in, the web's line names what it has so far (`has_words`)."
                  },
                  "from_team": {
                    "type": "array",
                    "description": "What it carries from the team's own kard, unchanged since: a new team kard starts with the team's address, website and company (never its phone). Left out by servers before 1.9.11.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "address",
                        "website",
                        "company"
                      ]
                    }
                  },
                  "has_words": {
                    "type": "string",
                    "description": "What it has so far, as the web's line says it: \"Priya Sharma has a name and email, and Harbor Realty's address and website so far\" (\"a name\" without an email; the team's part only while it's the team's). English. Left out by servers before 1.9.11.",
                    "examples": [
                      "a name and email, and Harbor Realty's address and website"
                    ]
                  }
                }
              }
            ]
          },
          "kards_to_bring": {
            "type": "array",
            "description": "While the `own_kard` step isn't done, the asking admin's own kards they may bring into the team (`POST /organizations/{slug}/own_kard`), newest first; the web offers the first three as \"Bring in Marcus Bell\" (\"Bring your Kard into the team\", or after \"Fill it in\" when they hold one with only a name). Empty once the step is done. Left out by servers before 1.9.10.",
            "items": {
              "$ref": "#/components/schemas/KardToBring"
            }
          },
          "people": {
            "type": "object",
            "required": [
              "on_team",
              "invited",
              "invitations_expired",
              "places"
            ],
            "properties": {
              "on_team": {
                "type": "integer",
                "description": "Everyone who can hold the team's kards, the admin asking included (not calendar logins)."
              },
              "invited": {
                "type": "integer",
                "description": "Invitations still waiting for an answer."
              },
              "requests_waiting": {
                "type": "integer",
                "description": "Requests to join through the join link no admin has answered yet (`GET /organizations/{slug}/join_requests`). They tick the step too: with nobody on the team yet the web says \"2 people invited, 1 asked to join, nobody has joined yet\"."
              },
              "invitations_expired": {
                "type": "integer",
                "description": "Invitations that ran out before anyone answered: the web says \"An invitation ran out before anyone answered: send it again.\" (`POST /organizations/{slug}/invitations/{id}/resend`)."
              },
              "places": {
                "type": "integer",
                "description": "How many people the team holds free for now: 25, unless eKard gave it more (`places.limit` on members).",
                "examples": [
                  25
                ]
              }
            }
          },
          "printed": {
            "type": "boolean",
            "description": "The team's printable cards made (the team's PDF, or one kard's)."
          },
          "sent": {
            "type": "boolean",
            "description": "Any of the team's kards sent on its way some other way (a share, its wallpaper, a picture)."
          },
          "first_contact_kard": {
            "description": "The team kard the first contact came through (\"First contact on 14 Oct, through Priya Sharma\": the day is the step's `done_on`); null until then.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "OurTeamOffer": {
        "type": "object",
        "description": "The web's words, with these numbers: \"Show your team on one page\". \"A page of Glow Studio's people: each team Kard's photo, name and job title, linking to that Kard, with a search. 3 people would be on it now.\" \"Today only the team's members see the list, signed in. Turned on, anyone with the link can open it at https://ekard.app/glowstudio/our-team, and Glow Studio's main Kard links to it with “Meet the team”. Search engines are asked not to list it. Each person can take their own Kard off it, and it's free.\" Then Turn on and No thanks.",
        "required": [
          "listed_count",
          "url"
        ],
        "properties": {
          "listed_count": {
            "type": "integer",
            "description": "How many of the team's kards the page would list now: each active kard its holder or an admin hasn't taken off (`settings.show_on_our_team`) and that isn't hidden after a complaint; never the team's main kard. 2 or more.",
            "examples": [
              3
            ]
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Where the page would be public: `https://ekard.app/<slug>/our-team` (also `/our-team` on the team's own domain once it's live).",
            "examples": [
              "https://ekard.app/glowstudio/our-team"
            ]
          }
        }
      },
      "OurTeamListed": {
        "type": "object",
        "description": "The web's words, with these numbers: none (`team_kards_count` 0) \"No team Kards yet: each one you add is listed unless its holder or an admin takes it off.\"; all \"All 10 team Kards are listed.\" (\"All 1 team Kard is listed.\"); else \"9 of 10 team Kards listed. The other one is off it: taken off in its Settings, switched off (inactive) or hidden after a complaint.\" (\"The other 2 are off it: taken off in their Settings, …\"). Then: \"Each Kard's holder, and every admin, can take it off in that Kard's Settings.\"",
        "required": [
          "listed_count",
          "team_kards_count"
        ],
        "properties": {
          "listed_count": {
            "type": "integer",
            "description": "The team's kards on the list now: each active kard its holder or an admin hasn't taken off (`settings.show_on_our_team`) and that isn't hidden after a complaint, as `our_team_offer.listed_count` counts them. Never the main kard.",
            "examples": [
              9
            ]
          },
          "team_kards_count": {
            "type": "integer",
            "description": "Every team kard, listed or not, inactive ones included; not the organization's main kard (`/<slug>`), which `kards_count` counts too.",
            "examples": [
              10
            ]
          }
        }
      },
      "TeamLaunchChecklistStep": {
        "type": "object",
        "required": [
          "key",
          "done",
          "done_on"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "logo",
              "own_kard",
              "people",
              "out",
              "contact"
            ]
          },
          "done": {
            "type": "boolean"
          },
          "done_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The day it happened, in the account's time zone, where that's known: the first contact's. Null for the other steps, and for a step not done."
          }
        }
      },
      "OrganizationInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "layout_type": {
            "type": "string",
            "enum": [
              "default",
              "links",
              "restaurant",
              "letterhead",
              "jharokha",
              "mohur",
              "yantra"
            ]
          },
          "show_logo_on_kards_setting": {
            "type": "boolean"
          },
          "allow_dynamic_layouts_setting": {
            "type": "boolean"
          },
          "our_team_public_setting": {
            "type": "boolean",
            "description": "Publishes the team's \"Our team\" page (`settings.our_team_public`), or takes it down."
          }
        }
      },
      "OrganizationEnvelope": {
        "type": "object",
        "required": [
          "organization"
        ],
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        }
      },
      "OrganizationStartInput": {
        "type": "object",
        "required": [
          "name",
          "slug"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "slug": {
            "type": "string",
            "description": "Its address. Letters, numbers and underscores, 3 to 50.",
            "examples": [
              "glow_studio"
            ]
          },
          "kard_name": {
            "type": "string",
            "description": "Optional: the name on a team kard of the account's own in it (4 to 100 characters). Left out, none is made."
          },
          "kard": {
            "type": "string",
            "description": "Optional: the share link of one of the account's own personal kards (naming a person, no domain of its own) to bring into the team instead of a new one. Wins over kard_name.",
            "examples": [
              "priya"
            ]
          }
        }
      },
      "KardToBring": {
        "type": "object",
        "description": "One of the account's own kards it may bring into a team, as the one it starts (`POST /organizations`' `kard`) or one it runs (`POST /organizations/{slug}/own_kard`): personal, naming a person rather than a business, with no domain of its own. The web offers each as \"Bring in Marcus Bell\" (with \"/x7kp2\" beside each when there are several).",
        "required": [
          "share_link",
          "name"
        ],
        "properties": {
          "share_link": {
            "type": "string",
            "examples": [
              "x7kp2"
            ]
          },
          "team_link": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only in a team's checklist (`launch_checklist.kards_to_bring`): the address the kard would take in that team, brought in now, as the web writes a team's addresses: the domain, the team's address and its link (`<domain>/bellrealty/marcus`, a link from its name, else its own), for \"Bring in Marcus Bell\" to say where it goes; null when neither is free there and it would get a random one. Not in `GET /me`, whose team isn't started yet. Left out by servers before 1.9.13."
          },
          "name": {
            "type": "string",
            "examples": [
              "Marcus Bell"
            ]
          }
        }
      },
      "OwnKardBrought": {
        "type": "object",
        "required": [
          "kard",
          "organization",
          "message"
        ],
        "properties": {
          "kard": {
            "$ref": "#/components/schemas/KardSummary"
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "message": {
            "type": "string",
            "description": "The web's words after Bring in, as written.",
            "examples": [
              "Marcus Bell is in Bell Realty now, at example.com/bell_realty/marcus, with everything on it. Its old link and every QR code printed with it lead there.",
              "Marcus Bell is in Bell Realty now, at example.com/bell_realty/marcus_bell, with everything on it. Its old link and every QR code printed with it lead there. Your other Kard here, Marcus Bell (bell_realty/marcus), has only a name and email: delete it from its Settings if you don't need it."
            ]
          }
        }
      },
      "OrganizationStarted": {
        "type": "object",
        "required": [
          "organization",
          "kard",
          "message"
        ],
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "kard": {
            "description": "The account's own team kard, made (`kard_name`) or brought in (`kard`); else null.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/KardSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "type": "string",
            "description": "What was made and what to do next: the team's address, that the account is its admin, its own kard if made."
          }
        }
      },
      "OrganizationAddressCheck": {
        "type": "object",
        "required": [
          "slug",
          "available",
          "message"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "The address checked, in lower case."
          },
          "available": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "description": "What to show under the field: that the address is free, or why not.",
            "examples": [
              "Address has already been taken",
              "Address is reserved for the site's own pages. Choose another."
            ]
          }
        }
      },
      "CustomDomain": {
        "type": "object",
        "description": "A personal kard's or an organization's own domain. `title` and `message` say where it stands, why it matters and what to do next, in the words the web's settings panel uses: relay them as they are.",
        "required": [
          "hostname",
          "status",
          "live",
          "url",
          "title",
          "message",
          "detail",
          "dns_zone",
          "dns_records",
          "checked_at",
          "live_at",
          "release_at",
          "created_at"
        ],
        "properties": {
          "hostname": {
            "type": "string",
            "examples": [
              "card.priya.com"
            ]
          },
          "status": {
            "type": "string",
            "description": "registering (being set up, a few seconds), setup_failed (the certificate service didn't answer; tried again by itself), waiting_for_dns (no record yet: nothing opens at the domain until its own record proves it's the owner's), points_elsewhere (a record points somewhere else), proxied (the record hides behind Cloudflare's proxy: set it to DNS only), needs_txt (a bare domain answers, but its TXT record, the proof, isn't there yet), confirming (proven; the certificate service is confirming it), securing (the certificate is being issued), certificate_blocked (a CAA record forbids it: add the CAA records), certificate_failed (`detail` says why), blocked (the certificate service refuses the name), stopped (it was live and its record no longer points here), live.",
            "enum": [
              "registering",
              "setup_failed",
              "waiting_for_dns",
              "points_elsewhere",
              "proxied",
              "needs_txt",
              "confirming",
              "securing",
              "certificate_blocked",
              "certificate_failed",
              "blocked",
              "stopped",
              "live"
            ]
          },
          "live": {
            "type": "boolean",
            "description": "Visitors get the kard at `url` over HTTPS, and links, share buttons and the card itself print it (public_url). Until then they use the eKard address."
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string",
            "examples": [
              "Waiting for your DNS record"
            ]
          },
          "message": {
            "type": "string"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "The certificate service's own words, when they say more than `message`."
          },
          "dns_zone": {
            "type": "string",
            "description": "The domain whose DNS takes the records: priya.co.uk for card.priya.co.uk."
          },
          "dns_records": {
            "type": "array",
            "description": "What's still missing at the DNS provider for where the domain is now; empty when nothing is.",
            "items": {
              "$ref": "#/components/schemas/DnsRecord"
            }
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "live_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it last went live."
          },
          "release_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it's let go, if nothing changes: a week after it was registered, for a domain whose record never proved it (a name nobody finishes setting up doesn't stay reserved); two weeks after a domain stopped working. Null otherwise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DnsRecord": {
        "type": "object",
        "required": [
          "type",
          "name",
          "value"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "CNAME",
              "TXT",
              "CAA"
            ],
            "description": "For a bare domain, providers call the CNAME an ALIAS or ANAME, or flatten it."
          },
          "name": {
            "type": "string",
            "description": "As DNS providers ask for it: the part before dns_zone (card), or @ for the bare domain."
          },
          "value": {
            "type": "string",
            "description": "The CNAME's target, the TXT's token, or a CAA record's value."
          }
        }
      },
      "CustomDomainEnvelope": {
        "type": "object",
        "required": [
          "custom_domain"
        ],
        "properties": {
          "custom_domain": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomDomain"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CustomDomainChecking": {
        "type": "object",
        "required": [
          "custom_domain",
          "message"
        ],
        "properties": {
          "custom_domain": {
            "$ref": "#/components/schemas/CustomDomain"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CustomDomainInput": {
        "type": "object",
        "required": [
          "hostname"
        ],
        "properties": {
          "hostname": {
            "type": "string",
            "maxLength": 253,
            "description": "The domain as people type it (a scheme, a path or a port is dropped). A subdomain such as card.yourname.com works with every DNS provider; a bare yourname.com only where the provider can flatten a CNAME (ALIAS, ANAME).",
            "examples": [
              "card.priya.com"
            ]
          }
        }
      },
      "CustomDomainRemoved": {
        "type": "object",
        "required": [
          "deleted",
          "hostname",
          "message"
        ],
        "properties": {
          "deleted": {
            "const": true
          },
          "hostname": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "OrganizationTeam": {
        "type": "object",
        "required": [
          "members",
          "invitations",
          "kards",
          "summary",
          "places"
        ],
        "properties": {
          "places": {
            "type": "object",
            "description": "The team's places: free for up to `limit` people for now, 25 unless eKard gave the team more. Each person on the team (not a calendar login) and each open invitation takes one; with none `left`, an invitation is `422 team_full` (a site admin's isn't).",
            "required": [
              "limit",
              "taken",
              "left"
            ],
            "properties": {
              "limit": {
                "type": "integer",
                "examples": [
                  25
                ]
              },
              "taken": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationMember"
            }
          },
          "invitations": {
            "type": "array",
            "description": "The open ones, newest first.",
            "items": {
              "$ref": "#/components/schemas/OrganizationInvitation"
            }
          },
          "kards": {
            "type": "array",
            "description": "Every team Kard but the organization's main one.",
            "items": {
              "$ref": "#/components/schemas/TeamKard"
            }
          },
          "summary": {
            "type": "string",
            "description": "The page's count line. Someone whose only way in is a calendar login counts as a calendar login, not a member.",
            "examples": [
              "4 people in Glow Studio: 2 admins and 2 members. 1 invitation is waiting to be accepted.",
              "3 people in Glow Studio: 1 admin and 2 calendar logins."
            ]
          }
        }
      },
      "OrganizationCalendarLogin": {
        "type": "object",
        "required": [
          "role",
          "role_name"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "front_desk",
              "staff"
            ]
          },
          "role_name": {
            "type": "string",
            "description": "The role as the web words it: \"front desk\", or the calendar's word for its staff (\"stylist\")."
          }
        }
      },
      "OrganizationMember": {
        "type": "object",
        "required": [
          "id",
          "user",
          "role",
          "you",
          "calendar_only",
          "can_hold_kards",
          "calendar_login",
          "kards",
          "joined_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "The membership's id, for PATCH and DELETE /organizations/{slug}/members/{id}."
          },
          "user": {
            "type": "object",
            "required": [
              "name",
              "email"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ]
          },
          "you": {
            "type": "boolean",
            "description": "This is the key's own account."
          },
          "calendar_only": {
            "type": "boolean",
            "description": "Their only way in is a calendar login: not on the team (the web's \"Calendar only\"). Inviting them to the team changes that."
          },
          "can_hold_kards": {
            "type": "boolean",
            "description": "False for someone whose only way in is a calendar login; inviting them to the team changes that."
          },
          "calendar_login": {
            "description": "Their login to the organization's calendar, if any.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrganizationCalendarLogin"
              }
            ]
          },
          "kards": {
            "type": "array",
            "description": "The team Kards they hold.",
            "items": {
              "type": "object",
              "required": [
                "share_link",
                "name",
                "public_url"
              ],
              "properties": {
                "share_link": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "public_url": {
                  "type": "string"
                }
              }
            }
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrganizationMemberChanged": {
        "type": "object",
        "required": [
          "member",
          "message"
        ],
        "properties": {
          "member": {
            "$ref": "#/components/schemas/OrganizationMember"
          },
          "message": {
            "type": "string",
            "examples": [
              "Priya Sharma is now an admin of Glow Studio: they manage every Kard, the members and the settings."
            ]
          }
        }
      },
      "OrganizationMemberRemoved": {
        "type": "object",
        "required": [
          "deleted",
          "kards",
          "message"
        ],
        "properties": {
          "deleted": {
            "const": true
          },
          "kards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TeamKard"
            }
          },
          "message": {
            "type": "string",
            "examples": [
              "Priya Sharma is no longer in Glow Studio. Their Kard (Priya Sharma) stays in Glow Studio, with its admins."
            ]
          }
        }
      },
      "TeamKard": {
        "type": "object",
        "required": [
          "share_link",
          "name",
          "public_url",
          "holder"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "public_url": {
            "type": "string"
          },
          "holder": {
            "description": "Who holds it (they can edit it); null when its admins keep it.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "member_id",
                  "name"
                ],
                "properties": {
                  "member_id": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Their member id; null for someone outside the organization (a site admin)."
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "TeamKardHolderChanged": {
        "type": "object",
        "required": [
          "kard",
          "changed",
          "message"
        ],
        "properties": {
          "kard": {
            "$ref": "#/components/schemas/TeamKard"
          },
          "changed": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "examples": [
              "Priya Sharma is now held by Priya Sharma, who can edit it. Its link, QR code and contacts haven't changed."
            ]
          }
        }
      },
      "OrganizationInvitation": {
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "status",
          "expires_at",
          "last_sent_at",
          "reminded_at",
          "reminder_due_at",
          "invited_by",
          "accept_url",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "member",
              "admin"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminded_at": {
            "description": "When its one reminder email went (still unanswered 3 days after the last send); null until then.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminder_due_at": {
            "description": "When its one reminder goes if they haven't joined by then; null once it has gone, for one used or cancelled, when the link stops working first, or for an address Apple stopped forwarding to (not emailed).",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "invited_by": {
            "description": "Who sent it, or null once their account is gone. `id` is their account (`GET /me`'s `account.id`: yours when you sent it); `member_id` their member id here (`members[].id`), null for someone outside the organization (a site admin). An admin's open invitations are cancelled when they're made a member or removed.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "member_id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "member_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "kard": {
            "description": "The team Kard it carries, handed to them when they join; null when none.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "accept_url": {
            "description": "The link the invitation email carries, to send another way (the web's \"Copy the invitation link\", for an address Apple won't forward to). It works only for the invited account. Only in the answer to sending it (invite, resend), while it's pending; null everywhere else (a list never hands out links).",
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrganizationInvitationNow": {
        "type": "object",
        "required": [
          "invitation",
          "message"
        ],
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/OrganizationInvitation"
          },
          "sent": {
            "type": "boolean",
            "description": "Resend only: false when nothing went out (within a minute of the last send)."
          },
          "message": {
            "type": "string",
            "examples": [
              "Invitation sent to priya@example.com as a member. The link works until Wed 23 Jan."
            ]
          }
        }
      },
      "OrganizationInvitationForInviteeEnvelope": {
        "type": "object",
        "required": [
          "invitation"
        ],
        "properties": {
          "invitation": {
            "type": "object",
            "description": "An invitation to an organization's team, as the invitee sees it.",
            "required": [
              "organization",
              "role",
              "abilities",
              "invited_by",
              "invited_email_masked",
              "status",
              "expires_at",
              "matches_signed_in_account",
              "refusal"
            ],
            "properties": {
              "organization": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  }
                }
              },
              "role": {
                "type": "string",
                "enum": [
                  "member",
                  "admin"
                ]
              },
              "abilities": {
                "type": "array",
                "description": "What the role can do, in words addressed to the invitee.",
                "items": {
                  "type": "string"
                }
              },
              "invited_by": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/NameOnly"
                  }
                ]
              },
              "kard": {
                "description": "The team Kard that comes with it, theirs to edit once they join; null when none.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/NameOnly"
                  }
                ]
              },
              "invited_email_masked": {
                "type": "string",
                "examples": [
                  "p•••••@example.com"
                ]
              },
              "status": {
                "$ref": "#/components/schemas/InvitationStatus"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "matches_signed_in_account": {
                "type": "boolean",
                "description": "The key's account has the invited email."
              },
              "refusal": {
                "description": "What stops the key's account (or, without a key, anyone) from joining now; null when it can.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "required": [
                      "code",
                      "message"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "sign_in_required",
                          "email_mismatch",
                          "email_unverified",
                          "expired",
                          "revoked",
                          "used",
                          "membership_ended"
                        ]
                      },
                      "message": {
                        "type": "string",
                        "description": "The web page's words for it, to show as they are."
                      },
                      "verify_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Only with `email_unverified`: POST it with the same session to email the link that verifies the address (`POST /me/email_verification`)."
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "OrganizationJoinLink": {
        "type": "object",
        "required": [
          "url",
          "token",
          "status",
          "expires_at",
          "requests_made",
          "requests_limit",
          "created_by",
          "created_at",
          "share_text"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "What to share (/teams/join/{token})."
          },
          "token": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "expired",
              "used_up"
            ],
            "description": "`expired` past its 14 days, `used_up` once it took `requests_limit` requests; either way a new link (POST) takes more."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "requests_made": {
            "type": "integer"
          },
          "requests_limit": {
            "type": "integer",
            "examples": [
              50
            ]
          },
          "created_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NameOnly"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "share_text": {
            "type": "string",
            "description": "The words the web's Share button sends with the link."
          }
        }
      },
      "OrganizationJoinLinkEnvelope": {
        "type": "object",
        "required": [
          "join_link"
        ],
        "properties": {
          "join_link": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrganizationJoinLink"
              }
            ]
          }
        }
      },
      "OrganizationJoinLinkNow": {
        "type": "object",
        "required": [
          "join_link",
          "message"
        ],
        "properties": {
          "join_link": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OrganizationJoinLink"
              }
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "Join link on: it works until Mon 2 Nov. Copy it or share it in your team's group. Each person who asks waits for an admin to approve them."
            ]
          }
        }
      },
      "OrganizationJoinRequest": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "created_at",
          "decided_at",
          "kard",
          "email",
          "decided_by",
          "needs_a_place"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "description": "The name they gave, for their team Kard."
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "approved",
              "declined"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kard": {
            "description": "The team Kard approving gave them (or the one they held already); null until approved.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "email": {
            "type": "string",
            "description": "The address of the account that asked (verified)."
          },
          "decided_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NameOnly"
              }
            ]
          },
          "needs_a_place": {
            "type": "boolean",
            "description": "Approving it now would need a place the team doesn't have (`422 team_full`)."
          }
        }
      },
      "OrganizationJoinRequestList": {
        "type": "object",
        "required": [
          "join_requests",
          "places",
          "full_message"
        ],
        "properties": {
          "join_requests": {
            "type": "array",
            "description": "The waiting ones, oldest first.",
            "items": {
              "$ref": "#/components/schemas/OrganizationJoinRequest"
            }
          },
          "places": {
            "type": "object",
            "required": [
              "limit",
              "taken",
              "left"
            ],
            "properties": {
              "limit": {
                "type": "integer"
              },
              "taken": {
                "type": "integer"
              },
              "left": {
                "type": "integer"
              }
            }
          },
          "full_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "While no place is free, what to do (the Members page's notice); null otherwise."
          }
        }
      },
      "OrganizationJoinRequestApproved": {
        "type": "object",
        "required": [
          "join_request",
          "member",
          "message"
        ],
        "properties": {
          "join_request": {
            "$ref": "#/components/schemas/OrganizationJoinRequest"
          },
          "member": {
            "$ref": "#/components/schemas/OrganizationMember"
          },
          "message": {
            "type": "string",
            "examples": [
              "Priya Sharma joined Glow Studio as a member with the Kard Priya Sharma to fill in. We've emailed priya@example.com."
            ]
          }
        }
      },
      "OrganizationJoinRequestDeclined": {
        "type": "object",
        "required": [
          "join_request",
          "message"
        ],
        "properties": {
          "join_request": {
            "$ref": "#/components/schemas/OrganizationJoinRequest"
          },
          "message": {
            "type": "string",
            "examples": [
              "You declined Priya Sharma's request. We've emailed priya@example.com; the join link can't bring them in again."
            ]
          }
        }
      },
      "JoinRequestForAsker": {
        "type": "object",
        "description": "A request to join, as the person who made it sees it.",
        "required": [
          "id",
          "name",
          "status",
          "created_at",
          "decided_at",
          "kard"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "approved",
              "declined"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kard": {
            "description": "Their team Kard once approved (to fill in); null until then.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "JoinLinkForAskerEnvelope": {
        "type": "object",
        "required": [
          "join_link"
        ],
        "properties": {
          "join_link": {
            "type": "object",
            "description": "A team's join link, as someone who opened it sees it.",
            "required": [
              "organization",
              "status",
              "expires_at",
              "abilities",
              "join_request",
              "refusal",
              "suggested_name"
            ],
            "properties": {
              "organization": {
                "type": "object",
                "required": [
                  "name",
                  "slug"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  }
                }
              },
              "status": {
                "type": "string",
                "enum": [
                  "open",
                  "expired",
                  "used_up"
                ]
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "abilities": {
                "type": "array",
                "description": "What a member can do, once approved, in words addressed to them.",
                "items": {
                  "type": "string"
                }
              },
              "join_request": {
                "description": "The key's account's own request to this team, whatever became of it; null without a key or a request.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/JoinRequestForAsker"
                  }
                ]
              },
              "refusal": {
                "description": "What stops the key's account (or, without a key, anyone) from asking now; null when it can.",
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "required": [
                      "code",
                      "message"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "sign_in_required",
                          "on_the_team",
                          "waiting",
                          "declined",
                          "membership_ended",
                          "expired",
                          "used_up",
                          "email_unverified",
                          "invited",
                          "too_many_waiting",
                          "daily_limit"
                        ]
                      },
                      "message": {
                        "type": "string",
                        "description": "The web page's words for it, to show as they are."
                      },
                      "verify_url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Only with `email_unverified`: POST it with the same session to email the link that verifies the address (`POST /me/email_verification`)."
                      }
                    }
                  }
                ]
              },
              "suggested_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The name the web suggests for their Kard (the account's); null without a key."
              }
            }
          }
        }
      },
      "JoinRequestMade": {
        "type": "object",
        "required": [
          "join_request",
          "message"
        ],
        "properties": {
          "join_request": {
            "$ref": "#/components/schemas/JoinRequestForAsker"
          },
          "message": {
            "type": "string",
            "examples": [
              "Request sent. Glow Studio's admins will approve or decline it; we'll email priya@example.com either way."
            ]
          }
        }
      },
      "OrganizationInvitationAccepted": {
        "type": "object",
        "required": [
          "organization",
          "kard",
          "message"
        ],
        "properties": {
          "organization": {
            "type": "object",
            "required": [
              "slug",
              "name",
              "role"
            ],
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string",
                "enum": [
                  "member",
                  "admin"
                ]
              }
            }
          },
          "kard": {
            "description": "The team Kard the invitation carried, now theirs; null when it carried none, or it went to someone else meanwhile (the message says so).",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "You've joined Glow Studio. Priya Sharma, the Kard that came with your invitation, is yours to edit now."
            ]
          }
        }
      },
      "Hook": {
        "type": "object",
        "description": "A REST hook (POST /hooks).",
        "required": [
          "id",
          "event",
          "kard",
          "organization",
          "target_url",
          "enabled",
          "paused_reason",
          "last_delivered_at",
          "last_error",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "event": {
            "type": "string",
            "enum": [
              "contact.created"
            ]
          },
          "kard": {
            "type": [
              "string",
              "null"
            ],
            "description": "The kard's share link; null for every kard whose contacts the account sees."
          },
          "organization": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team's slug (a team kard's, or the team whose kards it hears); null otherwise."
          },
          "target_url": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean",
            "description": "False once paused after 10 contacts in a row failed every try; subscribing again starts afresh."
          },
          "paused_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Bookmark": {
        "type": "object",
        "required": [
          "id",
          "kard",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kard": {
            "$ref": "#/components/schemas/KardSummary"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SchedulingCalendar": {
        "type": "object",
        "required": [
          "id",
          "name",
          "preset",
          "time_zone",
          "currency"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "preset": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "time_zone": {
            "type": "string",
            "description": "An IANA zone, such as Asia/Kolkata."
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217."
          }
        }
      },
      "KardBooking": {
        "type": "object",
        "required": [
          "share_link",
          "accepts_bookings"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "accepts_bookings": {
            "type": "boolean",
            "description": "Whether the kard shows a Book button now."
          },
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "book_label": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Book appointment",
              "Book with Priya"
            ]
          },
          "provider": {
            "description": "The person a team kard books.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Offering": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "duration_minutes",
          "duration_options",
          "price_mode",
          "visibility",
          "requires_approval",
          "providers"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "integer"
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minor units of the calendar's currency."
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "from",
              "free",
              "hidden"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "The price in words, such as \"₹800\", \"From ₹3,000\" or \"Free\"."
          },
          "location_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "at_business",
              "at_client",
              "phone",
              "video",
              "custom",
              null
            ]
          },
          "visibility": {
            "type": "string",
            "description": "`unlisted`: link only; `internal`: front desk only.",
            "enum": [
              "public",
              "unlisted",
              "internal"
            ]
          },
          "requires_approval": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "A request the business approves, rather than an instant booking."
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "bookable_online"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "bookable_online": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "A deep link visitors can book, when the kard takes bookings."
          }
        }
      },
      "Slot": {
        "type": "object",
        "required": [
          "starts_at",
          "ends_at",
          "local_starts_at",
          "provider_ids"
        ],
        "properties": {
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "The start in the calendar's zone."
          },
          "provider_ids": {
            "type": "array",
            "description": "Who is free for the whole visit, in assignment order.",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "Booking": {
        "type": "object",
        "required": [
          "id",
          "status",
          "source",
          "title",
          "starts_at",
          "ends_at",
          "local_starts_at",
          "time_zone",
          "duration_minutes",
          "currency",
          "client",
          "items",
          "answers",
          "guest_emails",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "booked",
              "arrived",
              "completed",
              "cancelled",
              "no_show",
              "declined"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "online",
              "front_desk",
              "walk_in",
              "api"
            ]
          },
          "title": {
            "type": "string",
            "examples": [
              "Haircut + Blow-dry"
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "time_zone": {
            "type": "string"
          },
          "duration_minutes": {
            "type": "integer"
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"₹1,300\", \"From ₹4,000\" (a service in it has a starting price: `price_mode` `from`; before field fixes 2h, the amount alone), \"Free\", or null when no price was set. Always English with English digit grouping, in the API and in webhooks alike, whatever language the client booked in (since 1.9.11, a webhook from a German booking page no longer says \"From ₹4.000\")."
          },
          "price_from": {
            "type": "boolean",
            "description": "A service in it has a starting price (an item's `offering.price_mode` is `from`), so `price` says \"From ₹4,000\": word it as \"Booked from ₹4,000\" by this, never by the English word in `price`. Each item's own mode is its `offering.price_mode`. Read as the services are priced now, as the web's booking says it. Left out by servers before 1.9.12: there, read the leading \"From \" of `price`."
          },
          "client": {
            "type": "object",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "client_time_zone": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_zone_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's zone as the web names it: the country when the zone is its country's only one, else the city (\"India\", \"London\", \"New York\"), for \"10:00 AM in London\". Null when `client_time_zone` is.",
            "examples": [
              "London"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingItem"
            }
          },
          "kard": {
            "$ref": "#/components/schemas/BookingKard"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "answers": {
            "type": "object",
            "description": "Answers to the offering's questions, by question key."
          },
          "guest_emails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "client",
              "business",
              null
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "calendar": {
            "$ref": "#/components/schemas/SchedulingCalendar"
          }
        }
      },
      "BookingItem": {
        "type": "object",
        "required": [
          "offering",
          "provider",
          "starts_at",
          "ends_at",
          "duration_minutes"
        ],
        "properties": {
          "offering": {
            "type": "object",
            "required": [
              "id",
              "name",
              "slug"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "price_mode": {
                "type": "string",
                "enum": [
                  "fixed",
                  "from",
                  "free",
                  "hidden"
                ],
                "description": "How the service's price is said, as its menu says it now (`Offering.price_mode`): `fixed` (\"₹1,300\"), `from` (a starting price: \"From ₹4,000\"), `free`, `hidden` (no price shown to clients). Since 1.9.12; left out by servers before it."
              }
            }
          },
          "provider": {
            "$ref": "#/components/schemas/NamedPerson"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "duration_minutes": {
            "type": "integer"
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "BookingEnvelope": {
        "type": "object",
        "required": [
          "booking"
        ],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/Booking"
          }
        }
      },
      "BookingPage": {
        "type": "object",
        "required": [
          "bookings",
          "pagination"
        ],
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "BookingInput": {
        "type": "object",
        "required": [
          "offering_ids",
          "starts_at"
        ],
        "properties": {
          "offering_ids": {
            "type": "array",
            "description": "One or more offerings, back to back with one person.",
            "items": {
              "type": "integer"
            }
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "client": {
            "type": "object",
            "description": "A new or matched client; front-desk bookings need only a name.",
            "properties": {
              "name": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            }
          },
          "client_id": {
            "type": "integer",
            "description": "An existing client, instead of `client`."
          },
          "provider_id": {
            "type": "integer",
            "description": "Who with; anyone free (or the kard's linked person) when omitted."
          },
          "duration": {
            "type": "integer",
            "description": "One of the offering's duration options, in minutes."
          },
          "notes": {
            "type": "string"
          },
          "answers": {
            "type": "object"
          },
          "guest_emails": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string",
              "format": "email"
            }
          },
          "channel": {
            "type": "string",
            "enum": [
              "phone",
              "whatsapp",
              "instagram",
              "in_person",
              "other"
            ]
          },
          "client_address": {
            "type": "string",
            "maxLength": 500,
            "description": "Where to go, for a service done at the client's address."
          },
          "overlap_allowed": {
            "type": "boolean",
            "description": "Book anyway over existing time; needs provider_id."
          },
          "idempotency_key": {
            "type": "string",
            "description": "A retry with the same key returns the first booking."
          }
        }
      },
      "BookingUpdate": {
        "type": "object",
        "properties": {
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider_id": {
            "type": "integer"
          },
          "overlap_allowed": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "arrived",
              "completed",
              "no_show",
              "booked",
              "declined",
              "cancelled"
            ]
          },
          "reason": {
            "type": "string",
            "description": "For declined and cancelled."
          }
        }
      },
      "BookingWebhookEvent": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "booking.created",
              "booking.rescheduled",
              "booking.cancelled",
              "booking.status_changed"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "test": {
            "type": "boolean",
            "description": "True for the web's \"Send test\", with made-up client details."
          },
          "data": {
            "type": "object",
            "required": [
              "booking",
              "calendar"
            ],
            "properties": {
              "booking": {
                "$ref": "#/components/schemas/Booking"
              },
              "calendar": {
                "$ref": "#/components/schemas/SchedulingCalendar"
              },
              "source": {
                "type": "string",
                "description": "booking.created",
                "enum": [
                  "online",
                  "front_desk",
                  "walk_in",
                  "api"
                ]
              },
              "previous_starts_at": {
                "type": "string",
                "format": "date-time",
                "description": "booking.rescheduled"
              },
              "by": {
                "type": "string",
                "description": "booking.rescheduled and booking.cancelled",
                "enum": [
                  "client",
                  "business"
                ]
              },
              "from": {
                "type": "string",
                "description": "booking.status_changed"
              },
              "to": {
                "type": "string",
                "description": "booking.status_changed"
              },
              "reason": {
                "type": "string",
                "description": "\"expired\" when an unanswered request lapsed."
              }
            }
          }
        }
      },
      "ContactWebhookEvent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The webhook-id header: `msg_contact_created_{contact id}`, or `msg_test_...` for a test."
          },
          "type": {
            "type": "string",
            "enum": [
              "contact.created"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "test": {
            "type": "boolean",
            "description": "True for the web's \"Send test\", with made-up details. Real events don't carry it."
          },
          "data": {
            "type": "object",
            "required": [
              "contact",
              "kard",
              "source_label",
              "found_via_label",
              "answers"
            ],
            "properties": {
              "contact": {
                "$ref": "#/components/schemas/Contact"
              },
              "answers": {
                "type": "array",
                "description": "Their answers to the kard's own questions (`contact.custom_fields`, by key), each with the question and the answer in the owner's words (a choice's words), in the exchange sheet's order, then any other answer kept: one spreadsheet column per question. Empty when they answered none.",
                "items": {
                  "type": "object",
                  "required": [
                    "key",
                    "question",
                    "answer"
                  ],
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "question": {
                      "type": "string"
                    },
                    "answer": {
                      "type": "string"
                    }
                  }
                }
              },
              "kard": {
                "type": "object",
                "required": [
                  "share_link",
                  "organization",
                  "name",
                  "public_url"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "organization": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A team kard's organization slug."
                  },
                  "name": {
                    "type": "string"
                  },
                  "public_url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              },
              "source_label": {
                "type": "string",
                "description": "`contact.source` in words, for a spreadsheet column.",
                "enum": [
                  "Sent their details from your Kard",
                  "Shared their own Kard back",
                  "Booked a time from your Kard",
                  "Suggested a time from your Kard",
                  "Typed in by hand",
                  "Read off their paper card",
                  "Added through the API",
                  "Added by an app or AI agent"
                ]
              },
              "found_via_label": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "`contact.found_via` in words, for a spreadsheet column, as the web's Contacts filter and CSV say it. `null` where `found_via` is.",
                "enum": [
                  "QR code",
                  "NFC tag",
                  "Email signature",
                  "WhatsApp or another chat",
                  "An email",
                  "Google or another search engine",
                  "Social media",
                  "Links on eKard",
                  "Another website",
                  "Opened your link directly",
                  "Not known",
                  null
                ]
              }
            }
          }
        }
      },
      "BookingKard": {
        "description": "The kard it was booked from, if any.",
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "object",
            "required": [
              "share_link",
              "public_url"
            ],
            "properties": {
              "share_link": {
                "type": "string"
              },
              "organization": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "public_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        ]
      },
      "CalendarPreset": {
        "type": "string",
        "description": "The kind of business, which sets the words its pages use.",
        "enum": [
          "consulting",
          "salon",
          "spa",
          "clinic",
          "tattoo",
          "home_services",
          "tutoring",
          "fitness",
          "real_estate",
          "other"
        ]
      },
      "CalendarRole": {
        "type": "string",
        "description": "`admin`: everything. `front_desk`: every booking (book, move, cancel, statuses, requests), walk-ins, clients, marking visits paid and advances received; not takings or insights, the menu, settings or the team. `staff`: the schedule and every booking (read); statuses and the team note on their own visits, and their clients' details there only.",
        "enum": [
          "admin",
          "front_desk",
          "staff"
        ]
      },
      "CalendarLabels": {
        "type": "object",
        "description": "The words this kind of business uses (a salon's \"Service\", \"Client\" and \"Appointment\"; a consultant's \"Meeting type\", \"Invitee\" and \"Meeting\"). Use them when you talk to the owner.",
        "required": [
          "offering",
          "offerings",
          "provider",
          "providers",
          "client",
          "clients",
          "booking",
          "bookings",
          "public_provider",
          "public_providers",
          "buffer_before",
          "buffer_after"
        ],
        "properties": {
          "offering": {
            "type": "string",
            "examples": [
              "Service"
            ]
          },
          "offerings": {
            "type": "string",
            "examples": [
              "Services"
            ]
          },
          "provider": {
            "type": "string",
            "examples": [
              "Team member"
            ]
          },
          "providers": {
            "type": "string",
            "examples": [
              "Team members"
            ]
          },
          "client": {
            "type": "string",
            "examples": [
              "Client"
            ]
          },
          "clients": {
            "type": "string",
            "examples": [
              "Clients"
            ]
          },
          "booking": {
            "type": "string",
            "examples": [
              "Appointment"
            ]
          },
          "bookings": {
            "type": "string",
            "examples": [
              "Appointments"
            ]
          },
          "public_provider": {
            "type": "string",
            "description": "What clients call a provider.",
            "examples": [
              "stylist"
            ]
          },
          "public_providers": {
            "type": "string",
            "examples": [
              "stylists"
            ]
          },
          "buffer_before": {
            "type": "string",
            "description": "What the time a provider is busy before a visit is called (an offering's `buffer_before_minutes`).",
            "examples": [
              "Prep"
            ]
          },
          "buffer_after": {
            "type": "string",
            "description": "What the time a provider is busy after a visit is called (an offering's `buffer_after_minutes`): \"Cleanup\", or \"Travel\" for home services. New booking's summary: \"11:00–12:00 · 1 h + 10 min cleanup\".",
            "examples": [
              "Cleanup",
              "Travel"
            ]
          }
        }
      },
      "CalendarSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "role",
          "role_summary",
          "owner",
          "preset",
          "labels",
          "time_zone",
          "currency",
          "country",
          "today",
          "live",
          "your_provider",
          "web_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/CalendarRole"
          },
          "role_summary": {
            "type": "string",
            "description": "What the role can do here, in words.",
            "examples": [
              "Everything: appointments, clients, money, services, settings and the team."
            ]
          },
          "owner": {
            "description": "A person's own calendar, or an organization's.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "type",
                  "name"
                ],
                "properties": {
                  "type": {
                    "const": "user"
                  },
                  "name": {
                    "type": "string",
                    "description": "The person's name, or the calendar's name when they haven't given one. Never null."
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "type",
                  "slug",
                  "name"
                ],
                "properties": {
                  "type": {
                    "const": "organization"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "preset": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "labels": {
            "$ref": "#/components/schemas/CalendarLabels"
          },
          "time_zone": {
            "type": "string",
            "description": "An IANA zone, such as Asia/Kolkata."
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2."
          },
          "today": {
            "type": "string",
            "format": "date",
            "description": "The calendar's local date now."
          },
          "live": {
            "type": "object",
            "required": [
              "accepting_bookings",
              "bookable_online"
            ],
            "properties": {
              "accepting_bookings": {
                "type": "boolean",
                "description": "Online booking is switched on."
              },
              "bookable_online": {
                "type": "boolean",
                "description": "There's something clients can book online."
              }
            }
          },
          "your_provider": {
            "description": "On GET /calendars/{id}, the person this login is on the team, if any; always null in the list.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "web_url": {
            "type": "string",
            "format": "uri",
            "description": "The calendar on the web."
          }
        }
      },
      "Calendar": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CalendarSummary"
          },
          {
            "type": "object",
            "required": [
              "features",
              "providers",
              "offerings"
            ],
            "properties": {
              "features": {
                "type": "object",
                "description": "Which parts of Calendar the business uses.",
                "required": [
                  "team",
                  "front_desk",
                  "walk_ins",
                  "processing",
                  "buffers",
                  "intake_questions",
                  "request_to_book",
                  "advance",
                  "waitlist"
                ],
                "properties": {
                  "team": {
                    "type": "boolean"
                  },
                  "front_desk": {
                    "type": "boolean"
                  },
                  "walk_ins": {
                    "type": "boolean"
                  },
                  "processing": {
                    "type": "boolean"
                  },
                  "buffers": {
                    "type": "boolean"
                  },
                  "intake_questions": {
                    "type": "boolean"
                  },
                  "request_to_book": {
                    "type": "boolean"
                  },
                  "advance": {
                    "type": "boolean"
                  },
                  "waitlist": {
                    "type": "boolean"
                  }
                }
              },
              "providers": {
                "type": "array",
                "description": "The people who take bookings, inactive ones included.",
                "items": {
                  "$ref": "#/components/schemas/CalendarProvider"
                }
              },
              "offerings": {
                "type": [
                  "array",
                  "null"
                ],
                "description": "The front desk and admins: the menu the desk books from (active offerings, front-desk-only ones included). Null for staff.",
                "items": {
                  "$ref": "#/components/schemas/CalendarOffering"
                }
              }
            }
          }
        ]
      },
      "CalendarProvider": {
        "type": "object",
        "required": [
          "id",
          "name",
          "title",
          "color",
          "active",
          "bookable_online",
          "kard"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "$ref": "#/components/schemas/ProviderFirstName"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Senior stylist"
            ]
          },
          "color": {
            "type": "string",
            "description": "Their colour on the schedule.",
            "enum": [
              "clay",
              "amber",
              "ochre",
              "olive",
              "sage",
              "teal",
              "sky",
              "indigo",
              "plum",
              "rose"
            ]
          },
          "active": {
            "type": "boolean",
            "description": "False once they stop taking bookings (their past visits stay)."
          },
          "bookable_online": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "kard": {
            "type": [
              "string",
              "null"
            ],
            "description": "The share_link of the kard that books them, if any."
          }
        }
      },
      "CalendarOffering": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "category",
          "duration_minutes",
          "duration_options",
          "buffer_before_minutes",
          "buffer_after_minutes",
          "price_cents",
          "price_mode",
          "price",
          "advance_cents",
          "location_kind",
          "visibility",
          "requires_approval",
          "provider_ids"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "integer"
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "buffer_before_minutes": {
            "type": "integer",
            "description": "Prep: its person is busy this long before the client's time (`labels.buffer_before`). In a visit of several back to back, only the first one's counts.",
            "examples": [
              0,
              5
            ]
          },
          "buffer_after_minutes": {
            "type": "integer",
            "description": "Cleanup (`labels.buffer_after`; travel for home services): its person is busy this long after the client's time, so the next booking with them starts after it. In a visit of several back to back, only the last one's counts. A booking's `busy` shows the time it holds.",
            "examples": [
              0,
              10
            ]
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minor units of the calendar's currency."
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "from",
              "free",
              "hidden"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "The price in words, such as \"₹800\", \"From ₹3,000\" or \"Free\"."
          },
          "advance_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The advance a client is asked for when booking, if any."
          },
          "location_kind": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "at_business",
              "at_client",
              "phone",
              "video",
              "custom",
              null
            ]
          },
          "visibility": {
            "type": "string",
            "description": "`unlisted`: link only; `internal`: front desk only.",
            "enum": [
              "public",
              "unlisted",
              "internal"
            ]
          },
          "requires_approval": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "A request the business approves, rather than an instant booking."
          },
          "provider_ids": {
            "type": "array",
            "description": "Who does it.",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "ScheduleDay": {
        "type": "object",
        "required": [
          "view",
          "date",
          "today",
          "time_zone",
          "closed",
          "summary",
          "free_now",
          "people"
        ],
        "properties": {
          "view": {
            "const": "day"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "today": {
            "type": "boolean",
            "description": "Whether `date` is the calendar's today."
          },
          "time_zone": {
            "type": "string"
          },
          "closed": {
            "description": "A closure covering the whole day (\"Closed for Diwali\"), or null.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "note",
                  "starts_at",
                  "ends_at"
                ],
                "properties": {
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "starts_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "ends_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            ]
          },
          "summary": {
            "type": "object",
            "required": [
              "booked",
              "requests",
              "unconfirmed",
              "on_leave",
              "off",
              "requests_waiting"
            ],
            "properties": {
              "booked": {
                "type": "integer",
                "description": "Visits that day."
              },
              "requests": {
                "type": "integer",
                "description": "Requests to approve that day."
              },
              "unconfirmed": {
                "type": "integer",
                "description": "Reminded, not confirmed yet: the likeliest no-shows."
              },
              "on_leave": {
                "type": "array",
                "description": "The names of people on leave.",
                "items": {
                  "type": "string"
                }
              },
              "off": {
                "type": "array",
                "description": "The names of people with the day off and nothing booked.",
                "items": {
                  "type": "string"
                }
              },
              "requests_waiting": {
                "type": "integer",
                "description": "Requests to approve, on any day."
              }
            }
          },
          "free_now": {
            "type": "array",
            "description": "Today: who is free right now, and until when (local).",
            "items": {
              "type": "object",
              "required": [
                "provider",
                "until"
              ],
              "properties": {
                "provider": {
                  "$ref": "#/components/schemas/NamedPerson"
                },
                "until": {
                  "type": "string",
                  "examples": [
                    "15:00"
                  ]
                }
              }
            }
          },
          "people": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "provider",
                "status",
                "note",
                "hours",
                "blocks",
                "bookings"
              ],
              "properties": {
                "provider": {
                  "$ref": "#/components/schemas/CalendarProvider"
                },
                "status": {
                  "type": "string",
                  "description": "`day_off`: no hours that date; `leave`: time off covers every working hour; `inactive`: no longer taking bookings (shown for their visits).",
                  "enum": [
                    "working",
                    "day_off",
                    "leave",
                    "inactive"
                  ]
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "examples": [
                    "On leave until Fri 11 Jan"
                  ]
                },
                "hours": {
                  "type": "array",
                  "description": "Local working hours, as [from, to] pairs.",
                  "items": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 2,
                    "items": {
                      "type": "string"
                    }
                  },
                  "examples": [
                    [
                      [
                        "10:00",
                        "13:00"
                      ],
                      [
                        "14:00",
                        "19:00"
                      ]
                    ]
                  ]
                },
                "blocks": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleBlock"
                  }
                },
                "bookings": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleBooking"
                  }
                }
              }
            }
          }
        }
      },
      "ScheduleWeek": {
        "type": "object",
        "required": [
          "view",
          "date",
          "monday",
          "time_zone",
          "provider",
          "days"
        ],
        "properties": {
          "view": {
            "const": "week"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "monday": {
            "type": "string",
            "format": "date"
          },
          "time_zone": {
            "type": "string"
          },
          "provider": {
            "description": "The one person shown, with `provider_id`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "days": {
            "type": "array",
            "description": "Monday to Sunday.",
            "items": {
              "type": "object",
              "required": [
                "date",
                "status",
                "note",
                "booked",
                "blocks",
                "bookings"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "status": {
                  "type": "string",
                  "description": "`closed`: nobody works, or a closure.",
                  "enum": [
                    "open",
                    "closed"
                  ]
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Why a closed day is closed."
                },
                "booked": {
                  "type": "integer",
                  "description": "Visits that day."
                },
                "blocks": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleBlock"
                  }
                },
                "bookings": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleBooking"
                  }
                }
              }
            }
          }
        }
      },
      "ScheduleBlock": {
        "type": "object",
        "description": "A break, time off, blocked time or a closure on the grid.",
        "required": [
          "id",
          "kind",
          "label",
          "from",
          "to",
          "whole_calendar"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for the gap between two shifts of a split day."
          },
          "kind": {
            "type": "string",
            "enum": [
              "break",
              "time_off",
              "blocked",
              "closed"
            ]
          },
          "label": {
            "type": "string",
            "examples": [
              "Product training"
            ]
          },
          "from": {
            "type": "string",
            "examples": [
              "17:00"
            ]
          },
          "to": {
            "type": "string",
            "examples": [
              "18:00"
            ]
          },
          "whole_calendar": {
            "type": "boolean",
            "description": "For everyone, not one person."
          }
        }
      },
      "ScheduleBooking": {
        "type": "object",
        "description": "A visit on the schedule, with what a day's row acts on. The client's other details are on GET /calendars/{calendar_id}/bookings/{id}.",
        "required": [
          "id",
          "lock_version",
          "status",
          "title",
          "starts_at",
          "ends_at",
          "local",
          "client",
          "source",
          "confirmed",
          "busy"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "lock_version": {
            "$ref": "#/components/schemas/LockVersion"
          },
          "status": {
            "type": "string",
            "description": "`declined` here is always a request nobody answered before its hold ended (`cancellation_reason` \"Not confirmed in time\"): it stays where it was, where a request the desk declined leaves the schedule. Before 1.9.7 such a request left the schedule too.",
            "enum": [
              "requested",
              "booked",
              "arrived",
              "completed",
              "cancelled",
              "no_show",
              "declined"
            ]
          },
          "title": {
            "type": "string"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local": {
            "type": "string",
            "description": "The local times.",
            "examples": [
              "15:00–16:30"
            ]
          },
          "provider": {
            "$ref": "#/components/schemas/NamedPerson"
          },
          "client": {
            "type": "object",
            "required": [
              "id",
              "name",
              "alert_note",
              "phone"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "first_name": {
                "$ref": "#/components/schemas/ClientFirstName"
              },
              "alert_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Null where this login doesn't see the client's details (staff, on others' visits)."
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The number to remind them on; null where this login doesn't see the client's details, or they gave none."
              },
              "nameless_walk_ins": {
                "type": "boolean",
                "description": "The one record every walk-in who gives no name is filed under (named \"Walk-in\"), as the booking's `client.nameless_walk_ins`: a row's actions say \"the walk-in\" for it (\"Mark the walk-in as arrived\", never \"Mark Walk-in as arrived\"), as the sheet's do. Left out by servers before 1.9.12: read it as false."
              }
            }
          },
          "client_time_zone": {
            "type": "string",
            "description": "The client's own time zone, when they booked online from another one (\"10:00 AM in Chicago\"); absent otherwise."
          },
          "client_zone_label": {
            "type": "string",
            "description": "The client's zone as the web names it: the country when the zone is its country's only one, else the city (\"India\", \"London\", \"Chicago\"). With `client_time_zone`; absent without it.",
            "examples": [
              "Chicago"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "online",
              "front_desk",
              "walk_in",
              "api"
            ]
          },
          "confirmed": {
            "type": "boolean",
            "description": "The client confirmed."
          },
          "reminder_sent_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the reminder went; absent before. Booked, not confirmed and not started after it: they didn't confirm after the reminder (the day's \"not confirmed\")."
          },
          "paid": {
            "type": "boolean",
            "description": "Marked paid. The front desk and admins only (absent for staff)."
          },
          "payable": {
            "type": "boolean",
            "description": "It can be marked paid (it has started), or already is. The front desk and admins only."
          },
          "overlap": {
            "type": "boolean",
            "description": "The day view: it overlaps another visit of the same person (booked anyway)."
          },
          "busy": {
            "$ref": "#/components/schemas/VisitBusy"
          },
          "request_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request's hold runs out, as the booking's own `request_expires_at`: the same value and rule. Null for anything but a request, and once its advance is received (it's then held until someone answers). From then it holds no time, and a copy of a day read earlier can show it ended at this time without reading the day again. Read after it, the schedule has it `declined` (\"Not confirmed in time\"), in the same place: reading the day or the week declines a request whose hold has ended, if the sweep hasn't yet (since 1.9.7; before, the schedule left it out until the sweep, and then for good).",
            "examples": [
              "2030-01-09T09:30:00Z"
            ]
          },
          "declined_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request was declined (`status` `declined`), so an app that never read it as a request can say it: the moment the desk declined it (since 1.9.12; null for one declined before), or for a request nobody answered (`cancellation_reason` \"Not confirmed in time\") the end of its hold, the time the web's row gives (\"Declined at 10:00, when its hold ended: nobody answered in time.\"). Null for anything else. Since 1.9.9; absent from a server before it."
          },
          "cancellation_reason": {
            "type": "string",
            "description": "Why it was cancelled or declined, where this login sees the client's details (staff: their own visits), and always for a request nobody answered in time (\"Not confirmed in time\"). Absent when there's none. Since 1.9.7.",
            "examples": [
              "Not confirmed in time"
            ]
          }
        }
      },
      "VisitBusy": {
        "type": "array",
        "description": "The time this visit keeps its person from anyone else, which is what availability books around: its prep and cleanup included, a processing window left out (two spans then: the person is free in between), back-to-back parts as one span. Empty once it holds no time (cancelled, declined, or a request whose hold ran out). A free gap starts where a span ends, which can be after `ends_at` (10 minutes' cleanup: an 11:00–12:00 visit holds its person until 12:10).",
        "items": {
          "type": "object",
          "required": [
            "starts_at",
            "ends_at"
          ],
          "properties": {
            "starts_at": {
              "type": "string",
              "format": "date-time"
            },
            "ends_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        },
        "examples": [
          [
            {
              "starts_at": "2030-01-09T05:20:00Z",
              "ends_at": "2030-01-09T06:40:00Z"
            }
          ],
          [
            {
              "starts_at": "2030-01-09T05:30:00Z",
              "ends_at": "2030-01-09T06:00:00Z"
            },
            {
              "starts_at": "2030-01-09T06:30:00Z",
              "ends_at": "2030-01-09T07:00:00Z"
            }
          ]
        ]
      },
      "LockVersion": {
        "type": "integer",
        "description": "The booking's lock_version, from its JSON. If someone changed the booking since, nothing is overwritten (409 stale_booking)."
      },
      "DeskBooking": {
        "type": "object",
        "description": "The webhook's booking (Booking), plus what the desk's booking sheet shows. Staff read every visit, but on someone else's the client's `phone`, `email` and `alert_note`, and `notes`, `answers`, `guest_emails`, `client_address`, `internal_notes` and `history` are null, as on the web; `payment` and `advance` are null for staff.\n",
        "required": [
          "id",
          "status",
          "source",
          "title",
          "starts_at",
          "ends_at",
          "local_starts_at",
          "time_zone",
          "duration_minutes",
          "price_cents",
          "currency",
          "price",
          "client",
          "client_time_zone",
          "client_zone_label",
          "items",
          "kard",
          "notes",
          "client_address",
          "answers",
          "guest_emails",
          "cancelled_at",
          "cancelled_by",
          "cancellation_reason",
          "created_at",
          "updated_at",
          "lock_version",
          "channel",
          "created_by",
          "provenance",
          "provider",
          "busy",
          "internal_notes",
          "video_url",
          "overlap_allowed",
          "client_mail_held",
          "confirmed_at",
          "reminder_sent_at",
          "request_expires_at",
          "payment",
          "advance",
          "can",
          "history"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "booked",
              "arrived",
              "completed",
              "cancelled",
              "no_show",
              "declined"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "online",
              "front_desk",
              "walk_in",
              "api"
            ],
            "description": "How it was booked: `online` by the client, `front_desk` by the business (at the web's desk or in the app), `walk_in`, or `api` (an AI key)."
          },
          "title": {
            "type": "string",
            "examples": [
              "Haircut + Blow-dry"
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "time_zone": {
            "type": "string"
          },
          "duration_minutes": {
            "type": "integer"
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "\"₹1,300\", \"From ₹4,000\" (a service in it has a starting price: `price_mode` `from`; before field fixes 2h, the amount alone), \"Free\", or null when no price was set. Always English with English digit grouping, in the API and in webhooks alike, whatever language the client booked in (since 1.9.11, a webhook from a German booking page no longer says \"From ₹4.000\")."
          },
          "client": {
            "type": "object",
            "required": [
              "id",
              "name",
              "phone",
              "email",
              "alert_note",
              "visits",
              "bookings_count",
              "no_show_count",
              "cancelled_count",
              "new",
              "nameless_walk_ins"
            ],
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "first_name": {
                "$ref": "#/components/schemas/ClientFirstName"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "alert_note": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Shows on every booking of theirs (\"Nut allergy\")."
              },
              "visits": {
                "type": "integer",
                "description": "Times they turned up (arrived or completed), the same number as the client's page and the clients list: \"3 visits\"."
              },
              "bookings_count": {
                "type": "integer",
                "description": "Every booking of theirs, whatever its status, cancelled and still to come too (\"8 appointments\"); not their visits."
              },
              "no_show_count": {
                "type": "integer"
              },
              "cancelled_count": {
                "type": "integer"
              },
              "new": {
                "type": "boolean",
                "description": "Their first visit: no visit before this one, and no earlier booking of theirs still to come (cancelled, declined and no-show ones don't count). Only a new client's earliest visit, not each of theirs (the day's NEW; say \"First visit\")."
              },
              "nameless_walk_ins": {
                "type": "boolean",
                "description": "The one record every walk-in who gives no name is filed under (\"Walk-in\"); its counts are many people's."
              }
            }
          },
          "client_time_zone": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_zone_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's zone as the web names it: the country when the zone is its country's only one, else the city (\"India\", \"London\", \"New York\"), for \"10:00 AM in London\". Null when `client_time_zone` is.",
            "examples": [
              "London"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingItem"
            }
          },
          "kard": {
            "$ref": "#/components/schemas/BookingKard"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The client's note when booking."
          },
          "client_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "answers": {
            "type": [
              "object",
              "null"
            ],
            "description": "Answers to the offering's questions, by question key."
          },
          "guest_emails": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cancelled_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "client",
              "business",
              null
            ]
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "lock_version": {
            "$ref": "#/components/schemas/LockVersion"
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "description": "How the desk took it.",
            "enum": [
              "phone",
              "whatsapp",
              "instagram",
              "in_person",
              "other",
              null
            ]
          },
          "created_by": {
            "description": "Who booked it at the desk, in the app or through the API.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            ]
          },
          "provenance": {
            "type": "string",
            "description": "How and when it was booked, as the web's sheet says it.",
            "examples": [
              "Booked at the desk by Rhea on 9 Oct · by phone",
              "Booked online from Priya's Kard on 9 Oct",
              "Walk-in on 9 Oct"
            ]
          },
          "provider": {
            "description": "The person it's with.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "busy": {
            "$ref": "#/components/schemas/VisitBusy"
          },
          "internal_notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team's note; clients never see it."
          },
          "video_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "overlap_allowed": {
            "type": "boolean",
            "description": "Booked anyway over someone's time."
          },
          "client_mail_held": {
            "type": "boolean",
            "description": "The client isn't emailed about it: the personal calendar's owner hasn't verified their email address yet (a write's `notice` says so)."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the client confirmed."
          },
          "reminder_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "request_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request's hold runs out, worked out when it was made (4 hours of the calendar's opening hours and its person's, never later than 30 minutes before it starts). Null once its advance is received, since it's then held until someone approves or declines it, and for anything but a request."
          },
          "declined_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request was declined (`status` `declined`), so an app that never read it as a request can say it: the moment the desk declined it (since 1.9.12; null for one declined before), or for a request nobody answered (`cancellation_reason` \"Not confirmed in time\") the end of its hold, the time the web's row gives (\"Declined at 10:00, when its hold ended: nobody answered in time.\"). Null for anything else. Since 1.9.9; absent from a server before it."
          },
          "payment": {
            "description": "The front desk and admins; null for staff.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BookingPayment"
              },
              {
                "type": "null"
              }
            ]
          },
          "advance": {
            "description": "The advance the client was asked for; null when none was (and for staff).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/BookingAdvance"
              },
              {
                "type": "null"
              }
            ]
          },
          "can": {
            "type": "object",
            "required": [
              "work",
              "manage"
            ],
            "properties": {
              "work": {
                "type": "boolean",
                "description": "This login may change its status and team note, and sees the client's details."
              },
              "manage": {
                "type": "boolean",
                "description": "This login may also book, move, cancel, answer requests and handle the money."
              }
            }
          },
          "history": {
            "type": [
              "array",
              "null"
            ],
            "description": "One booking (GET …/bookings/{id}): the client's last 3 earlier visits. Null in lists, and where this login doesn't see the client's details.",
            "items": {
              "$ref": "#/components/schemas/VisitSummary"
            }
          }
        }
      },
      "BookingPayment": {
        "type": "object",
        "required": [
          "paid",
          "payable",
          "paid_cents",
          "tip_cents",
          "payment_method",
          "paid_at",
          "amount_due_cents"
        ],
        "properties": {
          "paid": {
            "type": "boolean"
          },
          "payable": {
            "type": "boolean",
            "description": "It can be marked paid (it has started), or already is."
          },
          "paid_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tip_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cash",
              "upi",
              "card",
              "other",
              null
            ]
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "amount_due_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What \"Mark paid\" starts from, the price less an advance received."
          }
        }
      },
      "BookingAdvance": {
        "type": "object",
        "required": [
          "amount_cents",
          "received_at",
          "due",
          "outcome"
        ],
        "properties": {
          "amount_cents": {
            "type": "integer"
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "due": {
            "type": "boolean",
            "description": "Asked for and not received yet."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "refunded",
              "kept",
              null
            ],
            "description": "A received advance on a visit that's off (cancelled or declined), once the desk says whether it was refunded or kept; null otherwise."
          }
        }
      },
      "CalendarSeriesInput": {
        "type": "object",
        "required": [
          "offering_ids",
          "starts_at",
          "every_weeks"
        ],
        "properties": {
          "offering_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "The first visit; every date steps from it on the calendar's wall clock."
          },
          "every_weeks": {
            "type": "integer",
            "enum": [
              1,
              2,
              4
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 2,
            "maximum": 52,
            "description": "How many visits; or `until`, not both. A series runs a year at most: up to 52 every week, 27 every 2 weeks, 14 every 4 weeks."
          },
          "until": {
            "type": "string",
            "format": "date",
            "description": "The last local date a visit may fall on (within a year of the first, and 52 visits at most); or `count`."
          },
          "provider_id": {
            "type": "integer",
            "description": "Who takes every date; else whoever is first free at the first date."
          },
          "client_id": {
            "type": "integer"
          },
          "client": {
            "type": "object",
            "description": "Instead of client_id, a client matched by phone, then email, or made.",
            "properties": {
              "name": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "duration": {
            "type": "integer",
            "description": "One of the first offering's other lengths (minutes)."
          },
          "picks": {
            "type": "array",
            "description": "Another time for a date (`starts_at`, `provider_id`), or `skip` to leave it out, by its `index` (0 is the first).",
            "items": {
              "type": "object",
              "required": [
                "index"
              ],
              "properties": {
                "index": {
                  "type": "integer"
                },
                "starts_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "provider_id": {
                  "type": "integer"
                },
                "skip": {
                  "type": "boolean"
                }
              }
            }
          },
          "if_taken": {
            "type": "string",
            "enum": [
              "skip",
              "refuse"
            ],
            "default": "skip"
          },
          "dry_run": {
            "type": "boolean",
            "default": false
          },
          "notes": {
            "type": "string"
          },
          "internal_notes": {
            "type": "string"
          },
          "client_address": {
            "type": "string"
          },
          "channel": {
            "type": "string",
            "enum": [
              "phone",
              "whatsapp",
              "instagram",
              "in_person",
              "other"
            ]
          },
          "guest_emails": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string"
            }
          },
          "answers": {
            "type": "object"
          },
          "idempotency_key": {
            "type": "string"
          }
        }
      },
      "CalendarSeries": {
        "type": "object",
        "required": [
          "id",
          "client",
          "every_weeks",
          "visits"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "client": {
            "$ref": "#/components/schemas/NamedClient"
          },
          "every_weeks": {
            "type": "integer"
          },
          "cadence": {
            "type": "string",
            "examples": [
              "every week"
            ]
          },
          "count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "How many visits were asked, or null when it was until a date."
          },
          "until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "The first visit as asked."
          },
          "source": {
            "type": "string",
            "enum": [
              "front_desk",
              "api"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "visits_count": {
            "type": "integer"
          },
          "upcoming_count": {
            "type": "integer"
          },
          "next_starts_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "visits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesVisit"
            }
          }
        }
      },
      "SeriesVisit": {
        "type": "object",
        "required": [
          "id",
          "status",
          "starts_at",
          "ends_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "lock_version": {
            "$ref": "#/components/schemas/LockVersion"
          }
        }
      },
      "CalendarSeriesEnvelope": {
        "type": "object",
        "required": [
          "series"
        ],
        "properties": {
          "series": {
            "$ref": "#/components/schemas/CalendarSeries"
          }
        }
      },
      "CalendarSeriesPage": {
        "type": "object",
        "required": [
          "series",
          "pagination"
        ],
        "properties": {
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CalendarSeries"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "SeriesPlan": {
        "type": "object",
        "required": [
          "every_weeks",
          "dates"
        ],
        "properties": {
          "every_weeks": {
            "type": "integer"
          },
          "provider_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dates_count": {
            "type": "integer"
          },
          "to_book_count": {
            "type": "integer"
          },
          "taken_count": {
            "type": "integer"
          },
          "skipped_count": {
            "type": "integer"
          },
          "dates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesDate"
            }
          }
        }
      },
      "SeriesDate": {
        "type": "object",
        "required": [
          "index",
          "status",
          "starts_at"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "free",
              "taken",
              "skipped"
            ]
          },
          "picked": {
            "type": "boolean"
          },
          "wanted_at": {
            "type": "string",
            "format": "date-time"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "alternatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesAlternative"
            }
          }
        }
      },
      "SeriesAlternative": {
        "type": "object",
        "required": [
          "provider_id",
          "starts_at"
        ],
        "properties": {
          "provider_id": {
            "type": "integer"
          },
          "provider_name": {
            "type": "string"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SeriesMove": {
        "type": "object",
        "required": [
          "booking_id",
          "status",
          "from",
          "to"
        ],
        "properties": {
          "booking_id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "free",
              "taken",
              "kept"
            ]
          },
          "picked": {
            "type": "boolean"
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "local_to": {
            "type": "string",
            "format": "date-time"
          },
          "provider_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "alternatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeriesAlternative"
            }
          }
        }
      },
      "SeriesFailure": {
        "type": "object",
        "required": [
          "starts_at",
          "error"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "booking_id": {
            "type": "integer"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "DeskBookingEnvelope": {
        "type": "object",
        "required": [
          "booking"
        ],
        "properties": {
          "booking": {
            "$ref": "#/components/schemas/DeskBooking"
          },
          "notice": {
            "type": "string",
            "description": "Only when the client isn't emailed (`booking.client_mail_held`): why, and what lifts it, to pass on to the person."
          }
        }
      },
      "DeskBookingPage": {
        "type": "object",
        "required": [
          "bookings",
          "pagination"
        ],
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeskBooking"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        }
      },
      "CalendarBookingInput": {
        "type": "object",
        "required": [
          "offering_ids"
        ],
        "properties": {
          "offering_ids": {
            "type": "array",
            "description": "One or more offerings, back to back with one person.",
            "items": {
              "type": "integer"
            }
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "Required, except for a walk-in (which starts now)."
          },
          "source": {
            "type": "string",
            "description": "`walk_in`: someone in the shop now (where `features.walk_ins` is on).",
            "enum": [
              "api",
              "walk_in"
            ],
            "default": "api"
          },
          "client": {
            "type": "object",
            "description": "A new or matched client; the front desk needs only a name. A walk-in without a client files under the desk's anonymous \"Walk-in\".",
            "properties": {
              "name": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "format": "email"
              }
            }
          },
          "client_id": {
            "type": "integer",
            "description": "An existing client, instead of `client`."
          },
          "provider_id": {
            "type": "integer",
            "description": "Who with; anyone free when omitted."
          },
          "duration": {
            "type": "integer",
            "description": "One of the offering's duration options, in minutes."
          },
          "notes": {
            "type": "string"
          },
          "internal_notes": {
            "type": "string",
            "description": "A note only the team sees."
          },
          "answers": {
            "type": "object"
          },
          "guest_emails": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string",
              "format": "email"
            }
          },
          "channel": {
            "type": "string",
            "enum": [
              "phone",
              "whatsapp",
              "instagram",
              "in_person",
              "other"
            ]
          },
          "client_address": {
            "type": "string",
            "maxLength": 500,
            "description": "Where to go, for a service done at the client's address."
          },
          "overlap_allowed": {
            "type": "boolean",
            "description": "Book anyway over existing time; needs provider_id."
          },
          "idempotency_key": {
            "type": "string",
            "description": "A retry with the same key returns the first booking."
          }
        }
      },
      "VisitSummary": {
        "type": "object",
        "description": "A visit in a list (a client's history, upcoming and unpaid visits). A `booked` one reads Confirmed with `client_confirmed_at`, Not confirmed with only `reminder_24h_sent_at` (reminded, no answer yet), else Booked, as the web's customer page says.",
        "required": [
          "id",
          "status",
          "title",
          "starts_at",
          "local_starts_at",
          "provider",
          "price_cents",
          "paid_cents",
          "client_confirmed_at",
          "reminder_24h_sent_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "booked",
              "arrived",
              "completed",
              "cancelled",
              "no_show",
              "declined"
            ]
          },
          "title": {
            "type": "string"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "The price as the booking says it (its `price`): \"₹3,500\", \"From ₹3,500\" (a service in it has a starting price), \"Free\", or null when no price was set, so a client's page and Takings say \"From\" where `price_cents` alone can't. Since 1.9.12; left out by servers before it.",
            "examples": [
              "From ₹3,500"
            ]
          },
          "price_from": {
            "type": "boolean",
            "description": "A service in it has a starting price (the booking's `price_from`). Since 1.9.12; left out by servers before it."
          },
          "paid_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "client_confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the client confirmed, as a booking's `confirmed_at`. Cleared when the visit moves to another time."
          },
          "reminder_24h_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the day-before reminder went, as a booking's `reminder_sent_at`. Cleared when the visit moves to another time."
          },
          "unanswered": {
            "type": "boolean",
            "description": "A request nobody answered before its hold ran out: still `requested` with `request_expires_at` passed, or declined by the sweep since (`declined`, and `request_expires_at` null then). The web's client History reads it \"Ran out\" either way, where a request the desk declined reads \"Declined\". False for everything else. Left out by servers before 1.9.2."
          },
          "request_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request's hold runs out, as the booking's own `request_expires_at`: null for anything but a request, and once its advance is received. A client's `next_booking` and `upcoming` leave out a request whose hold ran out, so a copy read earlier can drop it at this time; in `history` a `requested` visit with this in the past wasn't answered in time (the sweep declines it within minutes)."
          },
          "declined_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a request was declined (`status` `declined`), so an app that never read it as a request can say it: the moment the desk declined it (since 1.9.12; null for one declined before), or for a request nobody answered (`cancellation_reason` \"Not confirmed in time\") the end of its hold, the time the web's row gives (\"Declined at 10:00, when its hold ended: nobody answered in time.\"). Null for anything else. Since 1.9.9; absent from a server before it."
          }
        }
      },
      "ClientSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "phone",
          "email",
          "alert_note",
          "blocked",
          "source",
          "visits",
          "bookings_count",
          "no_show_count",
          "cancelled_count",
          "last_visit_at",
          "next_booking",
          "usual",
          "possible_duplicate_of",
          "nameless_walk_ins",
          "whatsapp_opted_in",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "$ref": "#/components/schemas/ClientFirstName"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "+919876543210"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "alert_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Shows on every booking of theirs (\"Nut allergy\")."
          },
          "blocked": {
            "type": "boolean",
            "description": "They can't book online (the desk still can)."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "How they were added.",
            "enum": [
              "online",
              "front_desk",
              "import",
              "contacts",
              null
            ]
          },
          "visits": {
            "type": "integer",
            "description": "Times they turned up (arrived or completed)."
          },
          "bookings_count": {
            "type": "integer"
          },
          "no_show_count": {
            "type": "integer"
          },
          "cancelled_count": {
            "type": "integer"
          },
          "last_visit_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_booking": {
            "description": "Their current or next booking: under way (arrived), or requested or booked and not over yet. A request whose hold ran out isn't one, as on the schedule (its own `request_expires_at` says when).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/VisitSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "usual": {
            "description": "What they book most, and with whom.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "required": [
                  "offering",
                  "provider",
                  "times"
                ],
                "properties": {
                  "offering": {
                    "type": "string",
                    "examples": [
                      "Root touch-up"
                    ]
                  },
                  "provider": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "examples": [
                      "Priya"
                    ]
                  },
                  "times": {
                    "type": "integer"
                  }
                }
              }
            ]
          },
          "possible_duplicate_of": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The client this may be the same person as (merge them, or unlink them)."
          },
          "nameless_walk_ins": {
            "type": "boolean",
            "description": "The one record every walk-in who gives no name is filed under (\"Walk-in\"). Not one person; the list never holds it."
          },
          "whatsapp_opted_in": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Client": {
        "type": "object",
        "description": "One client, as the client's page shows them.",
        "required": [
          "id",
          "name",
          "phone",
          "email",
          "alert_note",
          "blocked",
          "source",
          "visits",
          "bookings_count",
          "no_show_count",
          "cancelled_count",
          "last_visit_at",
          "possible_duplicate_of",
          "nameless_walk_ins",
          "whatsapp_opted_in",
          "created_at",
          "notes",
          "paid_cents",
          "currency",
          "first_booked_at",
          "last_visit",
          "upcoming",
          "history",
          "history_count",
          "possible_duplicates"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "$ref": "#/components/schemas/ClientFirstName"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "alert_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Shows on every booking of theirs (\"Nut allergy\")."
          },
          "blocked": {
            "type": "boolean",
            "description": "They can't book online (the desk still can)."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "online",
              "front_desk",
              "import",
              "contacts",
              null
            ]
          },
          "visits": {
            "type": "integer",
            "description": "Times they turned up (arrived or completed)."
          },
          "bookings_count": {
            "type": "integer"
          },
          "no_show_count": {
            "type": "integer"
          },
          "cancelled_count": {
            "type": "integer"
          },
          "last_visit_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_booking": {
            "description": "Only in the list (null here); see `upcoming`.",
            "type": "null"
          },
          "usual": {
            "description": "Only in the list (null here).",
            "type": "null"
          },
          "possible_duplicate_of": {
            "description": "The client this may be the same person as.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PossibleDuplicate"
              },
              {
                "type": "null"
              }
            ]
          },
          "nameless_walk_ins": {
            "type": "boolean",
            "description": "The one record every walk-in who gives no name is filed under (\"Walk-in\"). Not one person, so its counts are many people's, and it takes no changes."
          },
          "whatsapp_opted_in": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "The team's notes on the client; they can hold health details."
          },
          "paid_cents": {
            "type": "integer",
            "description": "Everything marked paid, in the calendar's currency."
          },
          "currency": {
            "type": "string"
          },
          "first_booked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_visit": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/VisitSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "upcoming": {
            "type": "array",
            "description": "Visits under way or to come (requested, booked or arrived, not over yet), soonest first: the web's \"Coming up\". A request whose hold ran out is left out, as on the schedule; until the sweep declines it, it's in `history`, still `requested`.",
            "items": {
              "$ref": "#/components/schemas/VisitSummary"
            }
          },
          "history": {
            "type": "array",
            "description": "Earlier visits, the latest 10 (all with `history=all`).",
            "items": {
              "$ref": "#/components/schemas/VisitSummary"
            }
          },
          "history_count": {
            "type": "integer"
          },
          "possible_duplicates": {
            "type": "array",
            "description": "Newer records that may be this same person.",
            "items": {
              "$ref": "#/components/schemas/PossibleDuplicate"
            }
          }
        }
      },
      "PossibleDuplicate": {
        "type": "object",
        "required": [
          "id",
          "name",
          "phone",
          "email"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ClientEnvelope": {
        "type": "object",
        "required": [
          "client"
        ],
        "properties": {
          "client": {
            "$ref": "#/components/schemas/Client"
          }
        }
      },
      "ClientInput": {
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "description": "On create: your key for this one. Sending it again answers 200 with the first, nothing made twice (a retry after a lost answer)."
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "notes": {
            "type": "string"
          },
          "alert_note": {
            "type": "string",
            "maxLength": 200,
            "description": "Shows on every booking of theirs."
          },
          "blocked": {
            "type": "boolean",
            "description": "Stops them booking online (the desk still can)."
          }
        }
      },
      "Takings": {
        "type": "object",
        "required": [
          "from",
          "to",
          "days",
          "currency",
          "taken_cents",
          "taken",
          "tips_cents",
          "visits",
          "by_day",
          "by_provider",
          "by_method",
          "other_currency_visits",
          "unpaid"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "days": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "taken_cents": {
            "type": "integer",
            "description": "Everything marked paid, in the calendar's currency."
          },
          "taken": {
            "type": "string",
            "examples": [
              "₹12,500"
            ]
          },
          "tips_cents": {
            "type": "integer"
          },
          "visits": {
            "type": "integer",
            "description": "Paid visits."
          },
          "by_day": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "date",
                "taken_cents",
                "tips_cents",
                "visits"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "taken_cents": {
                  "type": "integer"
                },
                "tips_cents": {
                  "type": "integer"
                },
                "visits": {
                  "type": "integer"
                }
              }
            }
          },
          "by_provider": {
            "type": "array",
            "description": "Most taken first; `key` is the person's id.",
            "items": {
              "$ref": "#/components/schemas/TakingsShare"
            }
          },
          "by_method": {
            "type": "array",
            "description": "Most taken first; `key` is cash, upi, card, other or advance.",
            "items": {
              "$ref": "#/components/schemas/TakingsShare"
            }
          },
          "other_currency_visits": {
            "type": "integer",
            "description": "Paid visits in another currency, left out of the totals."
          },
          "unpaid": {
            "type": "object",
            "description": "Finished visits nobody marked paid.",
            "required": [
              "count",
              "not_shown",
              "visits"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "not_shown": {
                "type": "integer",
                "description": "How many of them aren't in `visits` (it holds the 50 most recent)."
              },
              "visits": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VisitWithClient"
                }
              }
            }
          }
        }
      },
      "InsightsWindow": {
        "type": "object",
        "description": "Booked time over working time, in minutes; `share` is booked over working (null with no working time).",
        "required": [
          "working_minutes",
          "booked_minutes",
          "outside_minutes",
          "share"
        ],
        "properties": {
          "working_minutes": {
            "type": "integer"
          },
          "booked_minutes": {
            "type": "integer",
            "description": "Inside working time."
          },
          "outside_minutes": {
            "type": "integer",
            "description": "Booked outside working time; not in `share`."
          },
          "share": {
            "type": [
              "number",
              "null"
            ],
            "examples": [
              0.78
            ]
          }
        }
      },
      "InsightsCount": {
        "type": "object",
        "required": [
          "key",
          "label",
          "count"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      },
      "Insights": {
        "type": "object",
        "required": [
          "from",
          "to",
          "days",
          "time_zone",
          "currency",
          "as_of",
          "period",
          "basis",
          "bookings",
          "booked_time",
          "busy_hours",
          "no_shows",
          "cancellations",
          "by_person",
          "clients",
          "sources",
          "booked_ahead",
          "services",
          "money"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "days": {
            "type": "integer"
          },
          "time_zone": {
            "type": "string",
            "examples": [
              "Asia/Kolkata"
            ]
          },
          "currency": {
            "type": "string"
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "description": "Now, where `so_far` ends and `ahead` begins."
          },
          "period": {
            "type": "string",
            "examples": [
              "October 2026",
              "12–18 Oct 2026"
            ]
          },
          "basis": {
            "type": "string",
            "description": "How the numbers are counted, in a sentence."
          },
          "bookings": {
            "type": "object",
            "description": "Everything booked for these dates but cancellations and declined requests (requests still waiting count).",
            "required": [
              "count",
              "cancelled",
              "sentence"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "cancelled": {
                "type": "integer"
              },
              "sentence": {
                "type": "string"
              }
            }
          },
          "booked_time": {
            "type": "object",
            "required": [
              "so_far",
              "ahead",
              "sentence",
              "rule",
              "people"
            ],
            "properties": {
              "so_far": {
                "description": "Up to now; null for dates still to come.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/InsightsWindow"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ahead": {
                "description": "From now on, booked so far; null for dates that have passed.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/InsightsWindow"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "sentence": {
                "type": "string"
              },
              "rule": {
                "type": "string",
                "description": "What booked and working time are."
              },
              "people": {
                "type": "array",
                "description": "Everyone on the team, and anyone switched off since who had bookings, in team order.",
                "items": {
                  "type": "object",
                  "required": [
                    "provider_id",
                    "name",
                    "active",
                    "so_far",
                    "ahead",
                    "sentence"
                  ],
                  "properties": {
                    "provider_id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "so_far": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/InsightsWindow"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ahead": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/InsightsWindow"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sentence": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "busy_hours": {
            "type": "object",
            "required": [
              "window",
              "sentence",
              "rule",
              "cells"
            ],
            "properties": {
              "window": {
                "type": "string",
                "enum": [
                  "so_far",
                  "ahead"
                ],
                "description": "The time the grid counts."
              },
              "sentence": {
                "type": "string",
                "examples": [
                  "Fullest: Saturdays 11 AM–12 PM, 92% booked. Most room: Tuesdays 10–11 AM, 8% booked."
                ]
              },
              "rule": {
                "type": "string"
              },
              "cells": {
                "type": "array",
                "description": "Each hour of the week anyone works, Monday first, on the calendar's local clock.",
                "items": {
                  "type": "object",
                  "required": [
                    "weekday",
                    "weekday_name",
                    "hour",
                    "working_minutes",
                    "booked_minutes",
                    "share"
                  ],
                  "properties": {
                    "weekday": {
                      "type": "integer",
                      "description": "1 is Monday, 7 Sunday."
                    },
                    "weekday_name": {
                      "type": "string"
                    },
                    "hour": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 23
                    },
                    "working_minutes": {
                      "type": "integer"
                    },
                    "booked_minutes": {
                      "type": "integer"
                    },
                    "share": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "no_shows": {
            "type": "object",
            "description": "Over the bookings that have started; one nobody marked arrived, completed or a no-show counts as a show.",
            "required": [
              "count",
              "started",
              "not_marked",
              "rate",
              "sentence"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "started": {
                "type": "integer"
              },
              "not_marked": {
                "type": "integer"
              },
              "rate": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sentence": {
                "type": "string"
              }
            }
          },
          "cancellations": {
            "type": "object",
            "description": "Over every booking made for these dates but declined requests.",
            "required": [
              "count",
              "made",
              "by_client",
              "by_business",
              "rate",
              "sentence"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "made": {
                "type": "integer"
              },
              "by_client": {
                "type": "integer"
              },
              "by_business": {
                "type": "integer"
              },
              "rate": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "sentence": {
                "type": "string"
              }
            }
          },
          "by_person": {
            "type": "array",
            "description": "No-shows and cancellations per person who had visits for these dates, in team order.",
            "items": {
              "type": "object",
              "required": [
                "provider_id",
                "name",
                "bookings",
                "started",
                "no_shows",
                "no_show_rate",
                "made",
                "cancelled",
                "cancellation_rate",
                "sentence"
              ],
              "properties": {
                "provider_id": {
                  "type": "integer"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "bookings": {
                  "type": "integer"
                },
                "started": {
                  "type": "integer"
                },
                "no_shows": {
                  "type": "integer"
                },
                "no_show_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "made": {
                  "type": "integer"
                },
                "cancelled": {
                  "type": "integer"
                },
                "cancellation_rate": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "sentence": {
                  "type": "string"
                }
              }
            }
          },
          "clients": {
            "type": "object",
            "description": "Clients booked for these dates (no-shows aside); new ones had no visit before them.",
            "required": [
              "new",
              "returning",
              "sentence"
            ],
            "properties": {
              "new": {
                "type": "integer"
              },
              "returning": {
                "type": "integer"
              },
              "sentence": {
                "type": "string"
              }
            }
          },
          "sources": {
            "type": "object",
            "required": [
              "sentence",
              "by_source",
              "by_kard",
              "by_channel",
              "channels_sentence"
            ],
            "properties": {
              "sentence": {
                "type": "string"
              },
              "by_source": {
                "type": "array",
                "description": "Most first; online splits `via` kard, link and embed.",
                "items": {
                  "type": "object",
                  "required": [
                    "key",
                    "label",
                    "count",
                    "via"
                  ],
                  "properties": {
                    "key": {
                      "type": "string",
                      "enum": [
                        "online",
                        "front_desk",
                        "walk_in",
                        "api"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "via": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InsightsCount"
                      }
                    }
                  }
                }
              },
              "by_kard": {
                "type": "array",
                "description": "Online bookings per Kard (its booking page and website embeds), most first; then, in one row with `kard_id` null, those from Kards deleted since, so the rows add up to the online bookings that didn't come through booking links.",
                "items": {
                  "type": "object",
                  "required": [
                    "kard_id",
                    "name",
                    "share_link",
                    "label",
                    "count"
                  ],
                  "properties": {
                    "kard_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "share_link": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "label": {
                      "type": "string",
                      "description": "The Kard's name, or \"Kards deleted since\"."
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              },
              "by_channel": {
                "type": "array",
                "description": "How the bookings not made online came in, most first; `none` last.",
                "items": {
                  "$ref": "#/components/schemas/InsightsCount"
                }
              },
              "channels_sentence": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "booked_ahead": {
            "type": "object",
            "description": "Local days from when each booking was made to its start; walk-ins, visits added after they started and the later visits of a repeating booking (it counts once, at its first visit) aren't counted.",
            "required": [
              "buckets",
              "counted",
              "median_hours",
              "walk_ins",
              "after_start",
              "repeat_visits",
              "sentence"
            ],
            "properties": {
              "buckets": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InsightsCount"
                }
              },
              "counted": {
                "type": "integer"
              },
              "median_hours": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "walk_ins": {
                "type": "integer"
              },
              "after_start": {
                "type": "integer"
              },
              "repeat_visits": {
                "type": "integer",
                "description": "Later visits of repeating bookings, left out."
              },
              "sentence": {
                "type": "string"
              }
            }
          },
          "services": {
            "type": "array",
            "description": "Bookings for these dates and money taken in them per service, most booked first.",
            "items": {
              "type": "object",
              "required": [
                "offering_id",
                "name",
                "bookings",
                "taken_cents",
                "taken"
              ],
              "properties": {
                "offering_id": {
                  "type": "integer"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "bookings": {
                  "type": "integer"
                },
                "taken_cents": {
                  "type": "integer"
                },
                "taken": {
                  "type": "string"
                }
              }
            }
          },
          "money": {
            "type": "object",
            "description": "The takings' figures for these dates; a visit with more than one service splits its payment by their prices.",
            "required": [
              "taken_cents",
              "taken",
              "tips_cents",
              "other_currency_visits",
              "sentence"
            ],
            "properties": {
              "taken_cents": {
                "type": "integer"
              },
              "taken": {
                "type": "string"
              },
              "tips_cents": {
                "type": "integer"
              },
              "other_currency_visits": {
                "type": "integer"
              },
              "sentence": {
                "type": "string"
              }
            }
          }
        }
      },
      "TakingsShare": {
        "type": "object",
        "required": [
          "key",
          "label",
          "taken_cents",
          "tips_cents",
          "visits"
        ],
        "properties": {
          "key": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string",
            "examples": [
              "Priya Sharma",
              "UPI"
            ]
          },
          "taken_cents": {
            "type": "integer"
          },
          "tips_cents": {
            "type": "integer"
          },
          "visits": {
            "type": "integer"
          }
        }
      },
      "VisitWithClient": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VisitSummary"
          },
          {
            "type": "object",
            "required": [
              "client"
            ],
            "properties": {
              "client": {
                "$ref": "#/components/schemas/NamedClient"
              }
            }
          }
        ]
      },
      "HoursIntervals": {
        "type": "array",
        "description": "Local [from, to] ranges, 24-hour \"HH:MM\" (\"24:00\" is midnight at the day's end); [] is a day off, two ranges a split shift.",
        "items": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "string"
          }
        },
        "examples": [
          [
            [
              "10:00",
              "13:00"
            ],
            [
              "14:00",
              "19:00"
            ]
          ]
        ]
      },
      "WeeklyHours": {
        "type": "object",
        "required": [
          "mon",
          "tue",
          "wed",
          "thu",
          "fri",
          "sat",
          "sun"
        ],
        "properties": {
          "mon": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "tue": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "wed": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "thu": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "fri": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "sat": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "sun": {
            "$ref": "#/components/schemas/HoursIntervals"
          }
        }
      },
      "WeeklyHoursInput": {
        "type": "object",
        "description": "The days to change; the others keep their hours.",
        "properties": {
          "mon": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "tue": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "wed": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "thu": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "fri": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "sat": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "sun": {
            "$ref": "#/components/schemas/HoursIntervals"
          }
        },
        "examples": [
          {
            "sat": [
              [
                "10:00",
                "14:00"
              ]
            ],
            "sun": [

            ]
          }
        ]
      },
      "CalendarFeature": {
        "type": "string",
        "enum": [
          "team",
          "front_desk",
          "walk_ins",
          "processing",
          "buffers",
          "intake_questions",
          "request_to_book",
          "advance",
          "waitlist"
        ]
      },
      "CalendarPresetDetail": {
        "type": "object",
        "required": [
          "key",
          "name",
          "description",
          "examples",
          "labels",
          "cta",
          "features",
          "defaults",
          "opening_hours",
          "currency",
          "starter_offerings"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "name": {
            "type": "string",
            "examples": [
              "Salon, barber, nails & beauty"
            ]
          },
          "description": {
            "type": "string",
            "examples": [
              "Services, a team day view, walk-ins"
            ]
          },
          "examples": {
            "type": "string",
            "examples": [
              "Hair, nails, beauty, barbershops"
            ]
          },
          "labels": {
            "$ref": "#/components/schemas/CalendarLabels"
          },
          "cta": {
            "type": "string",
            "description": "The Book button's words on its Kards. A calendar whose services all need approval says \"Request a booking\" instead.",
            "examples": [
              "Book appointment"
            ]
          },
          "features": {
            "type": "array",
            "description": "What this kind switches on.",
            "items": {
              "$ref": "#/components/schemas/CalendarFeature"
            }
          },
          "defaults": {
            "type": "object",
            "description": "Its starting booking rules.",
            "required": [
              "min_notice_minutes",
              "horizon_days",
              "slot_step_minutes",
              "cancellation_cutoff_minutes",
              "require_phone",
              "require_email"
            ],
            "properties": {
              "min_notice_minutes": {
                "type": "integer"
              },
              "horizon_days": {
                "type": "integer"
              },
              "slot_step_minutes": {
                "type": "integer"
              },
              "cancellation_cutoff_minutes": {
                "type": "integer"
              },
              "require_phone": {
                "type": "boolean"
              },
              "require_email": {
                "type": "boolean"
              }
            }
          },
          "opening_hours": {
            "$ref": "#/components/schemas/WeeklyHours"
          },
          "currency": {
            "type": "string"
          },
          "starter_offerings": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "starter",
                "name",
                "category",
                "duration_minutes",
                "price_cents",
                "price_mode",
                "needs_price"
              ],
              "properties": {
                "starter": {
                  "type": "integer",
                  "description": "Its number, for `{\"starter\": 1}` in POST /calendars."
                },
                "name": {
                  "type": "string"
                },
                "category": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "duration_minutes": {
                  "type": "integer"
                },
                "price_cents": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "price_mode": {
                  "type": "string",
                  "enum": [
                    "fixed",
                    "from",
                    "free",
                    "hidden"
                  ]
                },
                "needs_price": {
                  "type": "boolean",
                  "description": "It shows a price, but has none in this currency yet."
                }
              }
            }
          }
        }
      },
      "CalendarSetupInput": {
        "type": "object",
        "required": [
          "preset"
        ],
        "properties": {
          "organization": {
            "type": "string",
            "description": "An organization's slug, to set up its calendar (its admins); the key's own calendar when omitted."
          },
          "preset": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "time_zone": {
            "type": "string",
            "description": "An IANA zone, such as Asia/Kolkata."
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217."
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2; needed to read local phone numbers when the time zone doesn't say."
          },
          "kard": {
            "type": "string",
            "description": "A personal calendar's Kard to book from (a share_link)."
          },
          "team": {
            "type": "array",
            "description": "Organizations: who takes bookings.",
            "items": {
              "type": "object",
              "properties": {
                "kard": {
                  "type": "string",
                  "description": "A team Kard's share_link."
                },
                "name": {
                  "type": "string"
                },
                "phone": {
                  "type": "string"
                },
                "me": {
                  "type": "boolean",
                  "description": "The key's own person."
                }
              }
            },
            "examples": [
              [
                {
                  "kard": "priya"
                },
                {
                  "name": "Rahul"
                },
                {
                  "me": true
                }
              ]
            ]
          },
          "opening_hours": {
            "$ref": "#/components/schemas/WeeklyHoursInput"
          },
          "offerings": {
            "description": "\"starters\" for the kind's starter menu, or rows (a row with `starter` starts from that one).",
            "oneOf": [
              {
                "const": "starters"
              },
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "starter": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "duration_minutes": {
                      "type": "integer"
                    },
                    "price_cents": {
                      "type": "integer"
                    },
                    "price_mode": {
                      "type": "string",
                      "enum": [
                        "fixed",
                        "from",
                        "free",
                        "hidden"
                      ]
                    }
                  }
                }
              }
            ]
          },
          "accepting_bookings": {
            "type": "boolean",
            "description": "false keeps online booking off after setup."
          }
        }
      },
      "CalendarSettings": {
        "type": "object",
        "required": [
          "name",
          "preset",
          "kind",
          "labels",
          "time_zone",
          "country",
          "currency",
          "address",
          "accepting_bookings",
          "live",
          "min_notice_minutes",
          "horizon_days",
          "slot_step_minutes",
          "max_upcoming_per_client",
          "require_phone",
          "require_email",
          "cancellation_cutoff_minutes",
          "policy_text",
          "reminder_24h",
          "reminder_2h",
          "reminder_note",
          "notify_owner_online_bookings",
          "digest_minute",
          "digest_time",
          "waitlist",
          "kard_books_owner_only",
          "owner_kard_offers_choice",
          "opening_hours",
          "opening_hours_summary",
          "feed_url"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "preset": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "kind": {
            "type": "string",
            "examples": [
              "Salon, barber, nails & beauty"
            ]
          },
          "labels": {
            "$ref": "#/components/schemas/CalendarLabels"
          },
          "time_zone": {
            "type": "string"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "accepting_bookings": {
            "type": "boolean",
            "description": "The live switch for online booking."
          },
          "live": {
            "type": "object",
            "required": [
              "bookable_online",
              "kards",
              "kards_showing_book"
            ],
            "properties": {
              "bookable_online": {
                "type": "boolean",
                "description": "There's something clients can book online."
              },
              "kards": {
                "type": "integer"
              },
              "kards_showing_book": {
                "type": "integer"
              }
            }
          },
          "min_notice_minutes": {
            "type": "integer",
            "description": "How soon before a visit clients can book it."
          },
          "horizon_days": {
            "type": "integer",
            "description": "How far ahead clients can book."
          },
          "slot_step_minutes": {
            "type": "integer",
            "description": "Times start every so many minutes."
          },
          "max_upcoming_per_client": {
            "type": "integer"
          },
          "require_phone": {
            "type": "boolean"
          },
          "require_email": {
            "type": "boolean"
          },
          "cancellation_cutoff_minutes": {
            "type": "integer",
            "description": "Until how long before a visit clients can cancel or move it online."
          },
          "policy_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "reminder_24h": {
            "type": "boolean"
          },
          "reminder_2h": {
            "type": "boolean"
          },
          "reminder_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Added to the reminders."
          },
          "notify_owner_online_bookings": {
            "type": "boolean",
            "description": "Email the owner each online booking."
          },
          "digest_minute": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The morning summary's time, in minutes after local midnight; null for none."
          },
          "digest_time": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "08:00"
            ]
          },
          "waitlist": {
            "type": "boolean",
            "description": "\"Join the waitlist\" when a day is full, and freed time offered to the people waiting (on by default where there is a front desk)."
          },
          "kard_books_owner_only": {
            "type": "boolean",
            "description": "A personal calendar: \"Clients book only me from my Kard\". Off (the default), once two or more people take online bookings, the owner's own Kard offers \"Anyone free\" and each person, as a team's front door does. A team Kard always books its own person."
          },
          "owner_kard_offers_choice": {
            "type": "boolean",
            "description": "Whether the owner's own Kard offers that choice now (a personal calendar, two or more people taking online bookings, and kard_books_owner_only off)."
          },
          "opening_hours": {
            "description": "The business's hours; null on a personal calendar (its hours are its person's).",
            "oneOf": [
              {
                "$ref": "#/components/schemas/WeeklyHours"
              },
              {
                "type": "null"
              }
            ]
          },
          "opening_hours_summary": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Mon–Sat 10:00–19:00"
            ]
          },
          "feed_url": {
            "type": "string",
            "format": "uri",
            "description": "Every booking, for Google, Apple or Outlook. Private."
          }
        }
      },
      "CalendarSettingsInput": {
        "type": "object",
        "description": "Any of these; the rest stay.",
        "properties": {
          "accepting_bookings": {
            "type": "boolean"
          },
          "min_notice_minutes": {
            "type": "integer"
          },
          "horizon_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "slot_step_minutes": {
            "type": "integer"
          },
          "max_upcoming_per_client": {
            "type": "integer"
          },
          "require_phone": {
            "type": "boolean"
          },
          "require_email": {
            "type": "boolean"
          },
          "cancellation_cutoff_minutes": {
            "type": "integer"
          },
          "policy_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "reminder_24h": {
            "type": "boolean"
          },
          "reminder_2h": {
            "type": "boolean"
          },
          "reminder_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "notify_owner_online_bookings": {
            "type": "boolean"
          },
          "waitlist": {
            "type": "boolean"
          },
          "kard_books_owner_only": {
            "type": "boolean",
            "description": "A personal calendar: true keeps the owner's own Kard booking only them (\"Clients book only me from my Kard\")."
          },
          "digest_time": {
            "type": [
              "string",
              "null"
            ],
            "description": "The morning summary's local time, like \"08:00\"; null for none."
          },
          "digest_minute": {
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "time_zone": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "Prices keep their numbers in the new currency (500 stays 500)."
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "preset": {
            "$ref": "#/components/schemas/CalendarPreset"
          },
          "opening_hours": {
            "$ref": "#/components/schemas/WeeklyHoursInput"
          }
        }
      },
      "FeedLink": {
        "type": "object",
        "required": [
          "feed_url",
          "message"
        ],
        "properties": {
          "feed_url": {
            "type": "string",
            "format": "uri"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ShareKit": {
        "type": "object",
        "required": [
          "booking_url",
          "front_door",
          "accepting_bookings",
          "bookable_online",
          "kards_showing_book",
          "team_links",
          "whatsapp_url",
          "qr",
          "website",
          "booking_links"
        ],
        "properties": {
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The booking page of the calendar's main Kard."
          },
          "front_door": {
            "description": "The Kard whose booking page books the whole calendar.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "accepting_bookings": {
            "type": "boolean"
          },
          "bookable_online": {
            "type": "boolean"
          },
          "kards_showing_book": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "share_link",
                "name",
                "booking_url",
                "book_label"
              ],
              "properties": {
                "share_link": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "booking_url": {
                  "type": "string",
                  "format": "uri"
                },
                "book_label": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "team_links": {
            "type": "array",
            "description": "For a team of several, links that book one person.",
            "items": {
              "type": "object",
              "required": [
                "provider",
                "share_link",
                "booking_url"
              ],
              "properties": {
                "provider": {
                  "$ref": "#/components/schemas/NamedRecord"
                },
                "share_link": {
                  "type": "string"
                },
                "booking_url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "whatsapp_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Opens WhatsApp with a message carrying the link."
          },
          "qr": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "url",
                  "png"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "png": {
                    "type": "string",
                    "description": "The QR code to print, as a data URL."
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "website": {
            "description": "HTML snippets for a website.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "inline",
                  "popup"
                ],
                "properties": {
                  "inline": {
                    "type": "string",
                    "description": "The booking page inside the website."
                  },
                  "popup": {
                    "type": "string",
                    "description": "A button that opens it."
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "booking_links": {
            "type": "array",
            "description": "The latest 20 single-use links.",
            "items": {
              "$ref": "#/components/schemas/BookingLink"
            }
          }
        }
      },
      "BookingLink": {
        "type": "object",
        "required": [
          "id",
          "url",
          "title",
          "label",
          "offering",
          "provider",
          "max_uses",
          "uses_count",
          "uses_left",
          "expires_at",
          "usable",
          "status",
          "created_at",
          "created_by"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Send it to the client. Null until the calendar has a Kard to book from."
          },
          "title": {
            "type": "string",
            "examples": [
              "Rahul, monthly trim"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "offering": {
            "description": "What it books; anything on the menu when null.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider": {
            "description": "Who with; anyone when null.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_uses": {
            "type": "integer"
          },
          "uses_count": {
            "type": "integer"
          },
          "uses_left": {
            "type": "integer"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usable": {
            "type": "boolean",
            "description": "Someone can book through it right now."
          },
          "status": {
            "type": "string",
            "examples": [
              "used 0 of 1 · works until Sun 13 Jan, 11:59 PM"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BookingLinkInput": {
        "type": "object",
        "properties": {
          "offering_id": {
            "type": "integer",
            "description": "What it books; anything on the menu when omitted."
          },
          "provider_id": {
            "type": "integer",
            "description": "Who with; anyone when omitted."
          },
          "label": {
            "type": "string",
            "maxLength": 100,
            "description": "Who it's for, to recognise it later."
          },
          "max_uses": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 1
          },
          "expires_in_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "description": "It works through the end of that local day; never expires when omitted."
          }
        }
      },
      "WaitlistEntry": {
        "type": "object",
        "required": [
          "id",
          "status",
          "source",
          "client",
          "reach",
          "reached_by",
          "offerings",
          "provider",
          "duration_minutes",
          "dates",
          "day_parts",
          "any_time",
          "time_zone",
          "wish",
          "note",
          "joined_at",
          "closed_at",
          "closed_by",
          "booking_id",
          "offers"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting",
              "booked",
              "removed",
              "expired"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "online",
              "front_desk",
              "api"
            ]
          },
          "client": {
            "$ref": "#/components/schemas/NamedClient"
          },
          "reach": {
            "type": "object",
            "description": "Where this entry hears (an online entry's is what its visitor typed).",
            "required": [
              "name",
              "phone",
              "email",
              "email_held"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email_held": {
                "type": "boolean",
                "description": "Emails wait until the calendar's owner verifies their email address."
              }
            }
          },
          "reached_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "How an offer reaches them: `email`, sent by itself; `whatsapp`, sent by the business from its own phone; null, nothing reaches them.",
            "enum": [
              "email",
              "whatsapp",
              null
            ]
          },
          "offerings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamedRecord"
            }
          },
          "provider": {
            "description": "null for anyone who does it.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dates": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date"
            }
          },
          "day_parts": {
            "type": "array",
            "description": "Empty for any time.",
            "items": {
              "type": "string",
              "enum": [
                "morning",
                "afternoon",
                "evening"
              ]
            }
          },
          "any_time": {
            "type": "boolean"
          },
          "time_zone": {
            "type": "string",
            "examples": [
              "Asia/Kolkata"
            ]
          },
          "wish": {
            "type": "string",
            "examples": [
              "Thu 10 or Fri 11 Jan, mornings"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "closed_by": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "client",
              "business",
              null
            ]
          },
          "booking_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WaitlistOffer"
            }
          }
        }
      },
      "WaitlistOffer": {
        "type": "object",
        "required": [
          "id",
          "source",
          "state",
          "starts_at",
          "ends_at",
          "local_starts_at",
          "provider",
          "emailed_at",
          "whatsapp_at",
          "opened_at",
          "booking_id",
          "url",
          "whatsapp_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "source": {
            "type": "string",
            "description": "`freed`: offered by the calendar when the time freed up; `desk`: by a person.",
            "enum": [
              "freed",
              "desk"
            ]
          },
          "state": {
            "type": "string",
            "description": "What became of it, as the desk shows it: `sent` (emailed or sent on WhatsApp), `to_send` (nothing sent and no email reaches them: send it on WhatsApp), `unsent` (made with `send: none`), `booked` (booked through it, or by its client another way), `taken` (someone else booked the time), `blocked` (blocked time, a break, time off or a closure covers it now), `passed`.",
            "enum": [
              "sent",
              "to_send",
              "unsent",
              "booked",
              "taken",
              "blocked",
              "passed"
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider": {
            "$ref": "#/components/schemas/NamedRecord"
          },
          "emailed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "whatsapp_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "opened_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "booking_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Booked through this offer."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Opens the time on the booking page, ready to confirm. Private to them."
          },
          "whatsapp_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "wa.me with the message and the link typed; null without a phone number."
          }
        }
      },
      "WaitlistFreeTime": {
        "type": "object",
        "required": [
          "starts_at",
          "ends_at",
          "local_starts_at",
          "provider"
        ],
        "properties": {
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "provider": {
            "$ref": "#/components/schemas/NamedRecord"
          }
        }
      },
      "WaitlistEntryInput": {
        "type": "object",
        "required": [
          "offering_ids",
          "dates"
        ],
        "properties": {
          "client_id": {
            "type": "integer"
          },
          "client": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "offering_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "provider_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dates": {
            "type": "array",
            "maxItems": 14,
            "items": {
              "type": "string",
              "format": "date"
            }
          },
          "day_parts": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "morning",
                "afternoon",
                "evening"
              ]
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CalendarBlock": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "whole_calendar",
          "provider",
          "starts_at",
          "ends_at",
          "local_from",
          "local_to",
          "all_day",
          "note",
          "summary"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "description": "`closed`: the whole business.",
            "enum": [
              "break",
              "time_off",
              "blocked",
              "closed"
            ]
          },
          "whole_calendar": {
            "type": "boolean"
          },
          "provider": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_from": {
            "type": "string",
            "format": "date-time"
          },
          "local_to": {
            "type": "string",
            "format": "date-time"
          },
          "all_day": {
            "type": "boolean",
            "description": "From local midnight to local midnight."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string",
            "examples": [
              "Wed 9 Jan, 17:00–18:00 (blocked)"
            ]
          }
        }
      },
      "CalendarBlockInput": {
        "type": "object",
        "properties": {
          "idempotency_key": {
            "type": "string",
            "maxLength": 100,
            "description": "On create: your key for this one. Sending it again answers 200 with the first, nothing made twice (a retry after a lost answer)."
          },
          "provider_id": {
            "description": "One person; omitted or \"all\" closes the whole business.",
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "const": "all"
              }
            ]
          },
          "kind": {
            "type": "string",
            "description": "For one person; a closure is always `closed`.",
            "enum": [
              "break",
              "blocked",
              "time_off"
            ],
            "default": "blocked"
          },
          "note": {
            "type": "string",
            "examples": [
              "Product training",
              "Closed for Diwali"
            ]
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "The local date; today when omitted."
          },
          "time": {
            "type": "string",
            "description": "The local start, like \"15:30\"; the next quarter hour when omitted."
          },
          "duration": {
            "description": "Minutes (5 to 1440), or \"rest\" for the rest of the day; 60 when omitted.",
            "oneOf": [
              {
                "type": "integer",
                "minimum": 5,
                "maximum": 1440
              },
              {
                "const": "rest"
              }
            ]
          },
          "until": {
            "type": "string",
            "description": "A local end time that day, like \"17:00\", instead of `duration`."
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "description": "With `ends_at`, instead of the local choices."
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MoveInput": {
        "type": "object",
        "required": [
          "direction"
        ],
        "properties": {
          "direction": {
            "type": "string",
            "enum": [
              "up",
              "down"
            ]
          }
        }
      },
      "OfferingQuestion": {
        "type": "object",
        "required": [
          "key",
          "label",
          "kind",
          "required"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Answers are stored by it; send it back to keep a question."
          },
          "label": {
            "type": "string",
            "examples": [
              "Any allergies?"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "select",
              "checkbox"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "description": "A select question's choices.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MenuOffering": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "category",
          "description",
          "active",
          "position",
          "duration_minutes",
          "duration_options",
          "duration_choices",
          "buffer_before_minutes",
          "buffer_after_minutes",
          "processing_offset_minutes",
          "processing_minutes",
          "price_cents",
          "price_mode",
          "price",
          "currency",
          "advance_cents",
          "location_kind",
          "location_details",
          "confirmation_note",
          "visibility",
          "requires_approval",
          "min_notice_minutes",
          "horizon_days",
          "slot_step_minutes",
          "daily_cap",
          "questions",
          "providers",
          "booking_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean",
            "description": "Switched on (on the booking page, unless it's internal)."
          },
          "position": {
            "type": "integer"
          },
          "duration_minutes": {
            "type": "integer"
          },
          "duration_options": {
            "type": "array",
            "description": "The other lengths a client may pick.",
            "items": {
              "type": "integer"
            }
          },
          "duration_choices": {
            "type": "array",
            "description": "Every length, the default first.",
            "items": {
              "type": "integer"
            }
          },
          "buffer_before_minutes": {
            "type": "integer",
            "description": "Prep time before."
          },
          "buffer_after_minutes": {
            "type": "integer",
            "description": "Cleanup time after."
          },
          "processing_offset_minutes": {
            "type": "integer",
            "description": "When the processing window starts, from the visit's start."
          },
          "processing_minutes": {
            "type": "integer",
            "description": "A window inside the visit when the person is free (colour developing); 0 for none."
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "from",
              "free",
              "hidden"
            ]
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "As clients see it.",
            "examples": [
              "From ₹1,200"
            ]
          },
          "currency": {
            "type": "string"
          },
          "advance_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The advance a client is asked for when booking."
          },
          "location_kind": {
            "type": "string",
            "enum": [
              "at_business",
              "at_client",
              "phone",
              "video",
              "custom"
            ]
          },
          "location_details": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "In the client's confirmation."
          },
          "visibility": {
            "type": "string",
            "description": "`public`: on the booking page; `unlisted`: bookable only by its link; `internal`: the front desk only.",
            "enum": [
              "public",
              "unlisted",
              "internal"
            ]
          },
          "requires_approval": {
            "type": "boolean",
            "description": "A request the business approves, rather than an instant booking."
          },
          "min_notice_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for the calendar's rule."
          },
          "horizon_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for the calendar's rule."
          },
          "slot_step_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null for the calendar's rule."
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Most bookings of it in a day; null for no limit."
          },
          "questions": {
            "type": "array",
            "description": "Asked when booking (up to 5).",
            "items": {
              "$ref": "#/components/schemas/OfferingQuestion"
            }
          },
          "providers": {
            "type": "array",
            "description": "Who performs it, with their own price and length (null for the offering's).",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "price_cents",
                "duration_minutes",
                "price"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "price_cents": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "duration_minutes": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "price": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "booking_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Its own page on the business's booking link, while a client can reach it (switched on, not internal, online booking live)."
          },
          "upcoming_bookings": {
            "type": "integer",
            "description": "One offering (GET …/offerings/{id}) only."
          },
          "recent_bookings": {
            "type": "integer",
            "description": "In the last 90 days; one offering only."
          },
          "has_bookings": {
            "type": "boolean",
            "description": "Then it can be switched off, but not deleted; one offering only."
          }
        }
      },
      "MenuOfferingEnvelope": {
        "type": "object",
        "required": [
          "offering"
        ],
        "properties": {
          "offering": {
            "$ref": "#/components/schemas/MenuOffering"
          },
          "message": {
            "type": "string",
            "description": "After switching it off or on.",
            "examples": [
              "Blow-dry is off: it's no longer on your booking page."
            ]
          }
        }
      },
      "OfferingInput": {
        "type": "object",
        "description": "Any of these; `null` clears one.",
        "properties": {
          "name": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": "integer",
            "description": "Steps of 5, up to 12 hours."
          },
          "duration_options": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "buffer_before_minutes": {
            "type": "integer"
          },
          "buffer_after_minutes": {
            "type": "integer"
          },
          "processing_offset_minutes": {
            "type": "integer",
            "description": "After the start; the window must end within every person's length."
          },
          "processing_minutes": {
            "type": "integer",
            "description": "0 turns processing off."
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Needed for `fixed` and `from`."
          },
          "price_mode": {
            "type": "string",
            "enum": [
              "fixed",
              "from",
              "free",
              "hidden"
            ]
          },
          "advance_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "location_kind": {
            "type": "string",
            "enum": [
              "at_business",
              "at_client",
              "phone",
              "video",
              "custom"
            ]
          },
          "location_details": {
            "type": [
              "string",
              "null"
            ]
          },
          "confirmation_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "unlisted",
              "internal"
            ]
          },
          "requires_approval": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean",
            "description": "false switches it off; true back on."
          },
          "min_notice_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "horizon_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "slot_step_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ]
          },
          "questions": {
            "type": "array",
            "maxItems": 5,
            "description": "Replaces the whole list; select questions need `options`.",
            "items": {
              "type": "object",
              "required": [
                "label",
                "kind",
                "required"
              ],
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "text",
                    "textarea",
                    "select",
                    "checkbox"
                  ]
                },
                "required": {
                  "type": "boolean"
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "providers": {
            "type": "array",
            "description": "Who performs it, replacing the whole list; everyone on the team when omitted on create.",
            "items": {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "price_cents": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "duration_minutes": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "MenuImport": {
        "type": "object",
        "required": [
          "id",
          "status",
          "source_kind",
          "source_filename",
          "source_url",
          "has_source",
          "created_at",
          "expires_at",
          "stalled",
          "read_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "reading",
              "ready",
              "failed",
              "confirmed",
              "discarded",
              "expired"
            ]
          },
          "source_kind": {
            "type": "string",
            "description": "`url` until the link is fetched.",
            "enum": [
              "text",
              "photo",
              "pdf",
              "url"
            ]
          },
          "source_filename": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_source": {
            "type": "boolean",
            "description": "Its photo or PDF can be fetched (GET …/source)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "stalled": {
            "type": "boolean",
            "description": "A read that died; start again."
          },
          "read_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": "object",
            "description": "Failed or stalled, in the web's words.",
            "required": [
              "code",
              "title",
              "message",
              "detail"
            ],
            "properties": {
              "code": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "unreadable",
                  "unreadable_file",
                  "download_failed",
                  "budget",
                  "provider",
                  "stalled",
                  null
                ]
              },
              "title": {
                "type": "string"
              },
              "message": {
                "type": "string",
                "description": "What happened and what to do next."
              },
              "detail": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "added_count": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Confirmed only."
          },
          "confirmed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rows": {
            "type": "array",
            "description": "Ready, one import only.",
            "items": {
              "$ref": "#/components/schemas/MenuImportRow"
            }
          },
          "summary": {
            "type": "object",
            "required": [
              "found",
              "included",
              "guessed",
              "attention",
              "duplicates",
              "no_price",
              "categories"
            ],
            "properties": {
              "found": {
                "type": "integer"
              },
              "included": {
                "type": "integer"
              },
              "guessed": {
                "type": "integer"
              },
              "attention": {
                "type": "integer"
              },
              "duplicates": {
                "type": "integer"
              },
              "no_price": {
                "type": "integer"
              },
              "categories": {
                "type": "integer"
              }
            }
          },
          "currency": {
            "type": "string"
          },
          "detected_currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "When the list's prices are in another currency; amounts are copied as written."
          }
        }
      },
      "MenuImportRow": {
        "type": "object",
        "required": [
          "key",
          "included",
          "name",
          "category",
          "duration_minutes",
          "duration_guessed",
          "price_cents",
          "price_mode",
          "price_missing",
          "price_text",
          "attention",
          "note",
          "duplicate",
          "duplicate_name"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "included": {
            "type": "boolean",
            "description": "The draft's choice."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration_guessed": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Not on the list; check it."
          },
          "price_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "price_mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_missing": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "price_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "As written."
          },
          "attention": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Something to check (`note` says what)."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "duplicate": {
            "type": [
              "string",
              "null"
            ],
            "description": "`menu`: already on the menu; `list`: twice on the list. Left out by default.",
            "enum": [
              "menu",
              "list",
              null
            ]
          },
          "duplicate_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MenuImportEnvelope": {
        "type": "object",
        "required": [
          "menu_import"
        ],
        "properties": {
          "menu_import": {
            "$ref": "#/components/schemas/MenuImport"
          }
        }
      },
      "LoginStatus": {
        "type": "string",
        "description": "`joined`: has a login; `admin`: an admin's account; `invited` / `invite_expired`: an open invitation; `none`.",
        "enum": [
          "joined",
          "admin",
          "invited",
          "invite_expired",
          "none"
        ]
      },
      "TeamProvider": {
        "type": "object",
        "required": [
          "id",
          "name",
          "first_name",
          "title",
          "phone",
          "email",
          "color",
          "active",
          "bookable_online",
          "takes_online_bookings",
          "daily_cap",
          "position",
          "yours",
          "kard",
          "hours_summary",
          "offerings"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": "string",
            "enum": [
              "clay",
              "amber",
              "ochre",
              "olive",
              "sage",
              "teal",
              "sky",
              "indigo",
              "plum",
              "rose"
            ]
          },
          "active": {
            "type": "boolean",
            "description": "On the team (switched on)."
          },
          "bookable_online": {
            "type": "boolean",
            "description": "The switch for clients picking them online."
          },
          "takes_online_bookings": {
            "type": "boolean",
            "description": "Switched on, active, and doing something on the booking page."
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Most online bookings in a day; null for no limit."
          },
          "position": {
            "type": "integer"
          },
          "yours": {
            "type": "boolean",
            "description": "It's the key's own person."
          },
          "kard": {
            "description": "The Kard showing \"Book with …\" for them.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "share_link",
                  "name",
                  "url"
                ],
                "properties": {
                  "share_link": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "hours_summary": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Mon–Fri 09:00–18:00"
            ]
          },
          "offerings": {
            "type": "array",
            "description": "What they do, with their own price and minutes (null for the menu's).",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "active",
                "price_cents",
                "duration_minutes",
                "price",
                "duration"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "active": {
                  "type": "boolean"
                },
                "price_cents": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "duration_minutes": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "price": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "duration": {
                  "type": "string",
                  "examples": [
                    "1 hr 30 min"
                  ]
                }
              }
            }
          },
          "login": {
            "description": "Admins only: where their login stands; null on a personal calendar.",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "status",
                  "role",
                  "email",
                  "invitation"
                ],
                "properties": {
                  "status": {
                    "$ref": "#/components/schemas/LoginStatus"
                  },
                  "role": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "admin",
                      "front_desk",
                      "staff",
                      null
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "invitation": {
                    "oneOf": [
                      {
                        "type": "object",
                        "required": [
                          "id",
                          "email",
                          "role",
                          "status",
                          "expires_at"
                        ],
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "email": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "front_desk",
                              "staff"
                            ]
                          },
                          "status": {
                            "$ref": "#/components/schemas/InvitationStatus"
                          },
                          "expires_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TeamProviderDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TeamProvider"
          },
          {
            "type": "object",
            "required": [
              "weekly_hours",
              "special_days",
              "time_off",
              "links"
            ],
            "properties": {
              "weekly_hours": {
                "$ref": "#/components/schemas/WeeklyHours"
              },
              "special_days": {
                "type": "array",
                "description": "Upcoming.",
                "items": {
                  "$ref": "#/components/schemas/SpecialDay"
                }
              },
              "time_off": {
                "type": "array",
                "description": "Upcoming.",
                "items": {
                  "$ref": "#/components/schemas/TimeOff"
                }
              },
              "links": {
                "type": "object",
                "description": "Private: anyone with them sees this person's bookings.",
                "required": [
                  "my_day_url",
                  "feed_url"
                ],
                "properties": {
                  "my_day_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Their day on a phone, read-only, no login."
                  },
                  "feed_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Their bookings, for Google, Apple or Outlook."
                  }
                }
              }
            }
          }
        ]
      },
      "SuggestedKard": {
        "type": "object",
        "required": [
          "share_link",
          "name",
          "title",
          "url"
        ],
        "properties": {
          "share_link": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ProviderInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "color": {
            "type": "string",
            "enum": [
              "clay",
              "amber",
              "ochre",
              "olive",
              "sage",
              "teal",
              "sky",
              "indigo",
              "plum",
              "rose"
            ]
          },
          "kard": {
            "type": [
              "string",
              "null"
            ],
            "description": "A team Kard's share_link; null unlinks it."
          },
          "bookable_online": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean",
            "description": "false switches them off."
          },
          "daily_cap": {
            "type": [
              "integer",
              "null"
            ]
          },
          "offering_ids": {
            "type": "array",
            "description": "What they do (replaces the list).",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "ProviderHours": {
        "type": "object",
        "required": [
          "weekly_hours",
          "summary",
          "bookable_online",
          "takes_online_bookings",
          "opening_hours",
          "opening_hours_summary",
          "time_zone"
        ],
        "properties": {
          "weekly_hours": {
            "$ref": "#/components/schemas/WeeklyHours"
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "In words, on the reader's clock (`Hour-Cycle`).",
            "examples": [
              "Mon–Sat 10:00 AM–7:00 PM",
              "Mon–Sat 10:00–19:00"
            ]
          },
          "bookable_online": {
            "type": "boolean"
          },
          "takes_online_bookings": {
            "type": "boolean"
          },
          "opening_hours": {
            "$ref": "#/components/schemas/WeeklyHours"
          },
          "opening_hours_summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "The business's opening hours in words, on the reader's clock (`Hour-Cycle`).",
            "examples": [
              "Mon–Sat 10:00 AM–7:00 PM",
              "Mon–Sat 10:00–19:00"
            ]
          },
          "time_zone": {
            "type": "string"
          }
        }
      },
      "SpecialDay": {
        "type": "object",
        "required": [
          "id",
          "date",
          "day_off",
          "hours",
          "note",
          "summary"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "day_off": {
            "type": "boolean"
          },
          "hours": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string",
            "description": "The hours in words, on the reader's clock (`Hour-Cycle`).",
            "examples": [
              "12:00–7:00 PM",
              "12:00–19:00",
              "day off"
            ]
          }
        }
      },
      "SpecialDayInput": {
        "type": "object",
        "required": [
          "date"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "hours": {
            "$ref": "#/components/schemas/HoursIntervals"
          },
          "day_off": {
            "type": "boolean"
          },
          "note": {
            "type": "string",
            "examples": [
              "Late shift"
            ]
          }
        }
      },
      "TimeOff": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "starts_at",
          "ends_at",
          "local_from",
          "local_to",
          "all_day",
          "note",
          "summary",
          "bookings_to_move"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "time_off",
              "break",
              "blocked"
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time"
          },
          "local_from": {
            "type": "string",
            "format": "date-time"
          },
          "local_to": {
            "type": "string",
            "format": "date-time"
          },
          "all_day": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary": {
            "type": "string",
            "description": "In words, on the reader's clock (`Hour-Cycle`).",
            "examples": [
              "Mon 14 Jan – Fri 18 Jan (time off)",
              "Tue 15 Jan, 1:00–2:00 PM (break)",
              "Tue 15 Jan, 13:00–14:00 (break)"
            ]
          },
          "bookings_to_move": {
            "type": "integer",
            "description": "Upcoming bookings with this person inside it."
          }
        }
      },
      "TimeOffInput": {
        "type": "object",
        "required": [
          "starts_on"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "time_off",
              "break",
              "blocked"
            ],
            "default": "time_off"
          },
          "starts_on": {
            "type": "string",
            "format": "date"
          },
          "ends_on": {
            "type": "string",
            "format": "date",
            "description": "The same day when omitted."
          },
          "all_day": {
            "type": "boolean",
            "description": "All day unless times are given."
          },
          "start_time": {
            "type": "string",
            "examples": [
              "13:00"
            ]
          },
          "end_time": {
            "type": "string",
            "examples": [
              "14:00"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "LoginPerson": {
        "type": "object",
        "required": [
          "name",
          "email"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "CalendarLogin": {
        "type": "object",
        "required": [
          "id",
          "role",
          "user",
          "provider"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "For DELETE …/logins/{id}."
          },
          "role": {
            "type": "string",
            "enum": [
              "front_desk",
              "staff"
            ]
          },
          "user": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/LoginPerson"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider": {
            "description": "The team member it signs in as, if any.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "InvitationStatus": {
        "type": "string",
        "enum": [
          "pending",
          "expired",
          "accepted",
          "revoked"
        ]
      },
      "StaffInvitation": {
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "provider",
          "status",
          "expires_at",
          "last_sent_at",
          "reminded_at",
          "reminder_due_at",
          "invited_by",
          "accept_url",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "front_desk",
              "staff"
            ]
          },
          "provider": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/NamedRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminded_at": {
            "description": "When its one reminder email went (still unanswered 3 days after the last send); null until then.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reminder_due_at": {
            "description": "When its one reminder goes if they haven't joined by then; null once it has gone, for one used or cancelled, when the link stops working first, or for an address Apple stopped forwarding to (not emailed).",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "invited_by": {
            "description": "Who sent it, or null once their account is gone. `id` is their account (`GET /me`'s `account.id`: yours when you sent it).",
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "accept_url": {
            "description": "The link the invitation email carries, to send another way (the web's \"Copy the invitation link\", for an address Apple won't forward to). It works only for the invited account. Only in the answer to sending it (invite, resend), while it's pending; null everywhere else (a list never hands out links).",
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookEvent": {
        "type": "string",
        "enum": [
          "booking.created",
          "booking.rescheduled",
          "booking.cancelled",
          "booking.status_changed"
        ]
      },
      "CalendarWebhook": {
        "type": "object",
        "required": [
          "id",
          "url",
          "host",
          "events",
          "secret",
          "enabled",
          "disabled_at",
          "disabled_reason",
          "consecutive_failures",
          "last_attempted_at",
          "last_delivered_at",
          "last_status_code",
          "last_error",
          "test",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "host": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "secret": {
            "type": "string",
            "description": "The `whsec_` signing secret (see the `booking` webhook)."
          },
          "enabled": {
            "type": "boolean"
          },
          "disabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was switched off (after failing again and again)."
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "last_attempted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "test": {
            "type": "object",
            "description": "The latest test.",
            "required": [
              "state",
              "requested_at",
              "tested_at",
              "status_code",
              "duration_ms",
              "error"
            ],
            "properties": {
              "state": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "sending",
                  "stalled",
                  "delivered",
                  "failed",
                  null
                ]
              },
              "requested_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "tested_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "status_code": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "duration_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "error": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "A public https:// address."
          },
          "events": {
            "type": "array",
            "description": "Every event when omitted or empty.",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            }
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ClientImportInput": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "csv",
              "contacts"
            ],
            "default": "csv"
          },
          "csv": {
            "type": "string",
            "description": "The spreadsheet's text (or upload it as `file`)."
          },
          "mapping": {
            "type": "array",
            "description": "What each column is, in order (else guessed from the headings).",
            "items": {
              "type": "string",
              "enum": [
                "name",
                "first_name",
                "last_name",
                "phone",
                "email",
                "notes",
                "skip"
              ]
            }
          },
          "country": {
            "type": "string",
            "description": "Reads local phone numbers; the calendar's country when omitted."
          },
          "kard_ids": {
            "type": "array",
            "description": "`contacts`: the Kards whose contacts to import; all of them when omitted.",
            "items": {
              "type": "integer"
            }
          },
          "dry_run": {
            "type": "boolean",
            "description": "Preview only; nothing is imported."
          }
        }
      },
      "ClientImportPreview": {
        "type": "object",
        "required": [
          "source",
          "counts",
          "rows",
          "rows_total",
          "problems",
          "too_many_rows"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "csv",
              "contacts"
            ]
          },
          "headings": {
            "type": "array",
            "description": "csv",
            "items": {
              "type": "string"
            }
          },
          "mapping": {
            "type": "array",
            "description": "csv",
            "items": {
              "type": "string"
            }
          },
          "mapping_guessed": {
            "type": "boolean",
            "description": "csv"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "kard_ids": {
            "type": "array",
            "description": "contacts",
            "items": {
              "type": "integer"
            }
          },
          "counts": {
            "type": "object",
            "required": [
              "create",
              "update",
              "skip"
            ],
            "properties": {
              "create": {
                "type": "integer"
              },
              "update": {
                "type": "integer"
              },
              "skip": {
                "type": "integer"
              }
            }
          },
          "rows": {
            "type": "array",
            "description": "The first 200 rows.",
            "items": {
              "type": "object",
              "required": [
                "label",
                "action",
                "reason",
                "name",
                "phone",
                "email"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "examples": [
                    "Row 2"
                  ]
                },
                "action": {
                  "type": "string",
                  "description": "`update` fills an existing client's blanks.",
                  "enum": [
                    "create",
                    "update",
                    "skip"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "phone": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "email": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "rows_total": {
            "type": "integer"
          },
          "problems": {
            "type": "array",
            "description": "What still needs choosing before it can run.",
            "items": {
              "type": "string"
            }
          },
          "too_many_rows": {
            "type": "boolean"
          }
        }
      },
      "ClientImportResult": {
        "type": "object",
        "required": [
          "created",
          "updated",
          "skipped"
        ],
        "properties": {
          "created": {
            "type": "integer"
          },
          "updated": {
            "type": "integer"
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "name",
                "reason"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "SyncService": {
        "type": "string",
        "description": "`google`: Google Calendar; `microsoft`: Outlook.",
        "enum": [
          "google",
          "microsoft"
        ]
      },
      "NotificationDevice": {
        "type": "object",
        "description": "A phone or browser that shows the person's Calendar notifications.",
        "required": [
          "id",
          "kind",
          "name",
          "label",
          "notify",
          "notify_leads",
          "current",
          "created_at",
          "last_used_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "description": "`web_push`: a browser (Chrome, Edge, Firefox, Safari, an iPhone's Home Screen app). `fcm`: eKard's own app on an Android phone. `apns`: eKard's own app on an iPhone.",
            "enum": [
              "web_push",
              "fcm",
              "apns"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Chrome on Android",
              "Safari on iPhone"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The app's own name for the phone; `name` shows it."
          },
          "notify": {
            "$ref": "#/components/schemas/NotifyChoice"
          },
          "notify_leads": {
            "type": "boolean",
            "description": "New contacts on the person's kards (a visitor's details, or a card shared back): the app's phones show them, with `event` `new_contact`, `contact_id`, `kard` and, for an organization's kard, `organization`."
          },
          "current": {
            "type": "boolean",
            "description": "The phone of the app session asking."
          },
          "hour_cycle": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "h12",
              "h23",
              null
            ],
            "description": "How this device's notifications write a time (`h12`: \"4:30 PM\", `h23`: \"16:30\"), as its app said; null: the calendar's own clock."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a notification last reached its push service; null until the first."
          }
        }
      },
      "NotificationDeviceList": {
        "type": "object",
        "required": [
          "devices",
          "notify_choices",
          "calendars",
          "turn_on_url"
        ],
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationDevice"
            }
          },
          "notify_choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotifyChoiceOption"
            }
          },
          "calendars": {
            "type": "array",
            "description": "Each calendar the person runs or works in, and what its notifications cover.",
            "items": {
              "$ref": "#/components/schemas/NotifiedCalendar"
            }
          },
          "turn_on_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "NotifyChoiceOption": {
        "type": "object",
        "required": [
          "key",
          "name",
          "description",
          "events"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/NotifyChoice"
          },
          "name": {
            "type": "string",
            "examples": [
              "Everything",
              "Requests and cancellations only"
            ]
          },
          "description": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "new_booking",
                "request",
                "client_cancelled",
                "client_rescheduled",
                "waitlist"
              ]
            }
          }
        }
      },
      "NotifiedCalendar": {
        "type": "object",
        "required": [
          "id",
          "name",
          "role",
          "hears"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "front_desk",
              "staff"
            ]
          },
          "hears": {
            "type": "string",
            "description": "`own_bookings`: a team member's login hears only about bookings with them (`provider`).",
            "enum": [
              "every_booking",
              "own_bookings"
            ]
          },
          "provider": {
            "$ref": "#/components/schemas/NamedRecord"
          }
        }
      },
      "AppDeviceRegistration": {
        "type": "object",
        "required": [
          "device"
        ],
        "properties": {
          "device": {
            "type": "object",
            "required": [
              "kind",
              "endpoint"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "description": "`fcm` from the Android app, `apns` from the iPhone app.",
                "enum": [
                  "fcm",
                  "apns"
                ]
              },
              "endpoint": {
                "type": "string",
                "description": "`fcm`: the app's Firebase installation ID (22 characters, the first c, d, e or f), or an FCM registration token. `apns`: the device token from `didRegisterForRemoteNotificationsWithDeviceToken`, as lower-case hex (64 characters today; up to 200 are taken)."
              },
              "environment": {
                "type": "string",
                "description": "`apns` only, and needed there: `sandbox` for a build run from Xcode, `production` for TestFlight and the App Store. Apple's tokens work in one environment only.",
                "enum": [
                  "sandbox",
                  "production"
                ]
              },
              "notify": {
                "$ref": "#/components/schemas/NotifyChoice"
              },
              "notify_leads": {
                "type": "boolean",
                "default": true
              },
              "label": {
                "type": "string",
                "maxLength": 60,
                "description": "How lists name the phone, such as \"eKard app on Pixel 7a\". Default: the app and the device name it signed in with."
              },
              "hour_cycle": {
                "type": "string",
                "enum": [
                  "12",
                  "24",
                  "h11",
                  "h12",
                  "h23",
                  "h24"
                ],
                "description": "How the phone writes a time, as the `Hour-Cycle` header says it (`h12`: \"4:30 PM\", `h23`: \"16:30\"): this device's notifications write their times that way. A push is worded when no request of the app's is in flight, so the header can't reach it. Send it again (here, or with `PATCH /calendar_notifications/{id}`) when the phone's setting changes. Without it, the calendar's own clock."
              }
            }
          }
        }
      },
      "NotificationDeviceUpdate": {
        "type": "object",
        "required": [
          "device"
        ],
        "properties": {
          "device": {
            "type": "object",
            "minProperties": 1,
            "properties": {
              "notify": {
                "$ref": "#/components/schemas/NotifyChoice"
              },
              "notify_leads": {
                "type": "boolean"
              },
              "hour_cycle": {
                "type": "string",
                "enum": [
                  "12",
                  "24",
                  "h11",
                  "h12",
                  "h23",
                  "h24"
                ],
                "description": "How the phone writes a time, as the `Hour-Cycle` header says it (`h12`: \"4:30 PM\", `h23`: \"16:30\"), for when the phone's setting changes: this device's notifications write their times that way from now on."
              }
            }
          }
        }
      },
      "NotificationDeviceEnvelope": {
        "type": "object",
        "required": [
          "device"
        ],
        "properties": {
          "device": {
            "$ref": "#/components/schemas/NotificationDevice"
          }
        }
      },
      "NotificationDeviceSaved": {
        "type": "object",
        "required": [
          "device",
          "message"
        ],
        "properties": {
          "device": {
            "$ref": "#/components/schemas/NotificationDevice"
          },
          "message": {
            "type": "string",
            "examples": [
              "Saved: Chrome on Android shows requests and cancellations only."
            ]
          }
        }
      },
      "NotificationDeviceRemoved": {
        "type": "object",
        "required": [
          "device",
          "message"
        ],
        "properties": {
          "device": {
            "type": "null"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "NotifyChoice": {
        "type": "string",
        "description": "`everything`: new bookings, requests to approve, cancellations and moves, waitlist offers to send on WhatsApp. `requests_and_cancellations`: requests to approve and cancellations only.",
        "enum": [
          "everything",
          "requests_and_cancellations"
        ]
      },
      "CalendarConnection": {
        "type": "object",
        "required": [
          "service",
          "name",
          "account_email",
          "status",
          "checks_busy_times",
          "writes_events",
          "busy_calendar_ids",
          "destination_calendar_id",
          "add_meet_links",
          "invite_clients",
          "calendars",
          "calendars_listed_at",
          "calendar_list_failed",
          "allowed",
          "add_bookings",
          "add_bookings_note",
          "upcoming_not_in_calendar",
          "last_synced_at",
          "last_error",
          "last_error_at"
        ],
        "properties": {
          "service": {
            "$ref": "#/components/schemas/SyncService"
          },
          "name": {
            "type": "string",
            "examples": [
              "Google Calendar"
            ]
          },
          "account_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "`needs_reauth`: connect again at `connect_url`.",
            "enum": [
              "connected",
              "needs_reauth",
              "disconnected"
            ]
          },
          "checks_busy_times": {
            "type": "boolean",
            "description": "Busy times in `busy_calendar_ids` block bookable time."
          },
          "writes_events": {
            "type": "boolean",
            "description": "New bookings are added to `destination_calendar_id`."
          },
          "busy_calendar_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "destination_calendar_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "add_meet_links": {
            "type": "boolean"
          },
          "invite_clients": {
            "type": "boolean"
          },
          "calendars": {
            "type": "array",
            "description": "The account's calendars, to choose from.",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "primary"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            }
          },
          "calendars_listed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "calendar_list_failed": {
            "type": "boolean",
            "description": "The service couldn't list them just now; these are from `calendars_listed_at`."
          },
          "allowed": {
            "type": "object",
            "description": "What the person allowed when connecting (connect again to change it).",
            "required": [
              "busy_times",
              "add_bookings",
              "list_calendars"
            ],
            "properties": {
              "busy_times": {
                "type": "boolean"
              },
              "add_bookings": {
                "type": "boolean"
              },
              "list_calendars": {
                "type": "boolean"
              }
            }
          },
          "add_bookings": {
            "type": "string",
            "description": "Whether new bookings go into it. `on`; `no_calendar_chosen` (set `destination_calendar_id`); `not_allowed` (adding wasn't granted, or the connection predates asking for it: in the browser at `connect_url`, \"Also add bookings to your Google Calendar\" asks for it on top of what's granted); `awaiting_review` (Google hasn't approved asking for it yet).",
            "enum": [
              "on",
              "no_calendar_chosen",
              "not_allowed",
              "awaiting_review"
            ]
          },
          "add_bookings_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "The same in words, with what to do; null when `on`."
          },
          "upcoming_not_in_calendar": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Upcoming bookings not added yet (POST …/add_upcoming adds them); null when it doesn't add bookings."
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_error_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "CalendarSyncInput": {
        "type": "object",
        "properties": {
          "busy_calendar_ids": {
            "type": [
              "array",
              "null"
            ],
            "maxItems": 10,
            "description": "The calendars whose busy times block; [] or null for none.",
            "items": {
              "type": "string"
            }
          },
          "destination_calendar_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where new bookings go; null stops adding them."
          },
          "add_meet_links": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "invite_clients": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      }
    }
  }
}