{"openapi":"3.1.0","info":{"title":"Asoma platform API","version":"1.0.0","description":"What a platform calls with its own token: get a token, manage installations and tours, rooms, captures and read usage. Every /v1 route is scoped to the platform in the token. Errors are always { \"error\": \"<code>\" }. Bodies of stored rows are listed where the API defines their fields; an object described without properties is not specified here."},"servers":[{"url":"https://api.asoma.com.co"}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"installations:read":"Read an installation.","installations:write":"Activate or deactivate an installation.","tours:read":"Read a property's tour and rooms, and open a preview link.","tours:write":"Create, edit, publish, unpublish or discard a tour, and manage its rooms.","captures:write":"Start, upload, read, complete or abort a capture, and mint a capture link.","usage:read":"Read the platform's usage."}}}}},"schemas":{"Installation":{"type":"object","description":"A property's installation for the platform.","properties":{"id":{"type":"string"},"external_account_id":{"type":"string"},"external_property_id":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"activated_at":{"type":"integer","description":"Unix seconds."},"deactivated_at":{"type":["integer","null"],"description":"Unix seconds."},"purge_after":{"type":["integer","null"],"description":"Unix seconds."}}},"Room":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"position":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3}},"required":["name","position"],"additionalProperties":false},"Cta":{"type":"object","description":"The call to action a guest sees. The url must be https and carry no credentials.","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","format":"uri","maxLength":2048}},"required":["label","url"],"additionalProperties":false},"TourFields":{"type":"object","description":"All fields are optional. A present field replaces the stored one, null clears it, an absent field keeps it.","properties":{"title":{"type":["string","null"],"maxLength":200},"rooms":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Room"},"minItems":1,"maxItems":50},"cta":{"oneOf":[{"$ref":"#/components/schemas/Cta"},{"type":"null"}]}}},"Tour":{"type":"object","properties":{"id":{"type":"string"},"installation_id":{"type":"string"},"status":{"type":"string","enum":["draft","processing","ready","published","failed"]},"title":{"type":["string","null"]},"poster_key":{"type":["string","null"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"},"published_at":{"type":["integer","null"]},"has_unpublished_changes":{"type":"boolean"},"in_review":{"type":"boolean","description":"Publishing waits for staff review."},"hidden":{"type":"boolean","description":"Hidden from visitors until staff restore it."},"rooms":{"type":"array","items":{"$ref":"#/components/schemas/Room"},"description":"Present only once set."},"cta":{"$ref":"#/components/schemas/Cta","description":"Present only once set."}}},"TourRoom":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"status":{"type":"string","enum":["empty","processing","ready","failed"]},"failure_reason":{"type":["string","null"]},"updated_at":{"type":"integer"},"live":{"type":"boolean"},"changed":{"type":"boolean"},"in_review":{"type":"boolean"}}},"Capture":{"type":"object","properties":{"id":{"type":"string"},"tour_id":{"type":"string"},"status":{"type":"string","enum":["uploading","complete","aborted"]},"content_type":{"type":"string"},"created_at":{"type":"integer"},"completed_at":{"type":["integer","null"]},"size_bytes":{"type":["integer","null"]},"room_id":{"type":"string","description":"Present only for a room's capture."}}},"UsageRow":{"type":"object","description":"Fields of the usage ledger rows as grouped by the query; the kinds are not enumerated here.","properties":{"external_account_id":{"type":"string","description":"Per-property rows only."},"external_property_id":{"type":"string","description":"Per-property rows only."},"kind":{"type":"string"},"quantity":{"type":"number"}}}}},"paths":{"/oauth/token":{"post":{"summary":"Get an access token","description":"OAuth 2 client credentials. Send the client id and secret as HTTP Basic or as client_id and client_secret form fields. The token lasts at most 15 minutes and carries the scopes of the platform's contract. The response is never cached.","security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"const":"client_credentials"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}}}}},"responses":{"200":{"description":"A bearer token.","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"const":"Bearer"},"expires_in":{"type":"integer","description":"Seconds."},"scope":{"type":"string","description":"Space separated."}}}}}},"400":{"description":"The body is not a form, or the grant type is not client_credentials.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_request","unsupported_grant_type"]}}}}}},"401":{"description":"Unknown client or wrong secret.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_client"]}}}}}},"403":{"description":"The platform's contract is not active.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["unauthorized_client"]},"error_description":{"type":"string"}}}}}}}}},"/.well-known/jwks.json":{"get":{"summary":"Public keys that verify the tokens","description":"Cacheable for five minutes. Holds the signing key and, while it rotates out, the previous one.","security":[],"responses":{"200":{"description":"A JSON Web Key Set.","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/installation":{"put":{"summary":"Activate an installation","description":"Idempotent. Creates the installation or reactivates it.","security":[{"oauth2":["installations:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The installation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Installation"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"409":{"description":"A sandbox platform holds at most 5 active installations.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["sandbox_limit"]}}}}}}}},"delete":{"summary":"Deactivate an installation","description":"Idempotent.","security":[{"oauth2":["installations:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}}}},"get":{"summary":"Read an installation","description":"","security":[{"oauth2":["installations:read"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The installation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Installation"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No installation for that property.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour":{"put":{"summary":"Create a tour or update its fields","description":"The body is optional. Creating needs no body; a first publish needs a call to action.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tour"}}}},"400":{"description":"The body is not valid JSON or a field is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_body"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"The installation is not active.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"A call to action is required.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["cta_required"]}}}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TourFields"}}}}},"get":{"summary":"Read the tour","description":"","security":[{"oauth2":["tours:read"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tour"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No tour for that property.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/publish":{"post":{"summary":"Publish the tour","description":"A repeat with nothing to publish answers 200 and writes nothing.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tour"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"Not publishable yet.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["cta_required","rooms_not_ready","in_review","invalid_transition"]},"status":{"type":"string"}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/unpublish":{"post":{"summary":"Unpublish the tour","description":"Moves a published tour back to ready.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour, now ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tour"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The tour cannot move to that state.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_transition"]},"status":{"type":"string"}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/discard":{"post":{"summary":"Discard unpublished changes","description":"Restores the live version. Answers 200 with the tour unchanged when there is nothing to discard.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tour"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"A room is being recorded or uploaded.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["room_busy"]}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/preview":{"post":{"summary":"Open a preview link","description":"A viewer link to the draft, valid for one hour. Never cached.","security":[{"oauth2":["tours:read"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"201":{"description":"The link.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expires_at":{"type":"integer"}}}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"503":{"description":"The viewer is not configured.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["viewer_unconfigured"]}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/rooms":{"get":{"summary":"List the draft's rooms","description":"","security":[{"oauth2":["tours:read"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tour's state and its rooms.","content":{"application/json":{"schema":{"type":"object","properties":{"tour":{"type":"object","properties":{"status":{"type":"string"},"has_unpublished_changes":{"type":"boolean"}}},"rooms":{"type":"array","items":{"$ref":"#/components/schemas/TourRoom"}}}}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No tour for that property.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}}}},"post":{"summary":"Add a room","description":"","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"201":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TourRoom"}}}},"400":{"description":"The name is empty or longer than 80 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_body"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The room cannot be added.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["single_capture_tour","too_many_rooms","invalid_transition"]},"status":{"type":"string"}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/rooms/order":{"put":{"summary":"Reorder the rooms","description":"Every kept room id exactly once.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"200":{"description":"The rooms in their new order.","content":{"application/json":{"schema":{"type":"object","properties":{"rooms":{"type":"array","items":{"$ref":"#/components/schemas/TourRoom"}}}}}}},"400":{"description":"The ids are not exactly the draft's rooms.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_body"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["room_ids"],"properties":{"room_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/rooms/{roomId}":{"put":{"summary":"Rename a room","description":"","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"roomId","in":"path","required":true,"description":"The room's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The room.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TourRoom"}}}},"400":{"description":"The name is empty or longer than 80 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_body"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour, or no such room.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found","room_not_found"]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}}},"delete":{"summary":"Remove a room","description":"The room stays live until the next publish.","security":[{"oauth2":["tours:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"roomId","in":"path","required":true,"description":"The room's id.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. No body."},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour, or no such room.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found","room_not_found"]}}}}}},"409":{"description":"The room is being recorded or uploaded, or cannot be removed now.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["room_busy","invalid_transition"]}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/captures":{"post":{"summary":"Start a capture","description":"A tour with rooms needs room_id; a tour without rooms takes none. One capture is open at a time.","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"201":{"description":"The capture.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capture"}}}},"400":{"description":"The body is not valid JSON, or room_id is not a string.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_body"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour, or no such room.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found","room_not_found"]}}}}}},"409":{"description":"The capture cannot start.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["room_required","invalid_transition","room_busy","capture_in_progress"]},"status":{"type":"string"}}}}}},"415":{"description":"The content type is not one of the accepted ones.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["unsupported_media_type"]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content_type"],"properties":{"content_type":{"type":"string","enum":["video/mp4","video/quicktime","application/x-tar","video/webm"]},"room_id":{"type":["string","null"]}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/captures/{id}":{"get":{"summary":"Read a capture","description":"","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The capture's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The capture and its stored parts.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Capture"},{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"part_number":{"type":"integer"},"etag":{"type":"string"},"size_bytes":{"type":"integer"}}}}}}]}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No such capture.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}}}},"delete":{"summary":"Abort a capture","description":"Answers 200 with the aborted capture; a repeat is the same answer.","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The capture's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The aborted capture.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capture"}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No such capture.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The capture is already complete.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["capture_closed"]},"status":{"type":"string"}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/captures/{id}/parts/{n}":{"put":{"summary":"Upload one part","description":"Send the raw bytes with a content-length of at most 95,000,000. Parts are numbered from 1 to 10,000. Keep each etag for the complete call.","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The capture's id.","schema":{"type":"string"}},{"name":"n","in":"path","required":true,"description":"Part number, 1 to 10000.","schema":{"type":"string"}}],"responses":{"200":{"description":"The stored part.","content":{"application/json":{"schema":{"type":"object","properties":{"part_number":{"type":"integer"},"etag":{"type":"string"}}}}}},"400":{"description":"The part number or the body is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_part_number","empty_part"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No open capture for that id.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The capture is closed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["capture_closed"]},"status":{"type":"string"}}}}}},"411":{"description":"No content-length header.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["length_required"]}}}}}},"413":{"description":"The part is larger than 95,000,000 bytes.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["part_too_large"]}}}}}}},"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/captures/{id}/complete":{"post":{"summary":"Complete a capture","description":"Send every uploaded part once. A repeat on a complete capture answers 200.","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The capture's id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The completed capture.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capture"}}}},"400":{"description":"The parts are not exactly the stored ones.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id","invalid_parts"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No open capture for that id.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The capture cannot complete.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["capture_closed","invalid_transition"]},"status":{"type":"string"}}}}}},"413":{"description":"The parts add up to more than 5,000,000,000 bytes.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["capture_too_large"]}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parts"],"properties":{"parts":{"type":"array","items":{"type":"object","required":["part_number","etag"],"properties":{"part_number":{"type":"integer"},"etag":{"type":"string"}}}}}}}}}}},"/v1/accounts/{accountId}/properties/{propertyId}/tour/capture-sessions":{"post":{"summary":"Mint a capture link","description":"A link a host opens on a phone. The session token rides in the URL fragment. Never cached.","security":[{"oauth2":["captures:write"]}],"parameters":[{"name":"accountId","in":"path","required":true,"description":"Your id for the account. At most 128 characters.","schema":{"type":"string"}},{"name":"propertyId","in":"path","required":true,"description":"Your id for the property. At most 128 characters.","schema":{"type":"string"}}],"responses":{"201":{"description":"The link.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"expires_at":{"type":"integer"}}}}}},"400":{"description":"An account or property id is longer than 128 characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_id"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}},"404":{"description":"No active tour.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}}}}},"409":{"description":"The tour cannot take a capture now.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_transition"]},"status":{"type":"string"}}}}}},"503":{"description":"The capture app is not configured.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["capture_app_unconfigured"]}}}}}}}}},"/v1/usage":{"get":{"summary":"Read usage","description":"Totals and per-property totals for from <= occurred_at < to. The range is at most 366 days.","security":[{"oauth2":["usage:read"]}],"parameters":[{"name":"from","in":"query","required":true,"description":"Unix seconds, inclusive.","schema":{"type":"integer","minimum":0}},{"name":"to","in":"query","required":true,"description":"Unix seconds, exclusive. Greater than from.","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Usage in the range.","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"integer"},"to":{"type":"integer"},"totals":{"type":"array","items":{"$ref":"#/components/schemas/UsageRow"}},"properties":{"type":"array","items":{"$ref":"#/components/schemas/UsageRow"}}}}}}},"400":{"description":"from or to is missing or not whole seconds, to is not after from, or the range is over 366 days.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_range"]}}}}}},"401":{"description":"Missing, malformed or expired token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_token"]}}}}}},"403":{"description":"The token does not carry the scope this route requires.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["insufficient_scope"]}}}}}}}}}}}