{"openapi":"3.1.0","info":{"title":"PetCremation API","version":"1","description":"The read API is free, needs no key and reads only. The admin routes under /admin/ need an admin session. Every read response carries `meta.attribution` and `meta.sources`."},"servers":[{"url":"https://admin-staging.petcremation.fyi/api/v1"}],"paths":{"/listings":{"get":{"summary":"Search and list listings","operationId":"getListings","parameters":[{"name":"q","in":"query","required":false,"description":"Search text, with at least one letter or digit. Matches name, categories, attributes, description and place. Typos fall back to close matches.","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"country","in":"query","required":false,"description":"ISO 3166-1 alpha-2 country code, any case. A country the directory does not cover, as listed in /places, gives 400.","schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}},{"name":"region","in":"query","required":false,"description":"Region slug, from /places.","schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"city","in":"query","required":false,"description":"City slug, from /places.","schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"category","in":"query","required":false,"description":"Category slug, from /categories. A parent slug also matches its children.","schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},{"name":"sort","in":"query","required":false,"description":"`relevance` needs `q` and is the default with it. `name` is the default without `q`. `recent` is newest first.","schema":{"type":"string","enum":["relevance","name","recent"]}},{"name":"limit","in":"query","required":false,"description":"Items per page.","schema":{"default":20,"type":"integer","minimum":1,"maximum":50}},{"name":"cursor","in":"query","required":false,"description":"`page.nextCursor` from the previous response. Opaque. Send the same filters and `limit`.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","page","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ListingItem"}},"page":{"$ref":"#/components/schemas/Page"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/listings/{slug}":{"get":{"summary":"Read one listing","operationId":"getListingsBySlug","parameters":[{"name":"slug","in":"path","required":true,"description":"The listing slug.","schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Listing"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record. `code` is `not_found`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/places":{"get":{"summary":"List countries, regions and cities with counts","operationId":"getPlaces","parameters":[],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PlaceNode"}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories":{"get":{"summary":"List the category tree with counts","operationId":"getCategories","parameters":[],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CategoryNode"}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sources":{"get":{"summary":"List the data sources with license and refresh","operationId":"getSources","parameters":[],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Source"}},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stats":{"get":{"summary":"Counts and the last update","operationId":"getStats","parameters":[],"responses":{"200":{"description":"Success.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/Stats"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"304":{"description":"The `If-None-Match` validator still matches. No body.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"ETag":{"description":"A weak validator. Send it back as `If-None-Match`.","schema":{"type":"string"}},"Cache-Control":{"description":"`public, max-age=60, s-maxage=300, stale-while-revalidate=600`.","schema":{"type":"string"}}}},"400":{"description":"A parameter is unknown, repeated, empty or invalid. `code` is `invalid_parameter` or `invalid_cursor`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Over the limit of 300 requests per 60 seconds. `code` is `rate_limited`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. 60.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An error on the server. `code` is `internal_error`.","headers":{"RateLimit-Limit":{"description":"Requests allowed per window. 300.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The policy as `limit;w=seconds`. `300;w=60`.","schema":{"type":"string"}},"Access-Control-Allow-Origin":{"description":"`*`. Any origin may read.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/apps/{slug}":{"put":{"summary":"Create or replace one app. Needs the apps:write scope or an admin session.","operationId":"putAdminAppsBySlug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"website":{"type":"string","maxLength":2000,"format":"uri"},"tagline":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"iconUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"pricingModel":{"default":"free","type":"string","enum":["free","freemium","paid","subscription"]},"priceAmount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"priceCurrency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"priceNote":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"categorySlug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},{"type":"null"}]},"platforms":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"featured":{"default":false,"type":"boolean"},"featuredRank":{"default":0,"type":"integer","minimum":0,"maximum":9999},"status":{"default":"draft","type":"string","enum":["draft","published","archived"]},"sourceUrl":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]}},"required":["name","website"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"},"created":{"type":"boolean"},"changed":{"type":"array","items":{"type":"string"}}},"required":["ok","id","created","changed"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Delete one app. Needs the apps:write scope or an admin session.","operationId":"deleteAdminAppsBySlug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/audit-log":{"get":{"summary":"The audit log, newest first.","operationId":"getAdminAudit-log","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/backup/export":{"post":{"summary":"Snapshot the site database into private storage and record the run.","operationId":"postAdminBackupExport","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"run":{}},"required":["run"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/backup/status":{"get":{"summary":"The backup ledger and the last export.","operationId":"getAdminBackupStatus","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/claims/{id}":{"post":{"summary":"Approve or reject a manual claim.","operationId":"postAdminClaimsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"approve"},"currentOwnerId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]},"note":{"type":"string","maxLength":500}},"required":["action","currentOwnerId"]},{"type":"object","properties":{"action":{"type":"string","const":"reject"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"listingId":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/crm/export":{"get":{"summary":"The filtered contacts as CSV.","operationId":"getAdminCrmExport","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/crm/{id}":{"patch":{"summary":"Edit a contact's fields.","operationId":"patchAdminCrmById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":60},"company":{"type":"string","maxLength":200},"status":{"type":"string","enum":["lead","active","customer","lost"]},"tags":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Add a note to a contact.","operationId":"postAdminCrmById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000}},"required":["body"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Remove a contact.","operationId":"deleteAdminCrmById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/edits/{id}":{"post":{"summary":"Accept, reject or spam a suggestion.","operationId":"postAdminEditsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"accept"},"note":{"type":"string","maxLength":500}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reject"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"spam"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"listingId":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/forms/export.csv":{"get":{"summary":"The forms inbox as CSV.","operationId":"getAdminFormsExport.csv","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/mail":{"post":{"summary":"Mark a message (read, spam, not-spam, archive) or send a mail.","operationId":"postAdminMail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"act"},"messageId":{"type":"string","maxLength":2048,"pattern":"^[^\\s<>\\r\\n]+$"},"action":{"type":"string","enum":["read","spam","not-spam","archive"]}},"required":["kind","messageId","action"]},{"type":"object","properties":{"kind":{"type":"string","const":"send"},"to":{"type":"string","minLength":3,"maxLength":320},"subject":{"type":"string","minLength":1,"maxLength":998},"text":{"type":"string","minLength":1,"maxLength":26214400},"inReplyTo":{"anyOf":[{"type":"string","maxLength":2048,"pattern":"^[^\\s<>\\r\\n]+$"},{"type":"null"}]},"threadId":{"anyOf":[{"type":"string","maxLength":2048,"pattern":"^[^\\s<>\\r\\n]+$"},{"type":"null"}]}},"required":["kind","to","subject","text"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/mail/{messageId}/attachments/{attachmentId}":{"get":{"summary":"Download one attachment of a stored message.","operationId":"getAdminMailByMessageIdAttachmentsByAttachmentId","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/monitoring/alerts":{"get":{"summary":"The open alerts in the monitoring feed, newest first. Pass the cursor of the page before to read on.","operationId":"getAdminMonitoringAlerts","parameters":[{"name":"site","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["uptime","error","queue","cost"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","resolved","all"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^(\\d{1,15})\\.(mev_[a-z0-9_]{1,60})$"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/monitoring/sites":{"get":{"summary":"The site rollup: identity, the newest event of each kind and the open-alert counts.","operationId":"getAdminMonitoringSites","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"sites":{"type":"array","items":{}}},"required":["sites"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/domains/{domain}/status":{"get":{"summary":"The domain, DNS, routing and mailbox state.","operationId":"getAdminDomainsByDomainStatus","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/domains/{domain}/verify":{"post":{"summary":"Re-read the Cloudflare state and cross-check it against a public resolver, one verdict per check. Audited.","operationId":"postAdminDomainsByDomainVerify","parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}},"required":["data"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/leads/dispatch":{"post":{"summary":"Start one parallel call run.","operationId":"postAdminLeadsDispatch","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["bland","telnyx","vapi"]},"limit":{"type":"integer","minimum":1,"maximum":100}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"requested":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"started":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"results":{"type":"array","items":{}}},"required":["ok","requested","started","results"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/leads/{id}":{"post":{"summary":"Set lead status, request a call, set the script, send a text or a postcard, refresh a transcript or barge in.","operationId":"postAdminLeadsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"status"},"status":{"type":"string","enum":["new","delivered","responded","spam","refunded"]}},"required":["action","status"]},{"type":"object","properties":{"action":{"type":"string","const":"request-call"},"provider":{"type":"string","minLength":1,"maxLength":16},"scriptId":{"type":"string","minLength":1,"maxLength":64}},"required":["action","provider"]},{"type":"object","properties":{"action":{"type":"string","const":"set-script"},"scriptId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}},"required":["action","scriptId"]},{"type":"object","properties":{"action":{"type":"string","const":"text"},"body":{"type":"string","minLength":1,"maxLength":600}},"required":["action","body"]},{"type":"object","properties":{"action":{"type":"string","const":"postcard"},"to":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"line1":{"type":"string","minLength":1,"maxLength":120},"line2":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":80},"state":{"type":"string","minLength":2,"maxLength":2},"zip":{"type":"string","pattern":"^\\d{5}(-\\d{4})?$"}},"required":["name","line1","city","state","zip"]},"message":{"type":"string","minLength":1,"maxLength":500}},"required":["action","to","message"]},{"type":"object","properties":{"action":{"type":"string","const":"transcript"},"callId":{"type":"string","minLength":1,"maxLength":64}},"required":["action","callId"]},{"type":"object","properties":{"action":{"type":"string","const":"barge-in"},"callId":{"type":"string","minLength":1,"maxLength":64}},"required":["action","callId"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":{}}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/leads/kb":{"post":{"summary":"Create or delete a knowledge-base document.","operationId":"postAdminLeadsKb","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"create"},"kind":{"type":"string","enum":["text","faq"]},"title":{"type":"string","minLength":1,"maxLength":200},"question":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"body":{"type":"string","minLength":1,"maxLength":8000},"scriptIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["action","kind","title","body"]},{"type":"object","properties":{"action":{"type":"string","const":"delete"},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["action","id"]}]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/leads/reconcile":{"get":{"summary":"Billed lead charges plus call spend, per listing.","operationId":"getAdminLeadsReconcile","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"array","items":{}}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/leads/scripts":{"post":{"summary":"Create, update or delete a call script.","operationId":"postAdminLeadsScripts","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"create"},"name":{"type":"string","minLength":1,"maxLength":120},"systemPrompt":{"type":"string","minLength":1,"maxLength":4000},"personality":{"type":"string","minLength":1,"maxLength":200},"firstMessage":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"voiceBland":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"voiceTelnyx":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"voiceVapi":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"maxDurationSec":{"type":"integer","minimum":10,"maximum":7200},"bargeIn":{"type":"boolean"},"isDefault":{"type":"boolean"},"kbDocIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["action","name","systemPrompt","personality"]},{"type":"object","properties":{"action":{"type":"string","const":"update"},"id":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","minLength":1,"maxLength":120},"systemPrompt":{"type":"string","minLength":1,"maxLength":4000},"personality":{"type":"string","minLength":1,"maxLength":200},"firstMessage":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"voiceBland":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"voiceTelnyx":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"voiceVapi":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"maxDurationSec":{"type":"integer","minimum":10,"maximum":7200},"bargeIn":{"type":"boolean"},"isDefault":{"type":"boolean"},"kbDocIds":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["action","id","name","systemPrompt","personality"]},{"type":"object","properties":{"action":{"type":"string","const":"delete"},"id":{"type":"string","minLength":1,"maxLength":64}},"required":["action","id"]}]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/link-exchanges/{id}":{"post":{"summary":"Approve, reject, spam or recheck a link exchange.","operationId":"postAdminLink-exchangesById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"approve"},"note":{"type":"string","maxLength":500},"guideSlug":{"type":"string","maxLength":120}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reject"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"spam"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"recheck"}},"required":["action"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/listings/{id}":{"post":{"summary":"Feature, unfeature or mark a listing real.","operationId":"postAdminListingsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["feature","unfeature","mark-real"]},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"listingId":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/newsletter/api-keys":{"get":{"summary":"The newsletter API keys.","operationId":"getAdminNewsletterApi-keys","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Create or revoke a newsletter API key.","operationId":"postAdminNewsletterApi-keys","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"newsletterId":{"type":"string","minLength":1},"action":{"type":"string","const":"revoke"},"id":{"type":"string","minLength":1}}}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"item":{}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/newsletter/contacts":{"get":{"summary":"A page of subscribers, or the filtered CSV export with format=csv.","operationId":"getAdminNewsletterContacts","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Add, change or remove one subscriber, or import a CSV file of subscribers.","operationId":"postAdminNewsletterContacts","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nl":{"type":"string","minLength":1,"maxLength":64},"id":{"type":"string","minLength":1,"maxLength":64},"email":{"type":"string","minLength":1,"maxLength":320},"consent":{"type":"boolean"},"status":{"type":"string","enum":["pending","active","unsubscribed","bounced","complained"]},"reason":{"type":"string","maxLength":500},"remove":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/newsletter/campaigns":{"get":{"summary":"The campaigns, newest first, without bodies.","operationId":"getAdminNewsletterCampaigns","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Create a campaign draft.","operationId":"postAdminNewsletterCampaigns","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":150},"preheader":{"type":"string","maxLength":150},"bodyJson":{"type":"string","maxLength":200000},"bodyHtml":{"type":"string","maxLength":200000}}}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"updatedAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/newsletter/campaigns/{id}":{"get":{"summary":"One campaign with its body.","operationId":"getAdminNewsletterCampaignsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"patch":{"summary":"Save a draft or scheduled campaign body.","operationId":"patchAdminNewsletterCampaignsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":150},"preheader":{"type":"string","maxLength":150},"bodyJson":{"type":"string","maxLength":200000},"bodyHtml":{"type":"string","maxLength":200000},"baseUpdatedAt":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["baseUpdatedAt"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"updatedAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["updatedAt"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Delete a campaign.","operationId":"deleteAdminNewsletterCampaignsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Schedule, cancel, queue, duplicate or test-send a campaign.","operationId":"postAdminNewsletterCampaignsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"schedule"},"scheduledAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["action","scheduledAt"]},{"type":"object","properties":{"action":{"type":"string","const":"cancel"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"queue"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"duplicate"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"test-send"},"addresses":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":3,"maxLength":254}}},"required":["action","addresses"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":{}}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/settings":{"get":{"summary":"The site settings.","operationId":"getAdminSettings","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"put":{"summary":"Create or update one setting.","operationId":"putAdminSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9_.-]{1,120}$"},"value":{}},"required":["key","value"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"delete":{"summary":"Remove one setting.","operationId":"deleteAdminSettings","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1}},"required":["key"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/submissions":{"get":{"summary":"The submission queue, newest first.","operationId":"getAdminSubmissions","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/submissions/{id}":{"post":{"summary":"Approve, reject, spam or merge a submission.","operationId":"postAdminSubmissionsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"approve"},"note":{"type":"string","maxLength":500}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"reject"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"spam"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"merge"},"listingId":{"type":"string","minLength":1,"maxLength":64},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["action","listingId","reason"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"listingId":{"type":"string"},"url":{"type":"string"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/tokens":{"get":{"summary":"The service tokens, with hints and metadata only.","operationId":"getAdminTokens","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Issue a service token. The secret comes back in this response only.","operationId":"postAdminTokens","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","enum":["sites:provision","listings:write","apps:write","categories:write","places:write","sources:write","settings:write","leads:write","crm:write","newsletter:write","submissions:review","billing:write","audit:read","agent:run","tokens:manage"]}},"ttlDays":{"default":30,"type":"integer","minimum":1,"maximum":365}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"item":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string"},"token":{"type":"string"}},"required":["id","prefix","token"],"additionalProperties":false}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/tokens/{id}":{"delete":{"summary":"Revoke a service token.","operationId":"deleteAdminTokensById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/webhooks":{"get":{"summary":"The outbound Webhooks.","operationId":"getAdminWebhooks","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Register one Webhook.","operationId":"postAdminWebhooks","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"secret":{"type":"string","minLength":16},"events":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}}},"required":["url","secret","events"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"item":{}},"required":["item"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/webhooks/{id}":{"delete":{"summary":"Remove one Webhook.","operationId":"deleteAdminWebhooksById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/video/jobs":{"get":{"summary":"The social video jobs, newest first.","operationId":"getAdminVideoJobs","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}}},"required":["items"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"post":{"summary":"Create a social video draft that waits for the owner.","operationId":"postAdminVideoJobs","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"caption":{"type":"string","maxLength":1000},"accounts":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"assetKey":{"type":"string","maxLength":300},"costCents":{"type":"integer","minimum":0,"maximum":100000}},"required":["title"]}}}},"responses":{"201":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"string"}},"required":["ok","id"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/video/jobs/{id}":{"patch":{"summary":"Approve, schedule, cancel or kill a video job.","operationId":"patchAdminVideoJobsById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"approve"},"publishAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"schedule"},"publishAt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["action","publishAt"]},{"type":"object","properties":{"action":{"type":"string","const":"cancel"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"kill"}},"required":["action"]}]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"/admin/video/queue":{"get":{"summary":"The publish queue: due jobs, the kill switch and spend against the caps.","operationId":"getAdminVideoQueue","parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{}},"killSwitch":{"type":"boolean"},"spendUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capPerVideo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"capPerSite":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["items","killSwitch","spendUsed","capPerVideo","capPerSite"],"additionalProperties":false}}}},"400":{"description":"Validation failed.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}},"500":{"description":"An error on the server.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"A sentence for a person."},"code":{"type":"string","enum":["invalid_parameter","invalid_cursor","not_found","method_not_allowed","rate_limited","internal_error"],"description":"Stable. Branch on this, not on `error`."},"details":{"description":"One entry per bad parameter, on `invalid_parameter`.","type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["error","code"],"additionalProperties":false},"Meta":{"type":"object","properties":{"attribution":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"text":{"type":"string","description":"Credit line to show next to the data."}},"required":["name","url","text"],"additionalProperties":false},"sources":{"type":"array","items":{"$ref":"#/components/schemas/Source"},"description":"Where the data comes from, with the license of each source."}},"required":["attribution","sources"],"additionalProperties":false},"Source":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"license":{"type":"string","description":"The license of the data taken from this source."},"refresh":{"type":"string","description":"How often the source is re-imported."},"notes":{"type":["string","null"]}},"required":["key","name","url","license","refresh","notes"],"additionalProperties":false},"ListingItem":{"type":"object","properties":{"slug":{"type":"string","description":"The stable identifier. Use it in /listings/{slug}."},"name":{"type":"string"},"path":{"type":"string","description":"The listing page on this site."},"url":{"type":"string","description":"Absolute URL of the listing page."},"country":{"type":"string","description":"ISO 3166-1 alpha-2, upper case."},"region":{"type":"string"},"regionSlug":{"type":"string"},"city":{"type":"string"},"citySlug":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false},"description":"Primary category first."},"tier":{"type":"string"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"completeness":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 to 100. How much of the record is filled in."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Public facet attributes, keyed by attribute key."}},"required":["slug","name","path","url","country","region","regionSlug","city","citySlug","categories","tier","lat","lng","completeness","attributes"],"additionalProperties":false},"Listing":{"type":"object","properties":{"slug":{"type":"string","description":"The stable identifier. Use it in /listings/{slug}."},"name":{"type":"string"},"path":{"type":"string","description":"The listing page on this site."},"url":{"type":"string","description":"Absolute URL of the listing page."},"country":{"type":"string","description":"ISO 3166-1 alpha-2, upper case."},"region":{"type":"string"},"regionSlug":{"type":"string"},"city":{"type":"string"},"citySlug":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"}},"required":["slug","name"],"additionalProperties":false},"description":"Primary category first."},"tier":{"type":"string"},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"completeness":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"0 to 100. How much of the record is filled in."},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Public facet attributes, keyed by attribute key."},"description":{"type":["string","null"]},"street":{"type":["string","null"]},"street2":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"currency":{"type":"string","description":"ISO 4217."},"language":{"type":"string","description":"BCP 47."},"verified":{"type":"boolean","description":"The listing has an owner or a paid tier."},"source":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"license":{"type":"string"},"refresh":{"type":"string"},"notes":{"description":"The source note: how the record was gathered.","type":["string","null"]},"recordUrl":{"type":"string","description":"Where this record was read."},"retrieved":{"description":"When it was read, ISO 8601.","type":["string","null"]}},"required":["key","name","license","refresh","notes","recordUrl","retrieved"],"additionalProperties":false},{"type":"null"}],"description":"Null for a record that did not come from an import."},"published":{"description":"ISO 8601.","type":["string","null"]},"updated":{"type":"string","description":"ISO 8601."}},"required":["slug","name","path","url","country","region","regionSlug","city","citySlug","categories","tier","lat","lng","completeness","attributes","description","street","street2","postalCode","phone","website","currency","language","verified","source","published","updated"],"additionalProperties":false},"Page":{"type":"object","properties":{"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Listings that match the filters."},"nextCursor":{"description":"Null on the last page.","type":["string","null"]},"capped":{"type":"boolean","description":"True when more listings match than the cursor can reach. Add a filter or raise `limit`."},"fuzzy":{"type":"boolean","description":"True when nothing matched `q` exactly and the items are close matches."}},"required":["limit","total","nextCursor","capped","fuzzy"],"additionalProperties":false},"PlaceNode":{"type":"object","properties":{"kind":{"type":"string","enum":["country","region","city"]},"name":{"type":"string"},"slug":{"type":"string","description":"Pass a region slug as `region` and a city slug as `city` to /listings."},"country":{"type":"string","description":"ISO 3166-1 alpha-2 code. Pass it as `country` to /listings."},"url":{"type":"string","description":"The page for this place on the site."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Published listings in this place. A place with none is left out."},"children":{"type":"array","items":{"$ref":"#/components/schemas/PlaceNode"},"description":"Regions in a country, cities in a region. Empty for a city."}},"required":["kind","name","slug","country","url","count","children"],"additionalProperties":false},"CategoryNode":{"type":"object","properties":{"slug":{"type":"string","description":"Pass it as `category` to /listings."},"name":{"type":"string"},"url":{"type":"string","description":"The page for this category on the site."},"count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Published listings in this category or one below it. Every category in the config is listed, also with 0."},"children":{"type":"array","items":{"$ref":"#/components/schemas/CategoryNode"}}},"required":["slug","name","url","count","children"],"additionalProperties":false},"Stats":{"type":"object","properties":{"listings":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Published listings."},"countries":{"type":"integer","minimum":0,"maximum":9007199254740991},"regions":{"type":"integer","minimum":0,"maximum":9007199254740991},"cities":{"type":"integer","minimum":0,"maximum":9007199254740991},"categories":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Every category in the tree, at any depth."},"sources":{"type":"integer","minimum":0,"maximum":9007199254740991},"lastUpdated":{"description":"When a published listing last changed. ISO 8601. Null with no listings.","type":["string","null"]}},"required":["listings","countries","regions","cities","categories","sources","lastUpdated"],"additionalProperties":false}}}}