{"openapi":"3.1.0","info":{"title":"Aune Public Booking API","version":"public_bookings_api_v1","description":"Search and confirm real Swedish home-service bookings from external assistants and partner systems. Direct booking binds a provider, provider price, appointment slot, terms version, consent evidence, and durable confirmation. Provider follow-up request creation remains available as a fallback and does not itself confirm a booking."},"servers":[{"url":"https://aune-homepage-chat.vercel.app"}],"tags":[{"name":"Discovery","description":"Read-only capability discovery for external assistants."},{"name":"Requests","description":"Create provider follow-up requests when no direct booking option is available."},{"name":"Bookings","description":"Search live direct-booking options, confirm one selected option, and retrieve confirmed status."},{"name":"Webhooks","description":"Signed booking lifecycle event delivery and replay management."}],"paths":{"/api/public/requests/capabilities":{"get":{"tags":["Discovery"],"operationId":"getAunePublicRequestCapabilities","summary":"Get supported Aune public request capabilities","description":"Returns Sweden-only geographic scope, supported verticals, accepted job type IDs, required fields, and non-bookable future verticals. External assistants should call this before creating a request.","responses":{"200":{"description":"Capabilities response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuneCapabilities"}}}}},"deprecated":true,"x-aune-successor-version":"/v1/capabilities"}},"/api/public/booking-options":{"post":{"tags":["Bookings"],"operationId":"searchAuneBookingOptions","summary":"Search current direct-booking options","description":"Checks current provider eligibility, provider-owned fixed pricing, and concrete appointment slots without collecting or returning customer PII. Each option has a short-lived tamper-evident booking_option_id and an exact terms version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPublicBookingOptions"}}}},"responses":{"200":{"description":"Current booking options or a structured request-only fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPublicBookingOptionsSuccess"}}}},"400":{"description":"Invalid search payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"422":{"description":"Unsupported vertical or job type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"503":{"description":"Booking option signing is not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}}},"deprecated":true,"x-aune-successor-version":"/v1/booking-options"}},"/api/public/bookings":{"post":{"tags":["Bookings"],"operationId":"confirmAuneBooking","summary":"Confirm one selected booking option","description":"Revalidates the selected provider, provider-owned price, slot, and terms; atomically prevents overlapping confirmed bookings; creates a durable confirmed provider offer and calendar booking; and sends customer/provider confirmations. Requires customer consent, exact terms acceptance, authentication, and an idempotency key.","security":[{"bearerAuth":[]},{"auneRequestsToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBooking"}}}},"responses":{"200":{"description":"Idempotent replay of the already confirmed booking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBookingSuccess"}}}},"201":{"description":"Booking newly confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBookingSuccess"}}}},"400":{"description":"Missing consent, terms acceptance, customer fields, or idempotency key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"401":{"description":"Missing or invalid API token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"409":{"description":"Option expired, changed, already taken, or no longer available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"503":{"description":"Booking persistence or provider booking record unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}}},"deprecated":true,"x-aune-successor-version":"/v1/bookings"}},"/api/public/bookings/{booking_id}":{"get":{"tags":["Bookings"],"operationId":"getAuneBookingStatus","summary":"Get a redacted confirmed booking status","security":[{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"booking_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The booking.id or request_id returned by booking confirmation."}],"responses":{"200":{"description":"Redacted confirmed booking status or found:false","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicBookingStatus"}}}},"401":{"description":"Missing or invalid API token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}}},"deprecated":true,"x-aune-successor-version":"/v1/bookings/{booking_id}"}},"/api/public/requests":{"post":{"tags":["Requests"],"operationId":"createAunePublicRequest","summary":"Create an Aune public home-service request","description":"Creates a server-side Aune network visit request for supported home-service jobs in Sweden. This is a handoff/request operation, not a confirmed booking operation.","security":[{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Optional retry key. Prefer also setting `idempotency_key` in the JSON body for model-readable traces."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicRequest"},"examples":{"plumbingLeak":{"summary":"Plumbing leak request","value":{"spec_version":"public_requests_api_v1","vertical_id":"vvs","job_type_id":"leak_faucet_fixture","description":"Kitchen faucet leaks when used. Customer wants help next week.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for provider follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Storgatan 12, 118 61 Stockholm"},"timing":{"preferred_time_text":"Next Friday morning"},"budget_sek":4500,"details":{"fixture":"kitchen faucet"},"source":"external_model","external_reference":"partner-case-123","idempotency_key":"partner-case-123","locale":"sv-SE","timezone":"Europe/Stockholm"}},"cleaningMoveOut":{"summary":"Move-out cleaning request","value":{"spec_version":"public_requests_api_v1","vertical_id":"cleaning","job_type_id":"cleaning_move_out","description":"Move-out cleaning for an empty 82 sqm apartment next Friday.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for provider follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Storgatan 12, 118 61 Stockholm"},"timing":{"preferred_time_text":"Next Friday morning"},"details":{"square_meters":82,"move_state":"empty"},"source":"external_model","external_reference":"partner-cleaning-123","idempotency_key":"partner-cleaning-123","locale":"sv-SE","timezone":"Europe/Stockholm"}},"movingHome":{"summary":"Home moving request","value":{"spec_version":"public_requests_api_v1","vertical_id":"moving","job_type_id":"moving_home","description":"Apartment move from Södermalm to Solna, 2 rooms, about 35 boxes and one sofa. Customer wants moving-company follow-up next month.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for moving-company follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Södermalm to Solna, Stockholm"},"timing":{"preferred_time_text":"Next month, preferably a weekday morning"},"details":{"home_size":"2 rooms","boxes":35,"large_items":["sofa"],"from":"Södermalm","to":"Solna","elevator":"unknown"},"source":"external_model","external_reference":"partner-moving-123","idempotency_key":"move-1","locale":"sv-SE","timezone":"Europe/Stockholm"}}}}}},"responses":{"201":{"description":"Request created. This response still does not confirm booking, availability, provider selection, appointment time, or final price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicRequestSuccess"}}}},"400":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"401":{"description":"Missing or invalid API token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}},"503":{"description":"Production token is not configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRequestError"}}}}},"deprecated":true,"x-aune-successor-version":"/v1/requests"}},"/v1/capabilities":{"get":{"tags":["Discovery"],"operationId":"getAunePublicRequestCapabilitiesV1","summary":"Get supported Aune public request capabilities","description":"Returns Sweden-only geographic scope, supported verticals, accepted job type IDs, required fields, and non-bookable future verticals. External assistants should call this before creating a request.","responses":{"200":{"description":"Capabilities response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuneCapabilities"},"example":{"ok":true,"spec_version":"public_requests_api_v1","endpoints":{"search_booking_options":"POST /v1/booking-options","confirm_booking":"POST /v1/bookings","booking_status":"GET /v1/bookings/{booking_id}","create_request":"POST /v1/requests","capabilities":"GET /v1/capabilities"},"lifecycle":{"creates":"network_visit_request","booking_created":false,"availability_checked":false,"provider_selected":false},"booking_lifecycle":{"confirmed_contract":{"booking_created":true,"availability_checked":true,"provider_selected":true,"booking_status":"confirmed"}},"supported_verticals":[{"vertical_id":"vvs"},{"vertical_id":"electrician"},{"vertical_id":"moving"},{"vertical_id":"cleaning"}]}}}}},"deprecated":false}},"/v1/booking-options":{"post":{"tags":["Bookings"],"operationId":"searchAuneBookingOptionsV1","summary":"Search current direct-booking options","description":"Checks current provider eligibility, provider-owned fixed pricing, and concrete appointment slots without collecting or returning customer PII. Each option has a short-lived tamper-evident booking_option_id and an exact terms version.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPublicBookingOptions"},"example":{"spec_version":"public_bookings_api_v1","vertical_id":"moving","job_type_id":"moving_home","description":"Home move tomorrow afternoon from postcode 111 20 to 118 20. The apartment is 45 sqm with about 25 boxes, a sofa, and a bed. Both addresses have elevators.","location":{"country_code":"SE","postcode":"111 20","city":"Stockholm"},"destination_location":{"country_code":"SE","postcode":"118 20","city":"Stockholm"},"timing":{"preferred_time_text":"Tomorrow afternoon"},"details":{"home_size_sqm":45,"boxes":25,"elevator_origin":true,"elevator_destination":true},"locale":"sv-SE","timezone":"Europe/Stockholm"}}}},"responses":{"200":{"description":"Current booking options or a structured request-only fallback","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPublicBookingOptionsSuccess"},"example":{"ok":true,"spec_version":"public_bookings_api_v1","direct_booking_available":true,"option_count":1,"options":[{"booking_option_id":"aune_bo_1.opaque_signed_option_from_search","expires_at":"2026-07-10T10:15:00.000Z","provider":{"id":"00000000-0000-4000-8000-000000000103","name":"Example Moving AB","city":"Stockholm"},"service":{"service_id":"moving_home_starter_3h","vertical_id":"moving","job_type_id":"moving_home","label_sv":"Bohagsflytt"},"slot":{"start_at":"2026-07-17T08:00:00.000Z","end_at":"2026-07-17T11:00:00.000Z","label":"17 July 2026, 10:00-13:00 Europe/Stockholm"},"price":{"amount_sek":2890,"currency":"SEK","pricing_model":"fixed","price_type":"fixed"},"scope":{"included_sv":["Tre timmars bohagsflytt enligt returnerat scope"]},"terms":{"version":"fixed_price_terms_v1:moving_home_starter_3h","url":"https://aune-homepage-chat.vercel.app/fixed-price-terms/moving_home_starter_3h","sections":[],"source_urls":[]}}],"availability_checked":true,"provider_selected":false,"booking_created":false,"safe_next_step":"Present this exact option and wait for explicit user choice."}}}},"400":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}},"deprecated":false}},"/v1/bookings":{"post":{"tags":["Bookings"],"operationId":"confirmAuneBookingV1","summary":"Confirm one selected booking option","description":"Revalidates the selected provider, provider-owned price, slot, and terms; atomically prevents overlapping confirmed bookings; creates a durable confirmed provider offer and calendar booking; and sends customer/provider confirmations. Requires customer consent, exact terms acceptance, authentication, and an idempotency key.","security":[{"oauth2":["aune.bookings.confirm"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBooking"},"example":{"spec_version":"public_bookings_api_v1","booking_option_id":"aune_bo_1.opaque_signed_option_from_search","customer":{"name":"Example Customer","phone":"+46700000000","email":"customer@example.invalid"},"service_location":{"country_code":"SE","address":"Examplegatan 1","postcode":"11122"},"destination_location":{"country_code":"SE","address":"Exempelvagen 2","postcode":"41256"},"user_consent_confirmed":true,"booking_terms_accepted":true,"booking_terms_version":"fixed_price_terms_v1:moving_home_starter_3h","booking_terms_accepted_at":"2026-07-10T10:04:00.000Z","idempotency_key":"conversation-123-option-1"}}}},"responses":{"200":{"description":"Idempotent replay of the already confirmed booking","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBookingSuccess"},"example":{"ok":true,"spec_version":"public_bookings_api_v1","request_id":"nvr_01JZEXAMPLE000000000000001","booking":{"id":"bkg_01JZEXAMPLE000000000000001","status":"confirmed","provider_id":"00000000-0000-4000-8000-000000000103","provider_name":"Example Moving AB","service_id":"moving_home_starter_3h","slot_start_at":"2026-07-17T08:00:00.000Z","slot_end_at":"2026-07-17T11:00:00.000Z","slot_label":"17 July 2026, 10:00-13:00 Europe/Stockholm","price_sek":2890,"currency":"SEK","confirmed_at":"2026-07-10T10:05:00.000Z","terms_version":"fixed_price_terms_v1:moving_home_starter_3h"},"booking_created":true,"availability_checked":true,"provider_selected":true,"idempotent_replay":true,"confirmation_delivery":{"customer":{"status":"queued"},"provider":{"status":"queued"},"webhook":{"status":"queued"}},"safe_next_step":"Tell the user the exact returned booking is confirmed."}}}},"201":{"description":"Booking newly confirmed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPublicBookingSuccess"},"example":{"ok":true,"spec_version":"public_bookings_api_v1","request_id":"nvr_01JZEXAMPLE000000000000001","booking":{"id":"bkg_01JZEXAMPLE000000000000001","status":"confirmed","provider_id":"00000000-0000-4000-8000-000000000103","provider_name":"Example Moving AB","service_id":"moving_home_starter_3h","slot_start_at":"2026-07-17T08:00:00.000Z","slot_end_at":"2026-07-17T11:00:00.000Z","slot_label":"17 July 2026, 10:00-13:00 Europe/Stockholm","price_sek":2890,"currency":"SEK","confirmed_at":"2026-07-10T10:05:00.000Z","terms_version":"fixed_price_terms_v1:moving_home_starter_3h"},"booking_created":true,"availability_checked":true,"provider_selected":true,"idempotent_replay":false,"confirmation_delivery":{"customer":{"status":"queued"},"provider":{"status":"queued"},"webhook":{"status":"queued"}},"safe_next_step":"Tell the user the exact returned booking is confirmed."}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}},"deprecated":false}},"/v1/bookings/{booking_id}":{"get":{"tags":["Bookings"],"operationId":"getAuneBookingStatusV1","summary":"Get a redacted confirmed booking status","security":[{"oauth2":["aune.bookings.read"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"booking_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The booking.id or request_id returned by booking confirmation."}],"responses":{"200":{"description":"Redacted confirmed booking status or found:false","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicBookingStatus"},"example":{"ok":true,"found":true,"booking":{"id":"bkg_01JZEXAMPLE000000000000001","status":"confirmed","provider_id":"00000000-0000-4000-8000-000000000103","provider_name":"Example Moving AB","service_id":"moving_home_starter_3h","slot_start_at":"2026-07-17T08:00:00.000Z","slot_end_at":"2026-07-17T11:00:00.000Z","slot_label":"17 July 2026, 10:00-13:00 Europe/Stockholm","price_sek":2890,"currency":"SEK","confirmed_at":"2026-07-10T10:05:00.000Z","terms_version":"fixed_price_terms_v1:moving_home_starter_3h"},"booking_created":true,"current_confirmation_active":true,"availability_checked":true,"provider_selected":true}}}},"401":{"$ref":"#/components/responses/Problem"}},"deprecated":false}},"/v1/requests":{"post":{"tags":["Requests"],"operationId":"createAunePublicRequestV1","summary":"Create an Aune public home-service request","description":"Creates a server-side Aune network visit request for supported home-service jobs in Sweden. This is a handoff/request operation, not a confirmed booking operation.","security":[{"oauth2":["aune.requests.create"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":200},"description":"Optional retry key. Prefer also setting `idempotency_key` in the JSON body for model-readable traces."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicRequest"},"examples":{"plumbingLeak":{"summary":"Plumbing leak request","value":{"spec_version":"public_requests_api_v1","vertical_id":"vvs","job_type_id":"leak_faucet_fixture","description":"Kitchen faucet leaks when used. Customer wants help next week.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for provider follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Storgatan 12, 118 61 Stockholm"},"timing":{"preferred_time_text":"Next Friday morning"},"budget_sek":4500,"details":{"fixture":"kitchen faucet"},"source":"external_model","external_reference":"partner-case-123","idempotency_key":"partner-case-123","locale":"sv-SE","timezone":"Europe/Stockholm"}},"cleaningMoveOut":{"summary":"Move-out cleaning request","value":{"spec_version":"public_requests_api_v1","vertical_id":"cleaning","job_type_id":"cleaning_move_out","description":"Move-out cleaning for an empty 82 sqm apartment next Friday.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for provider follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Storgatan 12, 118 61 Stockholm"},"timing":{"preferred_time_text":"Next Friday morning"},"details":{"square_meters":82,"move_state":"empty"},"source":"external_model","external_reference":"partner-cleaning-123","idempotency_key":"partner-cleaning-123","locale":"sv-SE","timezone":"Europe/Stockholm"}},"movingHome":{"summary":"Home moving request","value":{"spec_version":"public_requests_api_v1","vertical_id":"moving","job_type_id":"moving_home","description":"Apartment move from Södermalm to Solna, 2 rooms, about 35 boxes and one sofa. Customer wants moving-company follow-up next month.","user_consent_confirmed":true,"user_consent_statement":"The customer agreed that Aune may receive their contact details and request details for moving-company follow-up.","consent_source":"external_model_conversation","customer":{"name":"Anna Andersson","phone":"0701234567","email":"anna@example.se"},"location":{"input":"Södermalm to Solna, Stockholm"},"timing":{"preferred_time_text":"Next month, preferably a weekday morning"},"details":{"home_size":"2 rooms","boxes":35,"large_items":["sofa"],"from":"Södermalm","to":"Solna","elevator":"unknown"},"source":"external_model","external_reference":"partner-moving-123","idempotency_key":"move-1","locale":"sv-SE","timezone":"Europe/Stockholm"}}}}}},"responses":{"201":{"description":"Request created. This response still does not confirm booking, availability, provider selection, appointment time, or final price.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicRequestSuccess"},"example":{"ok":true,"spec_version":"public_requests_api_v1","request":{"id":"nvr_01JZEXAMPLE000000000000001","session_id":"api_example","status":"ready_to_send","vertical_id":"moving","job_type_id":"moving_home","taxonomy_confidence":"high","customer_next_step":"contact_me","candidate_provider_count":0,"provider_candidates":[],"persistence_status":"stored","persistence_backend":"supabase"},"booking_created":false,"availability_checked":false,"provider_selected":false,"safe_next_step":"Tell the user Aune captured a provider-follow-up request; no booking is confirmed."}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}},"deprecated":false}},"/v1/bookings/{booking_id}/cancel":{"post":{"tags":["Bookings"],"operationId":"cancelAuneBookingV1","summary":"Cancel a confirmed booking","description":"Cancels the caller-owned confirmed booking atomically after fresh explicit user confirmation. Queues customer, provider, and webhook notifications in the same transaction.","security":[{"oauth2":["aune.bookings.cancel"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"$ref":"#/components/parameters/BookingId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPublicBooking"},"example":{"user_confirmation_confirmed":true,"reason":"customer_changed_mind","idempotency_key":"cancel-1"}}}},"responses":{"200":{"description":"Booking cancelled or idempotent cancellation replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelPublicBookingSuccess"},"example":{"ok":true,"booking_id":"bkg_01JZEXAMPLE000000000000001","status":"cancelled","cancelled_at":"2026-07-10T11:00:00.000Z","booking_created":true,"current_confirmation_active":false,"idempotent_replay":false,"safe_next_step":"Tell the user the booking is cancelled."}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}}},"/v1/bookings/{booking_id}/reschedule":{"post":{"tags":["Bookings"],"operationId":"rescheduleAuneBookingV1","summary":"Reschedule a confirmed booking","description":"Consumes a fresh booking option after user confirmation and exact terms acceptance, revalidates provider/price/slot, and atomically updates the booking.","security":[{"oauth2":["aune.bookings.reschedule"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"$ref":"#/components/parameters/BookingId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReschedulePublicBooking"},"example":{"booking_option_id":"aune_bo_1.opaque_signed_option_from_search","service_location":{"country_code":"SE","address":"Examplegatan 1","postcode":"11122"},"destination_location":{"country_code":"SE","address":"Exempelvagen 2","postcode":"41256"},"user_confirmation_confirmed":true,"booking_terms_accepted":true,"booking_terms_version":"fixed_price_terms_v1:moving_home_starter_3h","booking_terms_accepted_at":"2026-07-10T11:10:00.000Z","idempotency_key":"move-slot-1"}}}},"responses":{"200":{"description":"Booking rescheduled or idempotent reschedule replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReschedulePublicBookingSuccess"},"example":{"ok":true,"booking":{"id":"bkg_01JZEXAMPLE000000000000001","status":"confirmed","provider_id":"00000000-0000-4000-8000-000000000103","provider_name":"Example Moving AB","service_id":"moving_home_starter_3h","slot_start_at":"2026-07-18T08:00:00.000Z","slot_end_at":"2026-07-18T11:00:00.000Z","slot_label":"17 July 2026, 10:00-13:00 Europe/Stockholm","price_sek":2890,"currency":"SEK","confirmed_at":"2026-07-10T10:05:00.000Z","terms_version":"fixed_price_terms_v1:moving_home_starter_3h"},"booking_created":true,"current_confirmation_active":true,"provider_selected":true,"availability_checked":true,"rescheduled_at":"2026-07-10T11:11:00.000Z","idempotent_replay":false}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}}},"/v1/webhook-endpoints":{"get":{"tags":["Webhooks"],"operationId":"listAuneWebhookEndpointsV1","summary":"List caller-owned webhook endpoints","description":"Returns only webhook endpoints owned by the authenticated OAuth client. Signing secrets are never returned after creation.","security":[{"oauth2":["aune.webhooks.manage"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"responses":{"200":{"description":"Webhook endpoints","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"},"example":{"ok":true,"endpoints":[{"id":"00000000-0000-4000-8000-000000000201","url":"https://agent.example/aune/webhooks","event_types":["booking.confirmed","booking.rescheduled","booking.cancelled"],"signing_key_id":"2026-07","enabled":true,"created_at":"2026-07-10T10:00:00.000Z","updated_at":"2026-07-10T10:00:00.000Z"}]}}}},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}},"post":{"tags":["Webhooks"],"operationId":"createAuneWebhookEndpointV1","summary":"Register a signed webhook endpoint","description":"Registers a caller-owned public HTTPS endpoint and returns its signing secret exactly once. Redirects and private network destinations are rejected.","security":[{"oauth2":["aune.webhooks.manage"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpoint"},"example":{"url":"https://agent.example/aune/webhooks","event_types":["booking.confirmed","booking.rescheduled","booking.cancelled"]}}}},"responses":{"201":{"description":"Webhook endpoint and signing secret, shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointSuccess"},"example":{"ok":true,"endpoint":{"id":"00000000-0000-4000-8000-000000000201","url":"https://agent.example/aune/webhooks","event_types":["booking.confirmed","booking.rescheduled","booking.cancelled"],"signing_key_id":"2026-07","enabled":true,"created_at":"2026-07-10T10:00:00.000Z","updated_at":"2026-07-10T10:00:00.000Z"},"signing_secret":"whsec_store_this_once","signing_secret_shown_once":true}}}},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}}},"/v1/webhook-endpoints/{endpoint_id}":{"delete":{"tags":["Webhooks"],"operationId":"deleteAuneWebhookEndpointV1","summary":"Delete a caller-owned webhook endpoint","description":"Deletes an endpoint only when it belongs to the authenticated OAuth client.","security":[{"oauth2":["aune.webhooks.manage"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Webhook endpoint deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteWebhookEndpointSuccess"},"example":{"ok":true}}}},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}}},"/v1/webhook-events/{outbox_id}/replay":{"post":{"tags":["Webhooks"],"operationId":"replayAuneWebhookEventV1","summary":"Replay an owned webhook outbox event","description":"Queues a new delivery event only when the original outbox item belongs to the authenticated OAuth client.","security":[{"oauth2":["aune.webhooks.manage"]},{"bearerAuth":[]},{"auneRequestsToken":[]}],"parameters":[{"name":"outbox_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Replay queued with a new event ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayWebhookEventSuccess"},"example":{"ok":true,"replay":{"id":"00000000-0000-4000-8000-000000000302","booking_id":"bkg_01JZEXAMPLE000000000000001","event_type":"booking.confirmed","status":"pending","created_at":"2026-07-10T11:30:00.000Z"}}}}},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"503":{"$ref":"#/components/responses/Problem"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Transitional partner credential or OAuth access token. Public connectors should use OAuth 2.1."},"auneRequestsToken":{"type":"apiKey","in":"header","name":"X-Aune-Requests-Token","description":"Approved partner machine-to-machine credential. Do not expose this header in public clients or user-delegated connectors."},"oauth2":{"type":"oauth2","description":"OAuth 2.1 Authorization Code with mandatory PKCE S256 and rotating refresh tokens.","flows":{"authorizationCode":{"authorizationUrl":"https://aune-homepage-chat.vercel.app/oauth/authorize","tokenUrl":"https://aune-homepage-chat.vercel.app/oauth/token","refreshUrl":"https://aune-homepage-chat.vercel.app/oauth/token","scopes":{"aune.capabilities.read":"Read Aune capability metadata.","aune.bookings.search":"Search data-minimized booking options.","aune.bookings.confirm":"Confirm an explicitly approved option.","aune.bookings.read":"Read caller-owned booking status.","aune.bookings.cancel":"Cancel a caller-owned booking.","aune.bookings.reschedule":"Reschedule a caller-owned booking.","aune.requests.create":"Create a consented provider follow-up request.","aune.webhooks.manage":"Manage signed webhook endpoints and replays."}}}}},"schemas":{"AuneCapabilities":{"type":"object","required":["ok","spec_version","endpoints","lifecycle","booking_lifecycle","supported_verticals"],"properties":{"ok":{"type":"boolean","const":true},"spec_version":{"type":"string","enum":["public_requests_api_v1"]},"endpoints":{"type":"object","required":["search_booking_options","confirm_booking","booking_status","create_request","capabilities"],"properties":{"search_booking_options":{"type":"string"},"confirm_booking":{"type":"string"},"booking_status":{"type":"string"},"create_request":{"type":"string"},"capabilities":{"type":"string"}}},"lifecycle":{"type":"object","description":"Request-only fallback lifecycle. This object never proves a confirmed booking.","additionalProperties":true},"booking_lifecycle":{"type":"object","required":["search","confirm","confirmed_contract","fallback","availability_truth"],"properties":{"search":{"type":"string"},"confirm":{"type":"string"},"confirmed_contract":{"type":"object","required":["booking_created","availability_checked","provider_selected","booking_status"],"properties":{"booking_created":{"type":"boolean","const":true},"availability_checked":{"type":"boolean","const":true},"provider_selected":{"type":"boolean","const":true},"booking_status":{"type":"string","const":"confirmed"}}},"fallback":{"type":"string"},"availability_truth":{"type":"string"}}},"supported_verticals":{"type":"array","items":{"type":"object","required":["vertical_id","label_sv","label_en","job_types"],"properties":{"vertical_id":{"type":"string","enum":["vvs","electrician","moving","cleaning"]},"label_sv":{"type":"string"},"label_en":{"type":"string"},"agent_status":{"type":"string"},"agent_summary":{"type":"string"},"safe_next_step":{"type":"string"},"provider_supply":{"type":"string"},"direct_booking_supply":{"type":"string","const":"search_required"},"fixed_price_service_count":{"type":"integer","minimum":0},"job_types":{"type":"array","items":{"type":"object","required":["job_type_id","label_sv","label_en"],"properties":{"job_type_id":{"type":"string"},"label_sv":{"type":"string"},"label_en":{"type":"string"},"routing_mode":{"type":"string"},"fixed_price_fit":{"type":"string"},"required_signals":{"type":"array","items":{"type":"string"}},"fixed_price_seed":{"type":"object","additionalProperties":true}}}}}}},"unavailable_verticals":{"type":"array","items":{"type":"object","additionalProperties":true}},"auth":{"type":"object","additionalProperties":true},"agent_contract":{"type":"object","additionalProperties":true},"required_fields":{"type":"array","items":{"type":"string"}},"geographic_scope":{"type":"object","additionalProperties":true}}},"SearchPublicBookingOptions":{"type":"object","additionalProperties":false,"required":["vertical_id","job_type_id","description","location","timing"],"allOf":[{"if":{"properties":{"vertical_id":{"const":"moving"},"job_type_id":{"enum":["moving_home","moving_office","moving_piano"]}},"required":["vertical_id","job_type_id"]},"then":{"required":["destination_location"]}},{"if":{"properties":{"vertical_id":{"const":"moving"},"job_type_id":{"const":"moving_home"}},"required":["vertical_id","job_type_id"]},"then":{"required":["details"],"properties":{"details":{"type":"object","required":["home_size_sqm","boxes","elevator_origin","elevator_destination"],"properties":{"home_size_sqm":{"type":"number","exclusiveMinimum":0},"boxes":{"type":"number","minimum":0},"elevator_origin":{"type":"boolean"},"elevator_destination":{"type":"boolean"}}}}}}],"properties":{"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"vertical_id":{"type":"string","enum":["vvs","electrician","moving","cleaning"]},"job_type_id":{"type":"string","minLength":1,"maxLength":120,"description":"Must be one of the job type IDs returned by live capabilities."},"description":{"type":"string","minLength":10,"maxLength":5000},"location":{"$ref":"#/components/schemas/BookingSearchLocation"},"destination_location":{"allOf":[{"$ref":"#/components/schemas/BookingSearchLocation"}],"description":"Required for moving_home, moving_office, and moving_piano."},"timing":{"$ref":"#/components/schemas/PublicRequestTiming"},"details":{"type":"object","additionalProperties":true},"locale":{"type":"string","minLength":2,"maxLength":32,"default":"sv-SE"},"timezone":{"type":"string","minLength":2,"maxLength":80,"default":"Europe/Stockholm"}},"description":"Data-minimized booking search. Use postcodes and optional city names; do not include street address, customer name, email, or phone."},"BookingOption":{"type":"object","required":["booking_option_id","expires_at","provider","service","slot","price","scope","terms"],"properties":{"booking_option_id":{"type":"string","description":"Short-lived tamper-evident option ID. Pass unchanged to booking confirmation."},"expires_at":{"type":"string","format":"date-time"},"provider":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"city":{"type":"string"},"rating_label":{"type":"string"}}},"service":{"type":"object","required":["service_id","vertical_id","job_type_id","label_sv"],"properties":{"service_id":{"type":"string"},"vertical_id":{"type":"string","enum":["vvs","electrician","moving","cleaning"]},"job_type_id":{"type":"string"},"label_sv":{"type":"string"},"label_en":{"type":"string"}}},"slot":{"type":"object","required":["start_at","end_at","label"],"properties":{"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"label":{"type":"string"}}},"price":{"type":"object","required":["amount_sek","currency","pricing_model","price_type"],"properties":{"amount_sek":{"type":"integer","minimum":0},"currency":{"type":"string","const":"SEK"},"pricing_model":{"type":"string"},"price_type":{"type":"string"},"unit_price_sek":{"type":"number","minimum":0},"unit":{"type":"string"},"quantity":{"type":"number","minimum":0}}},"scope":{"type":"object","properties":{"included_sv":{"type":"array","items":{"type":"string"}},"excluded_sv":{"type":"array","items":{"type":"string"}},"customer_requirements_sv":{"type":"array","items":{"type":"string"}},"price_adjustment_triggers_sv":{"type":"array","items":{"type":"string"}},"quote_triggers_sv":{"type":"array","items":{"type":"string"}}}},"terms":{"type":"object","required":["version","url","sections","source_urls"],"properties":{"version":{"type":"string"},"url":{"type":"string","format":"uri"},"sections":{"type":"array","items":{"type":"object","additionalProperties":true}},"source_urls":{"type":"array","items":{"type":"string","format":"uri"}}}}}},"SearchPublicBookingOptionsSuccess":{"type":"object","required":["ok","spec_version","availability_checked","provider_selected","booking_created","direct_booking_available","option_count","options","safe_next_step"],"properties":{"ok":{"type":"boolean","const":true},"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"availability_checked":{"type":"boolean","const":true},"provider_selected":{"type":"boolean","const":false},"booking_created":{"type":"boolean","const":false},"direct_booking_available":{"type":"boolean"},"option_count":{"type":"integer","minimum":0},"options":{"type":"array","items":{"$ref":"#/components/schemas/BookingOption"}},"requested_time_window":{"type":"object","required":["start_at","end_at","label"],"properties":{"start_at":{"type":"string","format":"date-time"},"end_at":{"type":"string","format":"date-time"},"label":{"type":"string"}}},"fallback":{"type":"object","properties":{"type":{"type":"string","const":"provider_follow_up_request"},"endpoint":{"type":"string","format":"uri"},"reason":{"type":"string"}}},"safe_next_step":{"type":"string"}}},"ConfirmPublicBooking":{"type":"object","additionalProperties":false,"required":["booking_option_id","customer","service_location","user_consent_confirmed","booking_terms_accepted","booking_terms_version","booking_terms_accepted_at","idempotency_key"],"properties":{"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"booking_option_id":{"type":"string","minLength":20,"maxLength":24000},"customer":{"$ref":"#/components/schemas/PublicRequestCustomer"},"service_location":{"allOf":[{"$ref":"#/components/schemas/BookingConfirmationLocation"}],"description":"Full service address sent only after consent. Postcode must match the selected option."},"destination_location":{"allOf":[{"$ref":"#/components/schemas/BookingConfirmationLocation"}],"description":"Required when the selected moving option contains destination_location; postcode must match."},"user_consent_confirmed":{"type":"boolean","const":true,"description":"The user explicitly authorized Aune to receive PII and confirm the selected option."},"user_consent_statement":{"type":"string","minLength":8,"maxLength":500},"consent_collected_at":{"type":"string","format":"date-time"},"consent_source":{"type":"string","minLength":1,"maxLength":120},"booking_terms_accepted":{"type":"boolean","const":true},"booking_terms_version":{"type":"string","minLength":8,"maxLength":240,"description":"Must exactly match option.terms.version."},"booking_terms_accepted_at":{"type":"string","format":"date-time"},"source":{"type":"string","minLength":1,"maxLength":80,"default":"external_model"},"external_reference":{"type":"string","minLength":1,"maxLength":160},"idempotency_key":{"type":"string","minLength":1,"maxLength":200}}},"ConfirmedBooking":{"type":"object","required":["id","status","provider_id","provider_name","service_id","slot_start_at","slot_end_at","price_sek","currency","confirmed_at","terms_version"],"properties":{"id":{"type":"string"},"status":{"type":"string","const":"confirmed"},"provider_id":{"type":"string"},"provider_name":{"type":"string"},"service_id":{"type":"string"},"slot_start_at":{"type":"string","format":"date-time"},"slot_end_at":{"type":"string","format":"date-time"},"slot_label":{"type":"string"},"price_sek":{"type":"integer","minimum":0},"currency":{"type":"string","const":"SEK"},"confirmed_at":{"type":"string","format":"date-time"},"terms_version":{"type":"string"},"customer_confirmation_status":{"type":"string","enum":["sent","skipped","failed"]},"provider_confirmation_status":{"type":"string","enum":["sent","skipped","failed"]}}},"ConfirmPublicBookingSuccess":{"type":"object","required":["ok","spec_version","request_id","booking","provider_selected","availability_checked","booking_created","confirmation_delivery","idempotent_replay","safe_next_step"],"properties":{"ok":{"type":"boolean","const":true},"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"request_id":{"type":"string"},"booking":{"$ref":"#/components/schemas/ConfirmedBooking"},"provider_selected":{"type":"boolean","const":true},"availability_checked":{"type":"boolean","const":true},"booking_created":{"type":"boolean","const":true},"confirmation_delivery":{"type":"object","required":["customer","provider"],"properties":{"customer":{"type":"object","additionalProperties":true},"provider":{"type":"object","additionalProperties":true}}},"idempotent_replay":{"type":"boolean"},"safe_next_step":{"type":"string"}}},"PublicBookingStatus":{"oneOf":[{"type":"object","required":["ok","found","booking_id","safe_next_step"],"properties":{"ok":{"type":"boolean","const":true},"found":{"type":"boolean","const":false},"booking_id":{"type":"string"},"safe_next_step":{"type":"string"}}},{"type":"object","required":["ok","found","request_id","booking","provider_selected","availability_checked","booking_created","safe_next_step"],"properties":{"ok":{"type":"boolean","const":true},"found":{"type":"boolean","const":true},"request_id":{"type":"string"},"booking":{"$ref":"#/components/schemas/BookingLifecycleRecord"},"provider_selected":{"type":"boolean","const":true},"availability_checked":{"type":"boolean","const":true},"booking_created":{"type":"boolean","const":true},"safe_next_step":{"type":"string"}}}]},"CreatePublicRequest":{"type":"object","additionalProperties":false,"required":["vertical_id","job_type_id","description","user_consent_confirmed","customer","location","timing"],"properties":{"spec_version":{"type":"string","enum":["public_requests_api_v1"]},"vertical_id":{"type":"string","enum":["vvs","electrician","moving","cleaning"]},"job_type_id":{"type":"string","minLength":1,"maxLength":120,"description":"Must be one of the job type IDs returned by the capabilities endpoint."},"description":{"type":"string","minLength":10,"maxLength":5000},"user_consent_confirmed":{"type":"boolean","const":true,"description":"Must be true. Confirms the end user explicitly agreed that Aune may receive their contact details and request details for provider follow-up."},"user_consent_statement":{"type":"string","minLength":8,"maxLength":500,"description":"Optional consent evidence text shown by the upstream assistant or partner."},"consent_collected_at":{"type":"string","format":"date-time","description":"Optional ISO timestamp for when consent was collected."},"consent_source":{"type":"string","minLength":1,"maxLength":120,"description":"Optional source for consent evidence, such as external_model_conversation, partner_form, or voice_call."},"customer":{"$ref":"#/components/schemas/PublicRequestCustomer"},"location":{"$ref":"#/components/schemas/PublicRequestLocation"},"timing":{"$ref":"#/components/schemas/PublicRequestTiming"},"budget_sek":{"type":"integer","minimum":0,"maximum":10000000},"details":{"type":"object","additionalProperties":true},"customer_next_step":{"type":"string","enum":["home_visit","price_info","contact_me","direct_booking"]},"source":{"type":"string","minLength":1,"maxLength":80,"default":"external_model"},"external_reference":{"type":"string","minLength":1,"maxLength":160},"idempotency_key":{"type":"string","minLength":1,"maxLength":200},"locale":{"type":"string","minLength":2,"maxLength":32,"default":"sv-SE"},"timezone":{"type":"string","minLength":2,"maxLength":80,"default":"Europe/Stockholm"}}},"PublicRequestCustomer":{"type":"object","additionalProperties":false,"required":["phone","email"],"anyOf":[{"required":["name"]},{"required":["first_name","last_name"]}],"properties":{"name":{"type":"string","minLength":2,"maxLength":160},"first_name":{"type":"string","minLength":1,"maxLength":80},"last_name":{"type":"string","minLength":1,"maxLength":80},"phone":{"type":"string","minLength":5,"maxLength":80},"email":{"type":"string","format":"email","maxLength":255}},"description":"Provide either `name` or both `first_name` and `last_name`. Ask for user consent before sending PII."},"PublicRequestLocation":{"type":"object","additionalProperties":false,"anyOf":[{"required":["input"]},{"required":["address"]},{"required":["postcode"]}],"properties":{"input":{"type":"string","minLength":2,"maxLength":500},"address":{"type":"string","minLength":2,"maxLength":500},"postcode":{"type":"string","minLength":3,"maxLength":40}},"description":"Provide `input`, `address`, or `postcode` for a service location in Sweden."},"BookingSearchLocation":{"type":"object","additionalProperties":false,"required":["country_code","postcode"],"properties":{"country_code":{"type":"string","const":"SE"},"postcode":{"type":"string","pattern":"^\\d{3}\\s?\\d{2}$"},"city":{"type":"string","minLength":2,"maxLength":120}},"description":"Data-minimized booking search location. Do not send a street address or customer contact data here."},"BookingConfirmationLocation":{"type":"object","additionalProperties":false,"required":["country_code","address","postcode"],"properties":{"country_code":{"type":"string","const":"SE"},"address":{"type":"string","minLength":4,"maxLength":500},"postcode":{"type":"string","pattern":"^\\d{3}\\s?\\d{2}$"}},"description":"Full service address accepted only during authenticated confirmation after explicit consent."},"PublicRequestTiming":{"type":"object","additionalProperties":false,"anyOf":[{"required":["preferred_time_text"]},{"required":["urgency"]}],"properties":{"preferred_time_text":{"type":"string","minLength":2,"maxLength":500},"urgency":{"type":"string","minLength":2,"maxLength":240}},"description":"Provide `preferred_time_text` or `urgency`."},"CreatePublicRequestSuccess":{"type":"object","required":["ok","spec_version","request","booking_created","availability_checked","provider_selected","safe_next_step"],"properties":{"ok":{"type":"boolean","const":true},"spec_version":{"type":"string","enum":["public_requests_api_v1"]},"request":{"type":"object","required":["id","session_id","status","vertical_id","job_type_id","taxonomy_confidence","customer_next_step","candidate_provider_count","provider_candidates"],"properties":{"id":{"type":"string"},"session_id":{"type":"string"},"status":{"type":"string"},"vertical_id":{"type":"string","enum":["vvs","electrician","moving","cleaning"]},"job_type_id":{"type":"string"},"taxonomy_confidence":{"type":"string"},"customer_next_step":{"type":"string"},"booking_mode":{"type":"string"},"candidate_provider_count":{"type":"integer","minimum":0},"provider_candidates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"can_receive_request":{"type":"boolean"},"direct_booking":{"type":"boolean"}}}},"persistence_status":{"type":"string"},"persistence_backend":{"type":"string"}}},"booking_created":{"type":"boolean","const":false,"description":"False unless a future downstream booking system explicitly confirms a booking."},"availability_checked":{"type":"boolean","const":false,"description":"False unless a future downstream availability system explicitly checks provider availability."},"provider_selected":{"type":"boolean","const":false,"description":"False unless Aune explicitly selects or confirms a provider."},"safe_next_step":{"type":"string","description":"Recommended end-user copy or close paraphrase for external assistants."}}},"PublicRequestError":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"status":{"type":"integer"},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}},"accepted_job_type_ids":{"type":"array","items":{"type":"string"}},"supported_vertical_ids":{"type":"array","items":{"type":"string","enum":["vvs","electrician","moving","cleaning"]}},"consent_required_before_create":{"type":"boolean","description":"True when create was rejected because explicit user consent was missing or false."},"option_refresh_required":{"type":"boolean","description":"True when the assistant must search fresh booking options before retrying confirmation."},"safe_next_step":{"type":"string","description":"Safe recovery instruction for validation failures that need user action."}}},"Problem":{"type":"object","required":["type","title","status","detail","instance","code","ok","api_request_id","trace_id","contract_version","server_time"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"instance":{"type":"string"},"code":{"type":"string","pattern":"^[a-z0-9_]+$"},"ok":{"type":"boolean","const":false},"error":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}},"safe_next_step":{"type":"string"},"option_refresh_required":{"type":"boolean"},"api_request_id":{"type":"string","format":"uuid"},"trace_id":{"type":"string","pattern":"^[a-f0-9]{32}$"},"contract_version":{"type":"string"},"server_time":{"type":"string","format":"date-time"}}},"CancelPublicBooking":{"type":"object","additionalProperties":false,"required":["user_confirmation_confirmed","reason","idempotency_key"],"properties":{"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"user_confirmation_confirmed":{"type":"boolean","const":true},"reason":{"type":"string","enum":["customer_changed_mind","timing_no_longer_works","booked_elsewhere","service_no_longer_needed","other"]},"notes":{"type":"string","minLength":2,"maxLength":500},"idempotency_key":{"type":"string","minLength":1,"maxLength":200}}},"CancelPublicBookingSuccess":{"type":"object","required":["ok","booking_id","status","cancelled_at","current_confirmation_active","idempotent_replay"],"properties":{"ok":{"type":"boolean","const":true},"booking_id":{"type":"string"},"status":{"type":"string","const":"cancelled"},"cancelled_at":{"type":"string","format":"date-time"},"booking_created":{"type":"boolean","const":true},"current_confirmation_active":{"type":"boolean","const":false},"idempotent_replay":{"type":"boolean"},"notification_delivery":{"type":"object","additionalProperties":true},"safe_next_step":{"type":"string"}}},"ReschedulePublicBooking":{"type":"object","additionalProperties":false,"required":["booking_option_id","service_location","user_confirmation_confirmed","booking_terms_accepted","booking_terms_version","booking_terms_accepted_at","idempotency_key"],"properties":{"spec_version":{"type":"string","enum":["public_bookings_api_v1"]},"booking_option_id":{"type":"string","minLength":20,"maxLength":24000},"service_location":{"$ref":"#/components/schemas/BookingConfirmationLocation"},"destination_location":{"$ref":"#/components/schemas/BookingConfirmationLocation"},"user_confirmation_confirmed":{"type":"boolean","const":true},"booking_terms_accepted":{"type":"boolean","const":true},"booking_terms_version":{"type":"string","minLength":8,"maxLength":240},"booking_terms_accepted_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string","minLength":1,"maxLength":200}}},"ReschedulePublicBookingSuccess":{"type":"object","required":["ok","booking","booking_created","current_confirmation_active","provider_selected","availability_checked","rescheduled_at","idempotent_replay"],"properties":{"ok":{"type":"boolean","const":true},"booking":{"$ref":"#/components/schemas/ConfirmedBooking"},"booking_created":{"type":"boolean","const":true},"current_confirmation_active":{"type":"boolean","const":true},"provider_selected":{"type":"boolean","const":true},"availability_checked":{"type":"boolean","const":true},"rescheduled_at":{"type":"string","format":"date-time"},"idempotent_replay":{"type":"boolean"},"notification_delivery":{"type":"object","additionalProperties":true},"safe_next_step":{"type":"string"}}},"CreateWebhookEndpoint":{"type":"object","additionalProperties":false,"required":["url","event_types"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://"},"event_types":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["booking.confirmed","booking.rescheduled","booking.cancelled","booking.provider_action_required"]}}}},"WebhookEndpoint":{"type":"object","required":["id","url","event_types","signing_key_id","enabled","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"event_types":{"type":"array","items":{"type":"string","enum":["booking.confirmed","booking.rescheduled","booking.cancelled","booking.provider_action_required"]}},"signing_key_id":{"type":"string"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WebhookEndpointList":{"type":"object","required":["ok","endpoints"],"properties":{"ok":{"type":"boolean","const":true},"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"CreateWebhookEndpointSuccess":{"type":"object","required":["ok","endpoint","signing_secret","signing_secret_shown_once"],"properties":{"ok":{"type":"boolean","const":true},"endpoint":{"$ref":"#/components/schemas/WebhookEndpoint"},"signing_secret":{"type":"string","description":"Shown exactly once; store it as a secret."},"signing_secret_shown_once":{"type":"boolean","const":true}}},"DeleteWebhookEndpointSuccess":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true}}},"ReplayWebhookEventSuccess":{"type":"object","required":["ok","replay"],"properties":{"ok":{"type":"boolean","const":true},"replay":{"type":"object","required":["id","booking_id","event_type","status","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"booking_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","const":"pending"},"created_at":{"type":"string","format":"date-time"}}}}},"BookingLifecycleRecord":{"type":"object","required":["id","status","provider_id","provider_name","service_id","slot_start_at","slot_end_at","price_sek","currency","confirmed_at","terms_version"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["confirmed","cancelled"]},"provider_id":{"type":"string"},"provider_name":{"type":"string"},"service_id":{"type":"string"},"slot_start_at":{"type":"string","format":"date-time"},"slot_end_at":{"type":"string","format":"date-time"},"slot_label":{"type":"string"},"price_sek":{"type":"integer","minimum":0},"currency":{"type":"string","const":"SEK"},"confirmed_at":{"type":"string","format":"date-time"},"terms_version":{"type":"string"},"customer_confirmation_status":{"type":"string","enum":["sent","skipped","failed"]},"provider_confirmation_status":{"type":"string","enum":["sent","skipped","failed"]}}}},"parameters":{"BookingId":{"name":"booking_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The canonical booking ID returned by confirmation."}},"responses":{"Problem":{"description":"Machine-readable API problem with a stable code and recovery guidance.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"},"example":{"type":"https://aune-homepage-chat.vercel.app/problems/booking_option_expired","title":"Booking option expired","status":409,"detail":"The selected booking option expired. Search again and ask the user to choose a fresh option.","instance":"/v1/bookings","code":"booking_option_expired","ok":false,"option_refresh_required":true,"safe_next_step":"Search fresh booking options and obtain a new explicit choice.","api_request_id":"00000000-0000-4000-8000-000000000401","trace_id":"0123456789abcdef0123456789abcdef","contract_version":"public_bookings_api_v1","server_time":"2026-07-10T10:16:00.000Z"}}}}}},"x-aune-agent-guidance":{"use_when":"The user wants to book or hand off a supported home service in Sweden for Plumbing/VVS, Electricians, Moving, Cleaning.","bookable_public_request_vertical_ids":["vvs","electrician","moving","cleaning"],"non_bookable_note":"Painting, carpentry, and gardening must not be submitted through the public request create endpoint unless live capabilities later mark them bookable.","do_not_claim":["Do not say a booking is confirmed unless Aune returns booking_created: true and booking.status: confirmed.","Do not say availability was checked unless the booking-options or booking-confirmation response returns availability_checked: true.","Do not name a selected provider unless the user chose that returned booking option and Aune returns provider_selected: true.","Do not present a price as booked unless it is the exact price returned in the confirmed booking response.","Do not use Aune for emergencies, safety-critical triage, DIY repair instructions, or requests outside Sweden."],"next_step":"Search booking options with postcodes before sending street addresses or customer contact data. Claim a confirmed booking only when confirmation returns booking_created:true and booking.status:confirmed. Otherwise follow the returned safe_next_step or use request capture as fallback.","docs":{"llms":"https://aune-homepage-chat.vercel.app/llms.txt","full":"https://aune-homepage-chat.vercel.app/llms-full.txt","use_aune":"https://aune-homepage-chat.vercel.app/ai/use-aune.md","examples":"https://aune-homepage-chat.vercel.app/ai/examples.md","mcp_quickstart":"https://aune-homepage-chat.vercel.app/ai/mcp-quickstart.md"}}}