{"openapi":"3.1.0","info":{"title":"Peerbots API","description":"\nWelcome to the Peerbots API!\n\nTo request an API key, please fill out the [API Key Request Form](https://forms.gle/eXDdye1mobhzQX4AA). If you don't hear back from us within a few days, please reach out to team@peerbots.org or fill out our contact form at [peerbots.org/contact](peerbots.org/contact)\n\nWhen using the API, make sure you specify the version number in the URL. \n\nYou can use the interface below at /docs to try out the API but please make sure you are authenticated by selecting \"Authorize\" in the top right corner.\n","version":"1.0.0"},"paths":{"/v1/publish":{"post":{"summary":"Publish message to channel (REST Fallback)","description":"Publish a message to all active WebSocket clients on a channel via REST.\nUsed by controllers and integrations when direct WebSocket transport is unavailable.","operationId":"publish_message_v1_publish_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional Authorization header with Bearer token or API key","title":"Authorization"},"description":"Optional Authorization header with Bearer token or API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Publish Message V1 Publish Post"}}}},"401":{"description":"Unauthorized - Missing or invalid credentials"},"403":{"description":"Forbidden - Insufficient permissions for channel"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook/{channel}":{"post":{"summary":"Inbound Webhook Receiver","description":"Inbound webhook receiver allowing external services (LLMs, hardware buttons, IoT sensors, IFTTT)\nto push actions directly to a robot channel without keeping an open WebSocket connection.","operationId":"webhook_receiver_v1_webhook__channel__post","parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","title":"Channel"}},{"name":"x-webhook-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional webhook validation secret","title":"X-Webhook-Secret"},"description":"Optional webhook validation secret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"examples":[{"speech":"Hello there!","emotion":"happy"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"401":{"description":"Unauthorized - Missing or invalid credentials"},"403":{"description":"Forbidden - Insufficient permissions for channel"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/channels/{channel}/presence":{"get":{"summary":"Query active channel presence","description":"Retrieves the list and count of active occupants currently connected to a channel room.","operationId":"get_channel_presence_v1_channels__channel__presence_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","title":"Channel"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional Authorization header with Bearer token or API key","title":"Authorization"},"description":"Optional Authorization header with Bearer token or API key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresenceResponse"}}}},"401":{"description":"Unauthorized - Missing or invalid credentials"},"403":{"description":"Forbidden - Insufficient permissions for channel"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/":{"get":{"summary":"Get V1 Home","description":"Welcome to V1. Returns a welcome message.","operationId":"get_v1_home_v1__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"}}}},"/v1/me":{"get":{"summary":"Get V1 Me","description":"Check Authenticated User. Try this request to confirm your API key works and to check the email and username associated with the API key.","operationId":"get_v1_me_v1_me_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional Authorization header with Bearer token or API key","title":"Authorization"},"description":"Optional Authorization header with Bearer token or API key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/send-message/{username}":{"post":{"summary":"Send Message","description":"Send a Peerbots Message to a channel with knock-on-send approval.","operationId":"send_message_v1_send_message__username__post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"caller_as","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Specify caller identifier: 'email' (default) or 'username'","title":"Caller As"},"description":"Specify caller identifier: 'email' (default) or 'username'"},{"name":"caller","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for caller_as","title":"Caller"},"description":"Alias for caller_as"},{"name":"call_as","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Alias for caller_as","title":"Call As"},"description":"Alias for caller_as"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional Authorization header with Bearer token or API key","title":"Authorization"},"description":"Optional Authorization header with Bearer token or API key"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeerbotsMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Health check probe","description":"Health check endpoint used by Google Cloud Run and uptime monitors.","operationId":"get_health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["System"],"summary":"API Root","description":"The root directory that provides a welcome message","operationId":"get_api_home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PeerbotsColor":{"type":"string","enum":["Light Blue","Blue","Green","Red","Purple","Pink","Yellow","Orange","Grey","Black","White"],"title":"PeerbotsColor"},"PeerbotsEmotion":{"type":"string","enum":["Neutral","Surprised","Happy","Sad","Concerned","Sleepy"],"title":"PeerbotsEmotion"},"PeerbotsMessage":{"properties":{"title":{"type":"string","title":"Title","default":""},"speech":{"type":"string","title":"Speech","default":""},"color":{"$ref":"#/components/schemas/PeerbotsColor","default":"Green"},"emotion":{"$ref":"#/components/schemas/PeerbotsEmotion","default":"Happy"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"PeerbotsMessage","description":"Payload definition specifically for 'message' type robot speech/emotion frames."},"PresenceResponse":{"properties":{"channel":{"type":"string","title":"Channel"},"occupants":{"items":{"type":"string"},"type":"array","title":"Occupants"},"occupant_count":{"type":"integer","title":"Occupant Count"}},"type":"object","required":["channel","occupants","occupant_count"],"title":"PresenceResponse"},"PublishRequest":{"properties":{"channel":{"type":"string","title":"Channel","description":"Target channel or username to broadcast to","example":"robot_user_123"},"message":{"title":"Message","description":"Message payload object or JSON string","example":{"speech":"Hello","type":"syncFaceSettings"}}},"type":"object","required":["channel","message"],"title":"PublishRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookResponse":{"properties":{"status":{"type":"string","title":"Status"},"channel":{"type":"string","title":"Channel"},"occupants":{"type":"integer","title":"Occupants"}},"type":"object","required":["status","channel","occupants"],"title":"WebhookResponse"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}