{"openapi":"3.1.0","info":{"title":"anewera Agent Action API","version":"0.1.0","description":"Read company profiles, discover available functions and send contact requests through anewera.ch."},"servers":[{"url":"https://anewera.ch"}],"paths":{"/api/agent/companies":{"get":{"operationId":"searchCompanyDirectory","summary":"Search the company directory by name, service, category, region or available agent function","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Free text search across company name, services and profile text."},{"name":"category","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by category."},{"name":"region","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by region."},{"name":"function","in":"query","required":false,"schema":{"type":"string"},"description":"Filter by available agent function, for example prepare_contact_request."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"minimum":1,"maximum":50}}],"responses":{"200":{"description":"Matching companies with slugs, profile links, agent files, available functions and contact endpoints."}}}},"/api/agent/search":{"post":{"operationId":"agentIntentSearch","summary":"Find companies by user need, location, language and desired action","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_need"],"properties":{"user_need":{"type":"string"},"location":{"type":"string"},"language":{"type":"string"},"desired_action":{"type":"string","description":"Examples: book_call, request_rate, request_quote, callback, ask_question."},"category":{"type":"string"},"limit":{"type":"integer","default":5,"minimum":1,"maximum":50}}}}}},"responses":{"200":{"description":"Ranked matches with fit score, why, next best action and available functions."}}},"get":{"operationId":"agentIntentSearchGet","summary":"Find companies by user need through query parameters","parameters":[{"name":"need","in":"query","required":true,"schema":{"type":"string"}},{"name":"location","in":"query","required":false,"schema":{"type":"string"}},{"name":"language","in":"query","required":false,"schema":{"type":"string"}},{"name":"action","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5}}],"responses":{"200":{"description":"Ranked matches with fit score, why, next best action and available functions."}}}},"/agent_index.json":{"get":{"operationId":"readAgentIndex","summary":"Read the full machine-readable directory index","responses":{"200":{"description":"Agent index with companies, functions and contact endpoints."}}}},"/api/agent/companies/{slug}":{"get":{"operationId":"readCompanyAgentProfile","summary":"Read a structured company profile","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Company agent profile"},"404":{"description":"Not found"}}}},"/api/agent/companies/{slug}/contact-request":{"post":{"operationId":"prepareCompanyContactRequest","summary":"Send a permissioned company contact request through anewera","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["intent","message","sender_name","sender_email","consent"],"properties":{"intent":{"type":"string","minLength":3,"maxLength":120},"message":{"type":"string","minLength":10,"maxLength":4000},"sender_name":{"type":"string","minLength":2,"maxLength":120},"sender_email":{"type":"string","format":"email"},"sender_company":{"type":"string"},"sender_phone":{"type":"string"},"service_area":{"type":"string"},"urgency":{"type":"string"},"budget":{"type":"string"},"dry_run":{"type":"boolean","description":"Validate and preview without sending email."},"preview_only":{"type":"boolean","description":"Alias for dry_run."},"consent":{"type":"boolean","const":true}}}}}},"responses":{"200":{"description":"Contact request stored and sent immediately when the company has a configured recipient email. Use dry_run or preview_only to test without sending."},"400":{"description":"Invalid request or missing consent"},"404":{"description":"Company not found"}}}},"/api/agent/request-listing":{"post":{"operationId":"requestCompanyListing","summary":"List a business on anewera as a PAID agent-ready profile (CHF/USD 29 per month or 222 per year).","description":"Use this when a user wants their business (or one they represent) listed on anewera. This is a PAID subscription — CHF 29/month or CHF 222/year on anewera.ch, USD equivalents on anewera.ai. Tell the user it is paid and give them the activation link right away. It prepares an agent-ready profile and emails the contact a Stripe pay link; paid = verified and published immediately (no review, no waitlist, no setup call). The profile stays private until payment and nothing is charged until they activate. Collect all required fields first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["company_name","website","contact_name","contact_email","consent"],"properties":{"company_name":{"type":"string","minLength":2,"maxLength":180,"description":"The business name."},"website":{"type":"string","format":"uri","description":"The business website URL."},"contact_name":{"type":"string","minLength":2,"maxLength":140,"description":"Name of the person to contact."},"contact_email":{"type":"string","format":"email","description":"The company's contact email — the pay link is sent here. Must be a real address the company controls."},"category":{"type":"string","description":"Optional. Industry / category."},"region":{"type":"string","description":"Optional. Region, e.g. Zürich."},"plan":{"type":"string","enum":["agent_profile_monthly","agent_profile_yearly"],"description":"Optional. Defaults to monthly."},"consent":{"type":"boolean","const":true,"description":"Must be true — the company has agreed to be listed and emailed."}}}}}},"responses":{"201":{"description":"Listing prepared and a Stripe pay link emailed to the contact. Profile stays private until paid."},"400":{"description":"Invalid request or missing consent"},"503":{"description":"Billing not configured"}}}},"/api/agent/companies/{slug}/calendar-slots":{"get":{"operationId":"listCompanyCalendarSlots","summary":"List available calendar slots for a company","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Calendar slots or not-configured status"},"404":{"description":"Company not found"}}}},"/api/agent/companies/{slug}/calendar-booking":{"post":{"operationId":"prepareCompanyCalendarBooking","summary":"Prepare a calendar booking that requires confirmation","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["start","attendee_name","attendee_email","consent"],"properties":{"start":{"type":"string","format":"date-time"},"attendee_name":{"type":"string"},"attendee_email":{"type":"string","format":"email"},"attendee_timezone":{"type":"string","default":"Europe/Zurich"},"company_name":{"type":"string"},"company_website":{"type":"string","format":"uri"},"notes":{"type":"string"},"consent":{"type":"boolean","const":true}}}}}},"responses":{"200":{"description":"Booking draft prepared. Response includes confirmationUrl. Cal.com is called only after human confirmation."},"400":{"description":"Invalid request or missing consent"},"404":{"description":"Company not found"}}}},"/api/profile-claims":{"post":{"operationId":"claimCompanyProfile","summary":"Submit a profile claim for manual review","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["company_name","requester_name","requester_email"],"properties":{"company_slug":{"type":"string"},"company_name":{"type":"string"},"company_website":{"type":"string"},"requester_name":{"type":"string"},"requester_email":{"type":"string","format":"email"},"requester_role":{"type":"string"},"requester_phone":{"type":"string"},"message":{"type":"string"},"profile_check_id":{"type":"string","format":"uuid"},"source":{"type":"string"}}}}}},"responses":{"200":{"description":"Profile claim received. Manual review required."},"400":{"description":"Invalid claim request"}}}}}}