curl --fail-with-body https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN"const res = await fetch(
'https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos',
{ headers: { Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}` } },
);
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.detail}`);
for (const photo of body.items) {
console.log(photo.position, photo.state, photo.url ?? photo.rejection_reason);
}
import os
import requests
res = requests.get(
"https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
timeout=30,
)
body = res.json()
if res.status_code >= 400:
raise RuntimeError(f"{body['code']}: {body.get('detail')}")
for photo in body["items"]:
print(photo["position"], photo["state"], photo["url"] or photo["rejection_reason"])
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
type photo struct {
PhotoID string `json:"photo_id"`
Position int `json:"position"`
IsCover bool `json:"is_cover"`
State string `json:"state"`
RejectionReason *string `json:"rejection_reason"`
URL *string `json:"url"`
}
func main() {
req, _ := http.NewRequest(http.MethodGet,
"https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos",
nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("MAAT_PARTNER_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode >= 400 {
log.Fatalf("photo read failed: %d", res.StatusCode)
}
var body struct {
Items []photo `json:"items"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
for _, p := range body.Items {
fmt.Println(p.Position, p.State, p.URL)
}
}
{
"items": [
{
"photo_id": "0f2b9c81-4a7e-4d33-9b10-2c7e5a6f1d94",
"position": 0,
"is_cover": true,
"state": "ready",
"rejection_reason": null,
"url": "https://cdn.maatstays.com/c/0f2b9c81.webp"
},
{
"photo_id": "5d3a7e12-9b48-4c05-8f61-2a7d0e4b93c6",
"position": 1,
"is_cover": false,
"state": "pending",
"rejection_reason": null,
"url": null
}
]
}List a property's photos
Every photo on the property, in the order guests see them. Position 0 is the
cover.
This is how you follow an upload. A photo you presigned appears here
immediately as pending; it becomes ready once we have processed and reviewed
it, or rejected with a reason from a closed vocabulary. Poll this rather than
assuming a successful upload means a published image — the review happens after
you are gone.
url is the published image and is null in every other state. A photo our
automated review declined reads as rejected, not ready: its file exists and
no guest will ever be shown it.
A property with more than one unit, or more than one listing, is refused with
409 property_not_simple.
curl --fail-with-body https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN"const res = await fetch(
'https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos',
{ headers: { Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}` } },
);
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.detail}`);
for (const photo of body.items) {
console.log(photo.position, photo.state, photo.url ?? photo.rejection_reason);
}
import os
import requests
res = requests.get(
"https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
timeout=30,
)
body = res.json()
if res.status_code >= 400:
raise RuntimeError(f"{body['code']}: {body.get('detail')}")
for photo in body["items"]:
print(photo["position"], photo["state"], photo["url"] or photo["rejection_reason"])
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
type photo struct {
PhotoID string `json:"photo_id"`
Position int `json:"position"`
IsCover bool `json:"is_cover"`
State string `json:"state"`
RejectionReason *string `json:"rejection_reason"`
URL *string `json:"url"`
}
func main() {
req, _ := http.NewRequest(http.MethodGet,
"https://maatstays.com/v1/properties/3c9d1f42-7b60-4a18-9e55-0d2a6f8c31b7/photos",
nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("MAAT_PARTNER_TOKEN"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode >= 400 {
log.Fatalf("photo read failed: %d", res.StatusCode)
}
var body struct {
Items []photo `json:"items"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
for _, p := range body.Items {
fmt.Println(p.Position, p.State, p.URL)
}
}
{
"items": [
{
"photo_id": "0f2b9c81-4a7e-4d33-9b10-2c7e5a6f1d94",
"position": 0,
"is_cover": true,
"state": "ready",
"rejection_reason": null,
"url": "https://cdn.maatstays.com/c/0f2b9c81.webp"
},
{
"photo_id": "5d3a7e12-9b48-4c05-8f61-2a7d0e4b93c6",
"position": 1,
"is_cover": false,
"state": "pending",
"rejection_reason": null,
"url": null
}
]
}Authorizations
A short-lived partner token, obtained by exchanging your API key at
POST /token. Send it as Authorization: Bearer <access_token>.
Tokens live for fifteen minutes by default and never for more than an hour. Mint one per batch of work, not one per request.
The token carries the workspace and the environment its key was issued for. You cannot change either by asking: the exchange ignores everything in the request body for exactly that reason.
It also carries the key's scopes (scope, a list). Every operation names a
scope as x-maat-scope, and a token whose key lacks it is refused with
403 insufficient_scope, naming the scope. Scopes are fixed when a key is
issued and are re-read from the key on every request, so a key narrowed today is
narrowed on its next call — the token's scope is what the key held at exchange
time, for your own reading, never what authorizes a request.
x-maat-scope is the floor, and on nine operations it is not the whole
story. PUT and DELETE /listings/{listing_id}/quick-actions/{template_key}
carry rules:write, and additionally require pricing:write when
template_key begins pricing. — the capability depends on the template in
the path, because a cleaning fee changes what a guest pays and a minimum stay
does not. The refusal is the same 403 insufficient_scope, naming
pricing:write. The two READS apply the same requirement without erroring:
GET /listings/{listing_id}/quick-actions still lists the pricing.* rows but
withholds their applied state, and GET /listings/{listing_id}/rules omits the
pricing rules entirely and reports pricing_withheld in warnings. The five
operations that return a booking — the two booking reads, confirm, reject and
POST /sandbox/bookings — read guests:read the same way, without ever
erroring: it decides whether a booking's guest carries the guest's display name
(and, where guest contact is enabled for your workspace, email and phone) or is
null, and whether guest_note can be anything but null. These nine are the only operations in this document whose answer
depends on more than their x-maat-scope, and each of them says so
machine-readably: x-maat-scope-additional lists the second scope it can read
and x-maat-scope-additional-when says what happens without it.
Never send it as a cookie or in a query string, and never store it — store the API key, mint tokens from it.