curl --fail-with-body -X PUT "https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates" \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rates": [
{ "first_night": "2026-12-20", "last_night": "2026-12-31",
"nightly_rate": { "value": "3200.00", "currency": "EGP" },
"min_stay": 3 },
{ "first_night": "2027-01-01", "last_night": "2027-01-31",
"nightly_rate": { "value": "1800.00", "currency": "EGP" } }
]
}'const res = await fetch('https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
rates: [
{
first_night: '2026-12-20',
last_night: '2026-12-31',
nightly_rate: { value: '3200.00', currency: 'EGP' },
min_stay: 3,
},
],
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.detail}`);
// `binding: false` means these rates are stored but not yet in force.
console.log(body.nights_written, body.mode, body.binding, body.coverage_until);
import os
import requests
res = requests.put(
"https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
json={
"rates": [
{
"first_night": "2026-12-20",
"last_night": "2026-12-31",
"nightly_rate": {"value": "3200.00", "currency": "EGP"},
"min_stay": 3,
}
]
},
timeout=30,
)
body = res.json()
if res.status_code >= 400:
raise RuntimeError(f"{body['code']}: {body.get('detail')}")
print(body["nights_written"], body["mode"], body["binding"])
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
func main() {
payload := map[string]any{"rates": []map[string]any{{
"first_night": "2026-12-20",
"last_night": "2026-12-31",
"nightly_rate": map[string]string{"value": "3200.00", "currency": "EGP"},
"min_stay": 3,
}}}
buf, _ := json.Marshal(payload)
req, _ := http.NewRequest(http.MethodPut, "https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates", bytes.NewReader(buf))
req.Header.Set("Authorization", "Bearer "+os.Getenv("MAAT_PARTNER_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
var problem struct {
Code string `json:"code"`
Detail string `json:"detail"`
}
_ = json.NewDecoder(res.Body).Decode(&problem)
log.Fatalf("%d %s: %s", res.StatusCode, problem.Code, problem.Detail)
}
var body struct {
NightsWritten int `json:"nights_written"`
Mode string `json:"mode"`
Binding bool `json:"binding"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
fmt.Println(body.NightsWritten, body.Mode, body.Binding)
}
{
"listing_id": "7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24",
"nights_written": 12,
"currency": "EGP",
"mode": "partner",
"binding": true,
"coverage_until": "2026-12-31",
"gap_nights_next_90_days": 0
}Supply nightly rates for a date range
Store what each night of a range costs.
first_night and last_night are both inclusive and both nights. They are
not called from/to precisely so there is no exclusive checkout day to
misread: 2026-12-20 … 2026-12-31 prices twelve nights, and the twelfth is the
night of the 31st.
Push rates before you take the pricing mode. That is the recommended order,
so a listing never spends a window with no price on it. Until the mode is taken
the rows are stored and inert, and binding: false says so — the request is not
refused.
nightly_rate.currency must equal the listing’s own currency. Nothing is
ever converted; a mismatch is a 400 validation_failed naming the field. If the
host changes the listing’s currency, every future rate you sent is dropped —
re-push in the new currency. The currency on this response is what the
calendar now holds, so a push that comes back in a currency you did not send is
how you find out.
Ranges in one request may not overlap, every night must be today or later and no more than 730 nights ahead, and one request may cover at most 730 nights in total. Two separate requests for the same night are fine and the later one wins, which is how a correction works.
The rates you send are yours, and only the calendar of whoever holds the pricing mode sets what guests are quoted.
coverage_until is the last night of the contiguous run of YOUR OWN rates
that starts today — not the furthest night you have priced. A horizon with a hole
in it is not covered past the hole, and a night with no rate cannot be quoted at
all. It reports your calendar whether or not you hold the pricing mode, and
GET …/rates answers the same number.
A listing priced by another source refuses the whole request with
409 pricing_mode_conflict. Nothing is half-applied.
Live in a sandbox workspace. Returns 501 against a production one, where no
rate is stored.
curl --fail-with-body -X PUT "https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates" \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rates": [
{ "first_night": "2026-12-20", "last_night": "2026-12-31",
"nightly_rate": { "value": "3200.00", "currency": "EGP" },
"min_stay": 3 },
{ "first_night": "2027-01-01", "last_night": "2027-01-31",
"nightly_rate": { "value": "1800.00", "currency": "EGP" } }
]
}'const res = await fetch('https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
rates: [
{
first_night: '2026-12-20',
last_night: '2026-12-31',
nightly_rate: { value: '3200.00', currency: 'EGP' },
min_stay: 3,
},
],
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.detail}`);
// `binding: false` means these rates are stored but not yet in force.
console.log(body.nights_written, body.mode, body.binding, body.coverage_until);
import os
import requests
res = requests.put(
"https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
json={
"rates": [
{
"first_night": "2026-12-20",
"last_night": "2026-12-31",
"nightly_rate": {"value": "3200.00", "currency": "EGP"},
"min_stay": 3,
}
]
},
timeout=30,
)
body = res.json()
if res.status_code >= 400:
raise RuntimeError(f"{body['code']}: {body.get('detail')}")
print(body["nights_written"], body["mode"], body["binding"])
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
)
func main() {
payload := map[string]any{"rates": []map[string]any{{
"first_night": "2026-12-20",
"last_night": "2026-12-31",
"nightly_rate": map[string]string{"value": "3200.00", "currency": "EGP"},
"min_stay": 3,
}}}
buf, _ := json.Marshal(payload)
req, _ := http.NewRequest(http.MethodPut, "https://maatstays.wtf/v1/listings/7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24/rates", bytes.NewReader(buf))
req.Header.Set("Authorization", "Bearer "+os.Getenv("MAAT_PARTNER_TOKEN"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
var problem struct {
Code string `json:"code"`
Detail string `json:"detail"`
}
_ = json.NewDecoder(res.Body).Decode(&problem)
log.Fatalf("%d %s: %s", res.StatusCode, problem.Code, problem.Detail)
}
var body struct {
NightsWritten int `json:"nights_written"`
Mode string `json:"mode"`
Binding bool `json:"binding"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
fmt.Println(body.NightsWritten, body.Mode, body.Binding)
}
{
"listing_id": "7c4b1e58-2a90-4f61-b3d2-5e8a1c0f7d24",
"nights_written": 12,
"currency": "EGP",
"mode": "partner",
"binding": true,
"coverage_until": "2026-12-31",
"gap_nights_next_90_days": 0
}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 the quick-action operations it is not the
whole requirement. 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. These four
are the only operations in this document whose requirement is not exactly their
x-maat-scope, and each of them says so machine-readably:
x-maat-scope-additional lists the second scope it can require 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.
Path Parameters
Maat's identifier for the listing.
Body
Non-overlapping ranges, every night today or later and none more than 730 nights ahead, at most 730 nights in total across the whole request.
1 - 730 elementsShow child attributes
Show child attributes
Response
The rates were stored.
The listing the rates were written to.
Nights stored or replaced by this request.
43
The listing's currency, which every rate you sent had to match.
^[A-Z]{3}$"EGP"
true only when mode is partner and you own it — i.e. these rates
are what a guest is quoted. false means they are stored and inert,
which is the normal state before you take the pricing mode.
false
Last night of the CONTIGUOUS run of your own rates that starts today,
or null when you have not priced tonight. Not the furthest night you
have priced: a horizon with a hole in it is not covered past the hole.
It describes YOUR calendar whether or not you hold the pricing mode — so
a fill sent before you take the mode reports a real horizon, and reading
it straight back with GET …/rates gives the same number. Whether those
nights are in force is binding and mode.
"2027-01-31"
Nights with no rate in the next 90. Every one of them is unquotable.
0