{"openapi":"3.1.0","info":{"title":"Grubhub API (Bowmark)","version":"e833508f87ff","description":"Grubhub food delivery — search restaurants delivering to an address (by cuisine, dish or name) with fees, ETAs and ratings, then read a restaurant's full menu with prices.\n\nEvery function Bowmark has for Grubhub (grubhub.com) as one HTTP call. Each runs on Bowmark's infrastructure with the same billing, rules and response envelope as `POST /v1/run`. The whole API: https://api.bowmark.ai/openapi.json. Guide: https://bowmark.ai/docs/api.","contact":{"email":"support@bowmark.ai","url":"https://bowmark.ai/docs/api"}},"servers":[{"url":"https://api.bowmark.ai"}],"security":[{"bearer":[]},{"apiKeyHeader":[]}],"paths":{"/v1/sites/grubhub/search":{"post":{"operationId":"search","summary":"Searches Grubhub for restaurants delivering to (or offering pickup near) a place — `{ query: \"pizza\", place: \"Union Square, New York, NY\" }` or lat/lng — returning each restaurant's id, url, cuisines,","description":"Searches Grubhub for restaurants delivering to (or offering pickup near) a place — `{ query: \"pizza\", place: \"Union Square, New York, NY\" }` or lat/lng — returning each restaurant's id, url, cuisines, rating, price level, distance, open state, delivery fee, minimum and ETA. The door for getRestaurant/getMenu.\n\nCalls `bowmark.providers.grubhub.search`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubSearchResult>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubSearchArgs","description":"TypeScript: `GrubhubSearchArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getRestaurant":{"post":{"operationId":"getRestaurant","summary":"Reads one Grubhub restaurant by the id search() returns: address, cuisines, rating, price level, pickup, and its full menu (categories → items with price in cents, description, availability, image).","description":"Reads one Grubhub restaurant by the id search() returns: address, cuisines, rating, price level, pickup, and its full menu (categories → items with price in cents, description, availability, image).\n\nCalls `bowmark.providers.grubhub.getRestaurant`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubRestaurant>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TypeScript: `string`"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getMenu":{"post":{"operationId":"getMenu","summary":"Just the menu of one Grubhub restaurant (by search()'s id): categories, each with its items, prices in cents, descriptions and availability.","description":"Just the menu of one Grubhub restaurant (by search()'s id): categories, each with its items, prices in cents, descriptions and availability.\n\nCalls `bowmark.providers.grubhub.getMenu`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubMenuCategory[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TypeScript: `string`"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getMenuItem":{"post":{"operationId":"getMenuItem","summary":"One Grubhub menu item (ids from getMenu()) with its customizations: every choice group (min/max picks) and option with its surcharge in cents, nested choices, the item's price range and dish tags.","description":"One Grubhub menu item (ids from getMenu()) with its customizations: every choice group (min/max picks) and option with its surcharge in cents, nested choices, the item's price range and dish tags.\n\nCalls `bowmark.providers.grubhub.getMenuItem`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubMenuItemDetail>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","properties":{"restaurantId":{"type":"string"},"itemId":{"type":"string"}},"required":["restaurantId","itemId"],"additionalProperties":true,"description":"TypeScript: `{ restaurantId: string; itemId: string }`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getDeliveryEstimate":{"post":{"operationId":"getDeliveryEstimate","summary":"Whether a Grubhub restaurant (search()'s id) delivers to a place — `{ id: \"469121\", place: \"Union Square, New York, NY\" }` or lat/lng — and at what delivery fee, order minimum, ETA in minutes, distanc","description":"Whether a Grubhub restaurant (search()'s id) delivers to a place — `{ id: \"469121\", place: \"Union Square, New York, NY\" }` or lat/lng — and at what delivery fee, order minimum, ETA in minutes, distance and next arrival time.\n\nCalls `bowmark.providers.grubhub.getDeliveryEstimate`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubDeliveryEstimate>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubDeliveryEstimateArgs","description":"TypeScript: `GrubhubDeliveryEstimateArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getRestaurantReviews":{"post":{"operationId":"getRestaurantReviews","summary":"A page of diner reviews for one Grubhub restaurant (search()'s id), newest first: star rating, text, date, sentiment and the items ordered, with the total review count.","description":"A page of diner reviews for one Grubhub restaurant (search()'s id), newest first: star rating, text, date, sentiment and the items ordered, with the total review count.\n\nCalls `bowmark.providers.grubhub.getRestaurantReviews`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubReviews>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubReviewsArgs","description":"TypeScript: `GrubhubReviewsArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/listCuisines":{"post":{"operationId":"listCuisines","summary":"Cuisine tags carried by restaurants delivering near a place — `{ place: \"Union Square, New York, NY\" }` or lat/lng — most common first with a count of how many of the sampled restaurants carry each.","description":"Cuisine tags carried by restaurants delivering near a place — `{ place: \"Union Square, New York, NY\" }` or lat/lng — most common first with a count of how many of the sampled restaurants carry each. Grubhub publishes no global cuisine list; this samples search() near the point.\n\nCalls `bowmark.providers.grubhub.listCuisines`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubCuisines>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubCuisinesArgs","description":"TypeScript: `GrubhubCuisinesArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getPromoOffers":{"post":{"operationId":"getPromoOffers","summary":"Active promo codes, spend-based thresholds and the delivery-fee badge Grubhub shows for one restaurant (search()'s id) at a place — `{ id: \"2803486\", place: \"Los Angeles, CA\" }` or lat/lng.","description":"Active promo codes, spend-based thresholds and the delivery-fee badge Grubhub shows for one restaurant (search()'s id) at a place — `{ id: \"2803486\", place: \"Los Angeles, CA\" }` or lat/lng. Promos are attached to a restaurant's search RESULT at a point, not a standalone endpoint, so this searches near the point and reads them off the matching row.\n\nCalls `bowmark.providers.grubhub.getPromoOffers`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubPromoOffers>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubPromoOffersArgs","description":"TypeScript: `GrubhubPromoOffersArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getCart":{"post":{"operationId":"getCart","summary":"What is in the Grubhub cart: line items (lineId, item, quantity, price in cents, options), item count and subtotal.","description":"What is in the Grubhub cart: line items (lineId, item, quantity, price in cents, options), item count and subtotal. No account — reads this run's cart, or an earlier run's by the cartKey it returned; an empty cart when none exists yet. The cart also carries `checkout`, the same restaurant-page handoff (a refusal when the cart is empty).\n\nCalls `bowmark.providers.grubhub.getCart`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubCart>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cartKey":{"type":"string","description":"TypeScript: `string`"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/addToCart":{"post":{"operationId":"addToCart","summary":"Adds a menu item (ids from getMenu()/getMenuItem(), with optional option ids, quantity and instructions) to an anonymous Grubhub cart and returns the cart, including a cartKey for later runs — `{ rest","description":"Adds a menu item (ids from getMenu()/getMenuItem(), with optional option ids, quantity and instructions) to an anonymous Grubhub cart and returns the cart, including a cartKey for later runs — `{ restaurantId: \"469121\", itemId: \"24017014\" }`. No account; checkout itself needs a login. The returned cart also carries `checkout`: the restaurant page the items came from plus the items to add again (a guest cart no link can open; delivery fee and tip are set at Grubhub's own checkout), or a refusal when the cart is empty or spans no single restaurant.\n\nCalls `bowmark.providers.grubhub.addToCart`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubCart>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"$ref":"#/components/schemas/GrubhubAddToCartArgs","description":"TypeScript: `GrubhubAddToCartArgs`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/removeFromCart":{"post":{"operationId":"removeFromCart","summary":"Removes one line (getCart().items[].lineId) from the Grubhub cart and returns what is left.","description":"Removes one line (getCart().items[].lineId) from the Grubhub cart and returns what is left. The returned cart also carries `checkout`: the restaurant page with what is left, or a refusal when the cart is now empty.\n\nCalls `bowmark.providers.grubhub.removeFromCart`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubCart>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","properties":{"lineId":{"type":"string"},"cartKey":{"type":"string"}},"required":["lineId"],"additionalProperties":true,"description":"TypeScript: `{ lineId: string; cartKey?: string }`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/updateCartItem":{"post":{"operationId":"updateCartItem","summary":"Sets the quantity (1-50) of one Grubhub cart line (getCart().items[].lineId), keeping its options, and returns the cart.","description":"Sets the quantity (1-50) of one Grubhub cart line (getCart().items[].lineId), keeping its options, and returns the cart. The returned cart also carries `checkout`, the restaurant-page handoff with the new quantity.\n\nCalls `bowmark.providers.grubhub.updateCartItem`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubCart>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","properties":{"lineId":{"type":"string"},"quantity":{"type":"number"},"cartKey":{"type":"string"}},"required":["lineId","quantity"],"additionalProperties":true,"description":"TypeScript: `{ lineId: string; quantity: number; cartKey?: string }`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/applyPromoCode":{"post":{"operationId":"applyPromoCode","summary":"Applies a Grubhub promo code to the cart (add something first) — `{ code: \"WELCOME\" }`.","description":"Applies a Grubhub promo code to the cart (add something first) — `{ code: \"WELCOME\" }`. Answers whether it applied, what the code is for, and Grubhub's own reason when it did not (expired, unknown, wrong order type) rather than throwing. No account. The `cart` in the answer carries `checkout` too: the restaurant page and the items to add again.\n\nCalls `bowmark.providers.grubhub.applyPromoCode`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubPromoResult>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","properties":{"code":{"type":"string"},"cartKey":{"type":"string"}},"required":["code"],"additionalProperties":true,"description":"TypeScript: `{ code: string; cartKey?: string }`"}},"required":["args"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getSavedAddresses":{"post":{"operationId":"getSavedAddresses","summary":"The signed-in diner's saved Grubhub delivery addresses (label, street, unit, city, state, ZIP, lat/lng, instructions).","description":"The signed-in diner's saved Grubhub delivery addresses (label, street, unit, city, state, ZIP, lat/lng, instructions). Needs the caller signed in to grubhub.com; pauses for sign-in otherwise.\n\nCalls `bowmark.providers.grubhub.getSavedAddresses`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubSavedAddress[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getFavoriteRestaurants":{"post":{"operationId":"getFavoriteRestaurants","summary":"The signed-in diner's favourite Grubhub restaurants — id (what getRestaurant/getMenu take), name and url.","description":"The signed-in diner's favourite Grubhub restaurants — id (what getRestaurant/getMenu take), name and url. Needs the caller signed in to grubhub.com.\n\nCalls `bowmark.providers.grubhub.getFavoriteRestaurants`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubFavorite[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getPaymentMethods":{"post":{"operationId":"getPaymentMethods","summary":"The signed-in diner's saved Grubhub payment methods — cards (brand, last four, expiry) and PayPal, Venmo, Amazon Pay and Cash App wallets.","description":"The signed-in diner's saved Grubhub payment methods — cards (brand, last four, expiry) and PayPal, Venmo, Amazon Pay and Cash App wallets. Never a full card number. Needs the caller signed in to grubhub.com.\n\nCalls `bowmark.providers.grubhub.getPaymentMethods`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubPaymentMethod[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getOrderHistory":{"post":{"operationId":"getOrderHistory","summary":"The signed-in diner's past Grubhub orders — restaurant, status, total in cents and item count, newest first.","description":"The signed-in diner's past Grubhub orders — restaurant, status, total in cents and item count, newest first. Needs the caller signed in to grubhub.com.\n\nCalls `bowmark.providers.grubhub.getOrderHistory`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubOrderSummary[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/getOrderStatus":{"post":{"operationId":"getOrderStatus","summary":"One Grubhub order's status, ETA and line items, by the id getOrderHistory() returns.","description":"One Grubhub order's status, ETA and line items, by the id getOrderHistory() returns. Needs the caller signed in to grubhub.com.\n\nCalls `bowmark.providers.grubhub.getOrderStatus`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubOrderStatus>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["orderId"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}},"/v1/sites/grubhub/saveRestaurant":{"post":{"operationId":"saveRestaurant","summary":"Adds a restaurant (search()'s id) to the signed-in diner's Grubhub favourites and returns the updated list.","description":"Adds a restaurant (search()'s id) to the signed-in diner's Grubhub favourites and returns the updated list. Needs the caller signed in to grubhub.com.\n\nCalls `bowmark.providers.grubhub.saveRestaurant`. The body is the function's arguments, keyed by parameter name. `result` in the response is what it returns: `Promise<GrubhubFavorite[]>`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"TypeScript: `string`"},"opts":{"type":"object","properties":{"connection":{"type":"string"}},"required":["connection"],"additionalProperties":true,"description":"TypeScript: `ConnectionOption`"}},"required":["id"],"additionalProperties":false}}}},"responses":{"200":{"description":"The call ran. That includes a call that failed (`status: error`) or paused for a sign-in (`status: needs_user`), so branch on `status`.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunEnvelope"},{"type":"object","properties":{"result":{}}}]}}}},"400":{"description":"The body was malformed. `error` says what to send.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"401":{"description":"No API key, or a key that was refused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"402":{"description":"The account is out of free usage, at its spend cap, or its card was declined. Fix billing at https://bowmark.ai/dashboard/billing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}},"404":{"$ref":"#/components/responses/NotFound"},"429":{"description":"Too many runs in flight on this account. Nothing was started or charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}},"headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait."}}},"503":{"description":"A failure on Bowmark's side. Retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your Bowmark API key."},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Bowmark-Key"}},"responses":{"NotFound":{"description":"No such site or function.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunEnvelope"}}}}},"schemas":{"RunEnvelope":{"type":"object","description":"What a run returns. `status` says whether the SCRIPT succeeded. A script that threw or paused for a login is still HTTP 200. Branch on `status`, not on the HTTP code.","required":["ok","status","result","logs","error","ms"],"properties":{"runId":{"type":"string","description":"Stable id for this run. Quote it in a support or `report` message."},"ok":{"type":"boolean","description":"False only when the run produced nothing usable."},"status":{"type":"string","enum":["ok","error","partial","needs_user"],"description":"`partial`: the result is real but some calls failed (see `incomplete`); `ok` stays true. `needs_user`: a person must sign in to a site first. Relay `meta.handoff.url` to them, then run again."},"egress":{"type":"string","enum":["default","link"],"description":"The egress the run was given, present only when the request asked for one. `link`: every request went through the caller's own Chrome (Bowmark Buddy)."},"result":{"description":"Whatever the script `return`ed. Any JSON value."},"logs":{"type":"array","items":{"type":"string"},"description":"Lines the script wrote with `log(...)`."},"error":{"type":["string","null"],"description":"Why the run failed, in plain words. Null on success."},"ms":{"type":"integer","description":"How long the script itself ran, in milliseconds."},"queuedMs":{"type":"integer","description":"How long the run waited for a worker before starting. Present only when it was a second or more."},"needs":{"type":"array","description":"The sign-ins this script is waiting on. Present when `status` is `needs_user`.","items":{"type":"object","required":["capability","provider","providerTitle","kind"],"properties":{"capability":{"type":"string"},"provider":{"type":"string"},"providerTitle":{"type":"string","description":"The site's name, to show a person."},"kind":{"type":"string"}}}},"incomplete":{"type":"object","description":"Present only when `status` is `partial`: which calls did not answer.","properties":{"summary":{"type":"string"},"totalCalls":{"type":"integer"}},"additionalProperties":true},"emptyHanded":{"type":"object","description":"Present when the script returned nothing while its calls returned rows, usually a filter that matched none of the site's own labels. Lists the label values the calls actually returned.","additionalProperties":true},"notes":{"type":"array","description":"Caveats a call attached to a complete answer. Never changes `status`.","items":{"type":"object","properties":{"path":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}}},"meta":{"type":"object","properties":{"handoff":{"type":"object","description":"A single-use sign-in link for a person to open. Expires at `expiresAt`.","properties":{"ref":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"concurrency":{"type":"object","description":"On a 429: how many runs are in flight and when to retry.","properties":{"limit":{"type":"integer"},"inFlight":{"type":"integer"},"retryAfterSeconds":{"type":"integer"}}}},"additionalProperties":true},"notice":{"type":"object","description":"Set when the account owner has not accepted the current Terms. Relay it to them.","additionalProperties":true}}},"GrubhubAddToCartArgs":{"type":"object","properties":{"restaurantId":{"type":"string"},"itemId":{"type":"string"},"quantity":{"type":"number"},"optionIds":{"type":"array","items":{"type":"string"}},"instructions":{"type":"string"},"cartKey":{"type":"string"}},"required":["restaurantId","itemId"],"additionalProperties":true},"GrubhubCuisinesArgs":{"type":"object","properties":{"place":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"sampleSize":{"type":"number"}},"additionalProperties":true},"GrubhubDeliveryEstimateArgs":{"type":"object","properties":{"id":{"type":"string"},"place":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}},"required":["id"],"additionalProperties":true},"GrubhubPromoOffersArgs":{"type":"object","properties":{"id":{"type":"string"},"place":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"}},"required":["id"],"additionalProperties":true},"GrubhubReviewsArgs":{"type":"object","properties":{"id":{"type":"string"},"limit":{"type":"number"},"page":{"type":"number"}},"required":["id"],"additionalProperties":true},"GrubhubSearchArgs":{"type":"object","properties":{"query":{"type":"string"},"place":{"type":"string"},"lat":{"type":"number"},"lng":{"type":"number"},"mode":{"anyOf":[{"const":"delivery"},{"const":"pickup"}]},"limit":{"type":"number"},"page":{"type":"number"}},"additionalProperties":true}}}}