{"openapi":"3.1.0","info":{"title":"GreetWise Zapier API","version":"1.0.0","summary":"The API the GreetWise Zapier integration uses to authenticate, subscribe to events, and load sample data.","description":"GreetWise sends call, contact, and booking events to Zapier. These endpoints let the Zapier integration check an API key, register and remove REST Hook subscriptions, and fetch recent events for the Zap editor. Human-readable docs: https://greetwise.ai/developers/zapier","contact":{"name":"GreetWise Support","email":"support@greetwise.ai","url":"https://greetwise.ai/support"}},"servers":[{"url":"https://api.greetwise.ai","description":"Production"}],"security":[{"ApiKeyHeader":[]},{"BearerApiKey":[]}],"tags":[{"name":"Authentication","description":"Confirm an API key works."},{"name":"Subscriptions","description":"REST Hook subscribe and unsubscribe, called when a Zap is turned on or off."},{"name":"Sample data","description":"Recent events, used by the Zap editor to test a trigger."},{"name":"Webhooks","description":"Payloads GreetWise POSTs to a subscribed target_url."}],"paths":{"/zapier/v1/auth-test":{"get":{"operationId":"authTest","tags":["Authentication"],"summary":"Test an API key","description":"Zapier calls this when a user connects their GreetWise account. Returns the organization the key belongs to.","responses":{"200":{"description":"The key is valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTestResponse"},"example":{"organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","connected":true}}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}},"/zapier/v1/hooks":{"post":{"operationId":"subscribe","tags":["Subscriptions"],"summary":"Subscribe to a trigger","description":"Called when a user turns on a Zap. GreetWise stores the target_url and POSTs each new matching event to it (see Webhooks). An organization can have several subscriptions to the same event.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"},"example":{"event":"new_call","target_url":"https://hooks.zapier.com/hooks/standard/123456/abcdef/"}}}},"responses":{"201":{"description":"Subscription created. Keep the id to unsubscribe later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"},"example":{"id":"e41b7c90-2d5f-4a83-9e6c-1f0a8b3d7c52","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","event":"new_call","targetUrl":"https://hooks.zapier.com/hooks/standard/123456/abcdef/","createdAt":"2026-09-30T17:30:00.000Z"}}}},"400":{"description":"The event is not one of the supported values, or target_url is not a URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":400,"message":["event must be one of the following values: new_call, new_contact, new_booking"],"error":"Bad Request"}}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}},"/zapier/v1/hooks/{id}":{"delete":{"operationId":"unsubscribe","tags":["Subscriptions"],"summary":"Unsubscribe","description":"Called when a user turns off or deletes a Zap. Succeeds even if the subscription was already removed, so it is safe to retry.","parameters":[{"name":"id","in":"path","required":true,"description":"The id returned when subscribing.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Subscription removed (or did not exist).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"},"example":{"success":true}}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}},"/zapier/v1/new-calls":{"get":{"operationId":"listNewCalls","tags":["Sample data"],"summary":"List recent completed calls","description":"Sample data for the New Completed Call trigger. Same shape as the new_call webhook.","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Most recent events first. An empty array if there are none yet.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CallEvent"}},"example":[{"id":"6f1c2a9e-3b7d-4f0a-9c51-2d8e7b4a1f03","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","callerPhone":"+15551234567","callerName":"Jane Smith","durationSeconds":87,"summary":"Caller asked about office hours and was told they are 9am–5pm Monday through Friday.","occurredAt":"2026-09-30T17:42:10.512Z"}]}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}},"/zapier/v1/new-contacts":{"get":{"operationId":"listNewContacts","tags":["Sample data"],"summary":"List recent new contacts","description":"Sample data for the New Contact trigger. Same shape as the new_contact webhook.","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Most recent events first. An empty array if there are none yet.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContactEvent"}},"example":[{"id":"b8d40e17-6c2a-4b9f-a0e3-5f71c8d2e946","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","name":"Jane Smith","phone":"+15551234567","email":null,"occurredAt":"2026-09-30T17:41:02.118Z"}]}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}},"/zapier/v1/new-bookings":{"get":{"operationId":"listNewBookings","tags":["Sample data"],"summary":"List recent bookings","description":"Sample data for the New Appointment Booked trigger. Same shape as the new_booking webhook.","parameters":[{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Most recent events first. An empty array if there are none yet.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BookingEvent"}},"example":[{"id":"d2a7f5c3-91e4-4d6b-b8a0-3c5e7f9a1b24","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","date":"2026-10-07","time":"10:00 AM","callerName":"Jane Smith","confirmationNumber":"GW-00123","phone":"+15551234567","email":"jane@example.com","occurredAt":"2026-09-30T17:43:55.904Z"}]}}},"401":{"description":"The API key is missing, invalid, or has been revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"statusCode":401,"message":"Invalid API key","error":"Unauthorized"}}}}}}}},"webhooks":{"new_call":{"post":{"operationId":"newCallWebhook","tags":["Webhooks"],"summary":"New completed call","description":"Sent when a call answered by GreetWise ends.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallEvent"},"example":{"id":"6f1c2a9e-3b7d-4f0a-9c51-2d8e7b4a1f03","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","callerPhone":"+15551234567","callerName":"Jane Smith","durationSeconds":87,"summary":"Caller asked about office hours and was told they are 9am–5pm Monday through Friday.","occurredAt":"2026-09-30T17:42:10.512Z"}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges delivery."}}}},"new_contact":{"post":{"operationId":"newContactWebhook","tags":["Webhooks"],"summary":"New contact","description":"Sent when GreetWise creates a contact from a caller during a call. Contacts added by hand in the dashboard are not sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEvent"},"example":{"id":"b8d40e17-6c2a-4b9f-a0e3-5f71c8d2e946","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","name":"Jane Smith","phone":"+15551234567","email":null,"occurredAt":"2026-09-30T17:41:02.118Z"}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges delivery."}}}},"new_booking":{"post":{"operationId":"newBookingWebhook","tags":["Webhooks"],"summary":"New appointment booked","description":"Sent when GreetWise books an appointment for a caller.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingEvent"},"example":{"id":"d2a7f5c3-91e4-4d6b-b8a0-3c5e7f9a1b24","organizationId":"a3e9b0c4-58d2-4e1f-8a6b-0c7d9e2f4b15","date":"2026-10-07","time":"10:00 AM","callerName":"Jane Smith","confirmationNumber":"GW-00123","phone":"+15551234567","email":"jane@example.com","occurredAt":"2026-09-30T17:43:55.904Z"}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges delivery."}}}}},"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"The API key from Integrations → Zapier in the GreetWise app. Keys start with zap_."},"BearerApiKey":{"type":"http","scheme":"bearer","description":"The same API key, sent as Authorization: Bearer <key>."}},"parameters":{"Limit":{"name":"limit","in":"query","required":false,"description":"How many events to return. Defaults to 10, maximum 50.","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}},"schemas":{"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"AuthTestResponse":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid","description":"The GreetWise organization the key belongs to."},"connected":{"type":"boolean","const":true}},"required":["organizationId","connected"]},"TriggerEvent":{"type":"string","enum":["new_call","new_contact","new_booking"]},"SubscribeRequest":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/TriggerEvent"},"target_url":{"type":"string","format":"uri","description":"Where GreetWise should POST events (the Zap's hook URL)."}},"required":["event","target_url"]},"Subscription":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"event":{"$ref":"#/components/schemas/TriggerEvent"},"targetUrl":{"type":"string","format":"uri"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","event","targetUrl","createdAt"]},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","const":true}},"required":["success"]},"CallEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique event id. Use it to de-duplicate."},"organizationId":{"type":"string","format":"uuid"},"callerPhone":{"type":["string","null"],"description":"Caller phone number in E.164 format."},"callerName":{"type":["string","null"],"description":"Caller name, if GreetWise learned it."},"durationSeconds":{"type":"integer","description":"Call length in seconds."},"summary":{"type":["string","null"],"description":"AI-written summary of the call."},"occurredAt":{"type":"string","format":"date-time","description":"When the event happened (ISO 8601, UTC)."}},"required":["id","organizationId","callerPhone","callerName","durationSeconds","summary","occurredAt"]},"ContactEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique event id. Use it to de-duplicate."},"organizationId":{"type":"string","format":"uuid"},"name":{"type":["string","null"],"description":"Contact name."},"phone":{"type":["string","null"],"description":"Phone number in E.164 format."},"email":{"type":["string","null"],"description":"Email address, if the caller gave one."},"occurredAt":{"type":"string","format":"date-time","description":"When the event happened (ISO 8601, UTC)."}},"required":["id","organizationId","name","phone","email","occurredAt"]},"BookingEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"Unique event id. Use it to de-duplicate."},"organizationId":{"type":"string","format":"uuid"},"date":{"type":"string","description":"Appointment date (YYYY-MM-DD), in the business's timezone."},"time":{"type":"string","description":"Appointment start time, e.g. \"10:00 AM\", in the business's timezone."},"callerName":{"type":"string","description":"Name the appointment was booked under."},"confirmationNumber":{"type":["string","null"],"description":"Confirmation number given to the caller."},"phone":{"type":["string","null"],"description":"Caller phone number in E.164 format."},"email":{"type":["string","null"],"description":"Caller email, if they gave one."},"occurredAt":{"type":"string","format":"date-time","description":"When the event happened (ISO 8601, UTC)."}},"required":["id","organizationId","date","time","callerName","confirmationNumber","phone","email","occurredAt"]}}}}