{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-resources/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab","admonition"]},"type":"markdown"},"seo":{"title":"TOON Format","description":"Bookable is a TMS API gateway API — one integration to access real-time availability and manage bookings across venues on any table management system.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"toon-format","__idx":0},"children":["TOON Format"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TOON"]}," (Terse Object-Oriented Notation) is a compact data serialization format supported by the Bookings API. It is designed to reduce token count when feeding API responses into Large Language Models — typically achieving a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["30–60% reduction"]}," compared to JSON by stripping syntactic noise (braces, quotes, colons, commas) while preserving the full data structure."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TOON responses are opt-in and fully backwards compatible. Standard JSON remains the default."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"when-to-use-toon","__idx":1},"children":["When to use TOON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TOON is most useful when:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Passing API responses directly into an LLM prompt or context window"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Reducing inference costs by keeping token counts low"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Building AI-powered booking assistants or search features on top of the Bookings API"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For all other integrations, JSON is recommended."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-to-request-toon","__idx":2},"children":["How to request TOON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Accept"]}," header to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text/toon"]}," on any supported GET request:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /venues\nAccept: text/toon\nAuthorization: Bearer <token>\nX-Partner-Reference: your-partner-ref\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Omitting the header, or using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Accept: application/json"]},", returns standard JSON — no other changes required."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"supported-endpoints","__idx":3},"children":["Supported endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All Bookings API endpoints that return a response body support TOON encoding:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Schema"},"children":["Schema"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paginated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VenueResponse"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/{venueId}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Venue"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/{compositeId}/availability"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AvailabilityResponse"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/{compositeId}/booking"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Booking"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/bookings"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paginated ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ReservationResponse"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/bookings/{bookingId}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Booking"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/bookings/{bookingId}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Booking"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PATCH"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/bookings/{bookingId}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Booking"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/venues/category"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ProductCategoryResponse"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Request bodies (POST/PUT/PATCH) remain ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/json"]}," only."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-fetch-venues-as-toon","__idx":4},"children":["Example: Fetch venues as TOON"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl https://api.bookabletech.com/venues \\\n  -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" \\\n  -H \"Accept: text/toon\"\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"JavaScript","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const response = await fetch(`${BASE_URL}/venues`, {\n  headers: {\n    Authorization: `Bearer ${accessToken}`,\n    Accept: 'text/toon',\n  },\n});\n\nconst toon = await response.text();\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Python","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"response = requests.get(\n    f'{BASE_URL}/venues',\n    headers={\n        'Authorization': f'Bearer {access_token}',\n        'Accept': 'text/toon',\n    },\n)\nresponse.raise_for_status()\ntoon = response.text\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"HttpRequest request = HttpRequest.newBuilder()\n    .uri(URI.create(BASE_URL + \"/venues\"))\n    .header(\"Authorization\", \"Bearer \" + accessToken)\n    .header(\"Accept\", \"text/toon\")\n    .GET()\n    .build();\n\nHttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());\nString toon = response.body();\n","lang":"java"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"label":"C#","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"var request = new HttpRequestMessage(HttpMethod.Get, $\"{BASE_URL}/venues\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", accessToken);\nrequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(\"text/toon\"));\n\nvar response = await client.SendAsync(request);\nresponse.EnsureSuccessStatusCode();\nvar toon = await response.Content.ReadAsStringAsync();\n","lang":"csharp"},"children":[]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-feeding-toon-into-an-llm-prompt","__idx":5},"children":["Example: Feeding TOON into an LLM prompt"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"var request = new HttpRequestMessage(HttpMethod.Get, $\"{BASE_URL}/venues\");\nrequest.Headers.Authorization = new AuthenticationHeaderValue(\"Bearer\", accessToken);\nrequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(\"text/toon\"));\n\nvar response = await client.SendAsync(request);\nvar toon = await response.Content.ReadAsStringAsync();\n\nvar prompt = $\"\"\"\n    You are a booking assistant. Here is the list of available venues:\n\n    {toon}\n\n    Answer the user's question: {userQuestion}\n    \"\"\";\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By requesting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text/toon"]}," instead of JSON, the venue list consumes significantly fewer tokens in the prompt, reducing both latency and cost."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"mime-type-note","__idx":6},"children":["MIME type note"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text/toon"]}," is not an IANA-registered media type — it is a convention used by this API. Clients must explicitly request it via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Accept"]}," header."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"combining-with-sparse-fieldsets","__idx":7},"children":["Combining with sparse fieldsets"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TOON and ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/resources/sparse-fieldsets"},"children":["sparse fieldsets"]}," are designed to be used together. Sparse fieldsets eliminate fields you don't need; TOON strips the syntactic overhead from what remains. Combined, they make the Bookings API highly efficient for agentic workflows where every token counts."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"GET /venues?fields=id,name,location(city),products(compositeId,productName)\nAccept: text/toon\nAuthorization: Bearer <token>\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A typical ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /venues"]}," response in JSON might consume ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["800–1,200 tokens"]}," per page. With sparse fieldsets and TOON together, the same data can drop to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200–400 tokens"]}," — a reduction of 60–75%, directly lowering your spend on OpenAI, Claude, and other inference APIs."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Agentic API design"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Bookings API is built for AI-native integrations. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fields"]}," to shape the data, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Accept: text/toon"]}," to compress it, and inject the result directly into your prompt context — with minimal token overhead and no pre-processing required."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related","__idx":8},"children":["Related"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/resources/sparse-fieldsets"},"children":["Sparse Fieldsets"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/apis/production/bookingapi"},"children":["Bookings API Reference"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/mcp/connection-guide"},"children":["MCP Connection Guide"]}]}]}]},"headings":[{"value":"TOON Format","id":"toon-format","depth":1},{"value":"When to use TOON","id":"when-to-use-toon","depth":2},{"value":"How to request TOON","id":"how-to-request-toon","depth":2},{"value":"Supported endpoints","id":"supported-endpoints","depth":2},{"value":"Example: Fetch venues as TOON","id":"example-fetch-venues-as-toon","depth":2},{"value":"Example: Feeding TOON into an LLM prompt","id":"example-feeding-toon-into-an-llm-prompt","depth":2},{"value":"MIME type note","id":"mime-type-note","depth":2},{"value":"Combining with sparse fieldsets","id":"combining-with-sparse-fieldsets","depth":2},{"value":"Related","id":"related","depth":2}],"frontmatter":{"seo":{"title":"TOON Format"}},"lastModified":"2026-03-13T09:43:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/resources/toon-format","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}