curl --fail-with-body -X DELETE https://maatstays.wtf/v1/blocks/my-res-55123 \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN" \
-iconst res = await fetch('https://maatstays.wtf/v1/blocks/my-res-55123', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}` },
});
// 204 either way — released, or it was never there. Idempotent.
if (res.status !== 204) {
const problem = await res.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
import os
import requests
res = requests.delete(
"https://maatstays.wtf/v1/blocks/my-res-55123",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
timeout=30,
)
# 204 either way — released, or it was never there. Idempotent.
if res.status_code != 204:
problem = res.json()
raise RuntimeError(f"{problem['code']}: {problem.get('detail')}")
package main
import (
"encoding/json"
"log"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest(http.MethodDelete,
"https://maatstays.wtf/v1/blocks/my-res-55123", 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()
// 204 either way — released, or it was never there. Idempotent.
if res.StatusCode != http.StatusNoContent {
var problem map[string]any
if err := json.NewDecoder(res.Body).Decode(&problem); err != nil {
log.Fatal(err)
}
log.Fatalf("%v: %v", problem["code"], problem["detail"])
}
}
Release a partner block
Removes the block you pushed under this external_uid and frees the nights it
still holds.
It frees only the nights that block is holding. A night that is unavailable for another reason — the property’s own owner closed it, or a Maat booking has since taken it — stays unavailable. Releasing a block is not the same as declaring those dates open.
Idempotent: releasing a block that does not exist, or releasing the same one
twice, is 204. There is nothing to retry and nothing has gone wrong.
There is no partial release. Send the whole block or move it with a PUT.
Live in a sandbox workspace. Returns 501 against a production one, where no
block was ever applied and so none can be released.
curl --fail-with-body -X DELETE https://maatstays.wtf/v1/blocks/my-res-55123 \
-H "Authorization: Bearer $MAAT_PARTNER_TOKEN" \
-iconst res = await fetch('https://maatstays.wtf/v1/blocks/my-res-55123', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.MAAT_PARTNER_TOKEN}` },
});
// 204 either way — released, or it was never there. Idempotent.
if (res.status !== 204) {
const problem = await res.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
import os
import requests
res = requests.delete(
"https://maatstays.wtf/v1/blocks/my-res-55123",
headers={"Authorization": f"Bearer {os.environ['MAAT_PARTNER_TOKEN']}"},
timeout=30,
)
# 204 either way — released, or it was never there. Idempotent.
if res.status_code != 204:
problem = res.json()
raise RuntimeError(f"{problem['code']}: {problem.get('detail')}")
package main
import (
"encoding/json"
"log"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest(http.MethodDelete,
"https://maatstays.wtf/v1/blocks/my-res-55123", 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()
// 204 either way — released, or it was never there. Idempotent.
if res.StatusCode != http.StatusNoContent {
var problem map[string]any
if err := json.NewDecoder(res.Body).Decode(&problem); err != nil {
log.Fatal(err)
}
log.Fatalf("%v: %v", problem["code"], problem["detail"])
}
}
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
Your own identifier for the block, typically your reservation id. Unique to you.
1 - 255Response
The block is gone, or was never there. No body either way.