{
 "openapi": "3.1.0",
 "info": {
  "title": "Bizinga Social Studio API",
  "version": "1.0.0",
  "description": "Post to every connected platform through Bizinga with your own tools and AI agents, and read results. Keys are scoped to a business, partner or chosen locations. Posts are held for a person to approve unless the business delegated approval. Docs: https://bizinga.studio/docs"
 },
 "servers": [
  {
   "url": "https://bizinga.studio/api/v1"
  }
 ],
 "security": [
  {
   "apiKey": []
  },
  {
   "bearer": []
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "x-api-key"
   },
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "The same svc_ key as a bearer token."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "code",
     "message"
    ],
    "properties": {
     "code": {
      "type": "string",
      "description": "Stable machine code, for example location_out_of_scope, quality_check_failed, rate_limited."
     },
     "message": {
      "type": "string",
      "description": "Plain-English explanation with the fix."
     },
     "details": {
      "description": "Extra structured detail when available (for example the failing quality checks)."
     }
    }
   }
  }
 },
 "paths": {
  "/me": {
   "get": {
    "operationId": "getScope",
    "summary": "What this key can do",
    "description": "The key's level (admin, partner, business or locations), permissions, locations it covers, where direct publishing is on, and the rate limit.",
    "tags": [
     "Scope"
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "keyId": "…",
         "name": "AI assistant key",
         "scope": {
          "type": "business",
          "partnerId": "…",
          "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b"
         },
         "permissions": [
          "read",
          "media.write",
          "draft.write",
          "publish.execute"
         ],
         "expiresAt": "2027-11-14T00:00:00.000Z",
         "directPublishing": [],
         "locationCount": 1,
         "locations": [
          {
           "id": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
           "name": "Main Street",
           "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
           "businessName": "Maple Cafe",
           "partnerId": "…"
          }
         ],
         "rateLimit": {
          "requestsPerMinute": 120
         }
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations": {
   "get": {
    "operationId": "listLocations",
    "summary": "List locations and connected platforms",
    "description": "Every location this key covers, with each location's connected social accounts. Filter with businessId. include=none skips the channels. Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "businessId",
      "in": "query",
      "required": false,
      "description": "Only this business.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "include",
      "in": "query",
      "required": false,
      "description": "channels (default) or none.",
      "schema": {
       "type": "string",
       "enum": [
        "channels",
        "none"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Page size (default 50).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "nextCursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locations": [
          {
           "id": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
           "name": "Main Street",
           "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
           "businessName": "Maple Cafe",
           "partnerId": "…",
           "channels": [
            {
             "id": "facebook:page",
             "network": "facebook",
             "name": "Maple Cafe",
             "accountType": "page",
             "formats": [
              "text",
              "photo",
              "video"
             ],
             "status": "connected"
            }
           ]
          }
         ],
         "total": 1,
         "nextCursor": null
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/specs": {
   "get": {
    "operationId": "getPlatformRequirements",
    "summary": "Platform requirements",
    "description": "Caption and hashtag limits, photo and video sizes, aspect ratios, video lengths and Google button rules per network. No key needed.",
    "tags": [
     "Platform requirements"
    ],
    "security": [],
    "parameters": [
     {
      "name": "network",
      "in": "query",
      "required": false,
      "description": "One network, for example instagram. Main networks: facebook, instagram, linkedin, google_business, youtube, tiktok, x, threads, pinterest, bluesky.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "text, photo, video or document.",
      "schema": {
       "type": "string",
       "enum": [
        "text",
        "photo",
        "video",
        "document"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "version": "…",
         "networks": [
          {
           "network": "instagram",
           "name": "Instagram",
           "formats": [
            "photo",
            "video"
           ],
           "caption": {
            "photo": {
             "maxBodyCodeUnits": 2200
            }
           },
           "hashtags": {
            "max": 5
           },
           "media": {
            "photo": {
             "recommended": {
              "aspect": "4:5",
              "width": 1080,
              "height": 1350
             }
            }
           },
           "rules": [
            "Use 5 hashtags or fewer."
           ]
          }
         ],
         "notice": "These are the rules Studio checks before scheduling."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/validate": {
   "post": {
    "operationId": "validatePost",
    "summary": "Check a post before creating it",
    "description": "Dry run against the platform rules (and optional industry recipe). Saves nothing. Describe media by its measurements. No key needed.",
    "tags": [
     "Platform requirements"
    ],
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "networks": [
         "google_business",
         "instagram"
        ],
        "caption": "Call 317-555-0100!",
        "media": {
         "width": 1080,
         "height": 1920,
         "durationSeconds": 20
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "valid": false,
         "issues": [
          {
           "network": "google_business",
           "code": "google_contact_info",
           "field": "caption",
           "message": "Google removes posts with phone numbers.",
           "fix": "Remove the phone number. To let people call, set googleCta to {\"type\":\"CALL\"}."
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/partners": {
   "get": {
    "operationId": "listPartners",
    "summary": "List partners",
    "description": "Partners visible to admin and partner keys. Permission: read.",
    "tags": [
     "Scope"
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "partners": [
          {
           "id": "…",
           "name": "Agency"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/partners/{partnerId}/businesses": {
   "get": {
    "operationId": "listPartnerBusinesses",
    "summary": "List a partner's businesses",
    "description": "Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "partnerId",
      "in": "path",
      "required": true,
      "description": "Partner ID.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "partnerId": "…",
         "businesses": [
          {
           "id": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
           "name": "Maple Cafe",
           "partnerId": "…"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/businesses/{businessId}/locations": {
   "get": {
    "operationId": "listBusinessLocations",
    "summary": "List a business's locations",
    "description": "Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "businessId",
      "in": "path",
      "required": true,
      "description": "Business ID.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
         "locations": [
          {
           "id": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
           "name": "Main Street",
           "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}": {
   "get": {
    "operationId": "getLocation",
    "summary": "One location",
    "description": "Name, business, time zone and whether direct publishing is on for this key. Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "name": "Main Street",
         "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
         "businessName": "Maple Cafe",
         "timeZone": "America/Indiana/Indianapolis",
         "directPublishing": false
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/channels": {
   "get": {
    "operationId": "listChannels",
    "summary": "Connected platforms",
    "description": "Social accounts connected on the location. Only these networks can be posted to. Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "channels": [
          {
           "id": "facebook:page",
           "network": "facebook",
           "name": "Maple Cafe",
           "accountType": "page",
           "formats": [
            "text",
            "photo",
            "video"
           ],
           "status": "connected"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/connect-links": {
   "post": {
    "operationId": "getConnectLinks",
    "summary": "Links to connect social accounts",
    "description": "One no-login link per network for the business owner to connect or reconnect that account (the same links Mercedes sends in setup). Each works once and expires; send them by text or email, then check GET /channels. Permission: draft.write.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "networks": [
         "instagram",
         "google_business"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "links": [
          {
           "network": "instagram",
           "url": "https://app.bizinga.studio/connect#…",
           "expiresAt": "2026-12-08T15:00:00Z"
          }
         ],
         "message": "Send each link to the business owner…"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/media": {
   "post": {
    "operationId": "uploadMedia",
    "summary": "Upload a photo or video",
    "description": "By public https url or base64. JPEG, PNG or MP4. Returns assetId and sha256 to use in a post. Permission: media.write.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "url": "https://example.com/menu.jpg",
        "rightsConfirmed": true
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
         "sha256": "…",
         "kind": "photo",
         "mime": "image/jpeg",
         "bytes": 183220,
         "width": 1080,
         "height": 1350,
         "durationSeconds": null
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts": {
   "post": {
    "operationId": "createPost",
    "summary": "Create a post (draft or scheduled)",
    "description": "One post, and one approval, across the networks you list; its media must be a size every one of them takes (422 media_size_not_allowed otherwise), and platform rules are enforced (422 post_rules_failed). Without scheduleAt it waits in Studio for a person to pick a time and approve. With scheduleAt it is still held for approval unless the business turned on direct publishing for this key (or the location's auto-approve approves it later). Red quality checks return 422 quality_check_failed and nothing is saved. Optional campaign (80 chars), script (the words spoken in a video, 4000) and notes (500) are saved with the post, so the person reviewing it and the owner's assistant (Mercedes) can explain it. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "caption": "Fresh seasonal menu starts Friday.",
        "captions": {
         "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
        },
        "networks": [
         "facebook",
         "instagram"
        ],
        "media": {
         "url": "https://example.com/menu.jpg",
         "rightsConfirmed": true
        },
        "scheduleAt": "2026-12-01T15:00:00Z",
        "campaign": "Winter menu",
        "notes": "Photo of the new brunch plate, shot Monday.",
        "firstComment": "Book a table: https://example.com/book"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f",
         "held": true,
         "status": "pending_approval",
         "message": "Saved and held for approval. A person approves it in Bizinga Studio.",
         "autoApprove": {
          "enabled": false,
          "leadHours": null
         },
         "qualityChecks": {
          "status": "warn",
          "warnings": [
           {
            "id": "cta",
            "label": "Call to action",
            "status": "warn",
            "detail": "No call to action in the first line.",
            "fix": "Add one clear next step."
           }
          ]
         },
         "posts": [
          {
           "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
           "status": "pending_approval",
           "kind": "photo",
           "caption": "Fresh seasonal menu starts Friday.",
           "captions": {
            "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
           },
           "networks": [
            "instagram"
           ],
           "scheduledAt": "2026-12-01T15:00:00.000Z",
           "createdAt": "2026-11-14T16:02:11.000Z",
           "revision": 1,
           "version": "sha256:…",
           "media": {
            "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
            "sha256": "…"
           },
           "googleCta": null,
           "approvedAt": null,
           "changeRequest": null,
           "createdVia": "api",
           "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "operationId": "listPosts",
    "summary": "List posts and statuses",
    "description": "Newest first. Status: pending_approval, changes_requested, approved, scheduled, publishing, published, failed, cancelled, needs_attention. Permission: read.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "Filter by status.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Page size (default 50).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "nextCursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "posts": [
          {
           "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
           "status": "pending_approval",
           "kind": "photo",
           "caption": "Fresh seasonal menu starts Friday.",
           "captions": {
            "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
           },
           "networks": [
            "instagram"
           ],
           "scheduledAt": "2026-12-01T15:00:00.000Z",
           "createdAt": "2026-11-14T16:02:11.000Z",
           "revision": 1,
           "version": "sha256:…",
           "media": {
            "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
            "sha256": "…"
           },
           "googleCta": null,
           "approvedAt": null,
           "changeRequest": null,
           "createdVia": "api",
           "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
          }
         ],
         "total": 1,
         "nextCursor": null
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}": {
   "get": {
    "operationId": "getPost",
    "summary": "One post",
    "description": "Includes any warning or failing quality checks. Permission: read.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "pending_approval",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": null,
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f",
         "qualityChecks": {
          "status": "pass",
          "checks": []
         }
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "delete": {
    "operationId": "deletePost",
    "summary": "Delete a draft",
    "description": "Only a post that has not been scheduled or sent. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "deleted": true
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/owner-messages": {
   "get": {
    "operationId": "getOwnerMessages",
    "summary": "What the owner left for your agent",
    "description": "Changes, offers, hours, anything the owner typed in Studio or told Mercedes. Optional since (ISO time) returns only newer ones. A message with postId is about that post (back with you as changes_requested). Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "LOCATION_ID",
         "messages": [
          {
           "id": "MESSAGE_ID",
           "at": "2026-12-06T15:00:00.000Z",
           "by": "mercedes",
           "text": "We have a $50 off spring special starting March 1."
          }
         ],
         "total": 1
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/approval-link": {
   "post": {
    "operationId": "getApprovalLink",
    "summary": "Get a no-login approval link",
    "description": "A link for a person to approve one post this key created, sent by your agent to whoever approves. Approve, Pass or ask for changes (changes come back to you). Dies once anyone acts or the post changes; expiresInDays 1–30, default 7. 409 approval_links_off until the business turns on Approve by email. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "recipient": "Elgin",
        "expiresInDays": 7
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "postId": "POST_ID",
         "url": "https://app.bizinga.studio/review/TOKEN",
         "expiresAt": "2026-12-12T15:00:00.000Z"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/revise": {
   "post": {
    "operationId": "revisePost",
    "summary": "Revise a post",
    "description": "A new version of a post this key created, usually after the owner asked for changes (status changes_requested, their words in changeRequest). Same fields as creating a post; networks and time default to the old post. The old version is retired. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "caption": "Holiday clean-out made simple. Open Saturdays too."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "requestId": "7d0f9b5e-2b1c-4c51-9e8a-3f1d2c4b5a69",
         "held": true,
         "status": "pending_approval",
         "replaces": "OLD_POST_ID",
         "posts": [
          {
           "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
           "status": "pending_approval",
           "kind": "photo",
           "caption": "Fresh seasonal menu starts Friday.",
           "captions": {
            "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
           },
           "networks": [
            "instagram"
           ],
           "scheduledAt": "2026-12-01T15:00:00.000Z",
           "createdAt": "2026-11-14T16:02:11.000Z",
           "revision": 1,
           "version": "sha256:…",
           "media": {
            "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
            "sha256": "…"
           },
           "googleCta": null,
           "approvedAt": null,
           "changeRequest": null,
           "createdVia": "api",
           "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
          }
         ]
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/reschedule": {
   "post": {
    "operationId": "reschedulePost",
    "summary": "Reschedule a post",
    "description": "Moves a post this key created to a new publish time. A post waiting for approval keeps waiting; an approved post not yet sent goes back for approval at the new time; a post already handed to the network returns 409 post_not_reschedulable (move it in Bizinga Studio). Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "scheduleAt": "2026-12-09T15:00:00Z"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "pending_approval",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": null,
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f",
         "message": "New time saved; it is still waiting for approval."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/cancel": {
   "post": {
    "operationId": "cancelPost",
    "summary": "Cancel (pass on) a post",
    "description": "Stops a post that is waiting for approval or scheduled in Studio and not yet handed to a network. The post stays in history as cancelled. /pass is the same request. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "reason": "Promotion ended early."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "cancelled",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": null,
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/pass": {
   "post": {
    "operationId": "passPost",
    "summary": "Pass on a post (same as cancel)",
    "description": "Alias of /cancel for review tools that say \"pass\". Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {}
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "cancelled",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": null,
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/approve": {
   "post": {
    "operationId": "approvePost",
    "summary": "Approve and schedule",
    "description": "Only when the business turned on direct publishing for this key and location, and only for posts this key created with a future scheduleAt. Permission: publish.execute.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {}
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "scheduled",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": null,
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/feedback": {
   "post": {
    "operationId": "requestChanges",
    "summary": "Ask for changes",
    "description": "Sends the post back to draft with your note for the Studio team. Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "message": "Please mention the Friday hours."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "status": "changes_requested",
         "kind": "photo",
         "caption": "Fresh seasonal menu starts Friday.",
         "captions": {
          "instagram": "Fresh seasonal menu starts Friday. #brunch #local"
         },
         "networks": [
          "instagram"
         ],
         "scheduledAt": "2026-12-01T15:00:00.000Z",
         "createdAt": "2026-11-14T16:02:11.000Z",
         "revision": 1,
         "version": "sha256:…",
         "media": {
          "assetId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
          "sha256": "…"
         },
         "googleCta": null,
         "approvedAt": null,
         "changeRequest": {
          "message": "Please mention the Friday hours.",
          "at": "2026-11-14T16:10:00.000Z"
         },
         "createdVia": "api",
         "requestId": "0d6f1b0e-6c1a-5b7e-9d1c-2a3b4c5d6e7f"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/posts/{postId}/share-link": {
   "get": {
    "operationId": "getShareLink",
    "summary": "Read a post's share link",
    "description": "The public page for an approved, scheduled or published post, if one exists. Permission: read.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "postId": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "shareable": true,
         "url": "https://app.bizinga.studio/s/AbCdEfGhIjKlMnOpQrStUvWx",
         "link": {
          "id": "…",
          "postId": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
          "url": "https://app.bizinga.studio/s/AbCdEfGhIjKlMnOpQrStUvWx",
          "createdAt": "2026-11-14T16:12:00.000Z",
          "revokedAt": null,
          "views": 0,
          "clicks": {
           "call": 0,
           "text": 0,
           "website": 0
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "createShareLink",
    "summary": "Create a post's share link",
    "description": "Creates the link or returns the existing one. Only approved, scheduled or published posts (409 post_not_shareable otherwise). Permission: draft.write.",
    "tags": [
     "Posts"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "postId",
      "in": "path",
      "required": true,
      "description": "Post ID from create or list.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": false,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {}
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "postId": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
         "shareable": true,
         "url": "https://app.bizinga.studio/s/AbCdEfGhIjKlMnOpQrStUvWx"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/tasks": {
   "get": {
    "operationId": "listTasks",
    "summary": "Open to-dos",
    "description": "Posts to review, reconnects and other tasks for the location. Permission: read.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "tasks": []
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/reports": {
   "get": {
    "operationId": "getLocationReport",
    "summary": "Location report",
    "description": "Views, reach, engagement and clicks per platform for a period, compared with the previous period. Permission: read.",
    "tags": [
     "Reports"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "period",
      "in": "query",
      "required": false,
      "description": "7d, 30d, 90d or custom (default 30d).",
      "schema": {
       "type": "string",
       "enum": [
        "7d",
        "30d",
        "90d",
        "custom"
       ]
      }
     },
     {
      "name": "start",
      "in": "query",
      "required": false,
      "description": "Custom start date YYYY-MM-DD.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "end",
      "in": "query",
      "required": false,
      "description": "Custom end date YYYY-MM-DD.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "compare",
      "in": "query",
      "required": false,
      "description": "previous (default) or none.",
      "schema": {
       "type": "string",
       "enum": [
        "previous",
        "none"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "source": "live",
         "period": {
          "days": 30,
          "current": {
           "start": "2026-10-15",
           "end": "2026-11-13"
          },
          "previous": {
           "start": "2026-09-15",
           "end": "2026-10-14"
          }
         },
         "totals": {
          "views": {
           "status": "ok",
           "current": 5400,
           "previous": 4100,
           "delta": 1300,
           "percent": 31.7
          }
         },
         "networks": [
          {
           "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
           "network": "facebook",
           "views": {
            "status": "ok",
            "current": 3000,
            "previous": 2500
           }
          }
         ],
         "summary": "Views up 32% on the previous 30 days."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/reviews": {
   "get": {
    "operationId": "getReviews",
    "summary": "Google reviews",
    "description": "Current Google rating and review count, the daily read (lastReadAt, nextReadAt), and recent Google reviews newest first: reviewer first name, stars, text, date, whether it was answered (reply.by owner or mercedes) and Mercedes' answer status. Query: rating (1–5), answered (true/false), limit (default 20, max 100), cursor. Permission: read.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "rating",
      "in": "query",
      "required": false,
      "description": "Only this many stars.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 5
      }
     },
     {
      "name": "answered",
      "in": "query",
      "required": false,
      "description": "true or false.",
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Page size (default 20).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "nextCursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "google": {
          "connected": true,
          "rating": 4.8,
          "count": 132,
          "dailyRead": {
           "everyHours": 24,
           "lastReadAt": "2026-11-25T09:12:00.000Z",
           "ok": true,
           "nextReadAt": "2026-11-26T09:40:00.000Z"
          }
         },
         "replyMode": "all",
         "reviews": [
          {
           "id": "upload_post:AbC123",
           "author": "Dana",
           "rating": 5,
           "text": "Quick, friendly and the patio looks great.",
           "createdAt": "2026-11-24T18:03:00.000Z",
           "answered": true,
           "reply": {
            "text": "Thank you, Dana! So glad the patio turned out the way you pictured it.",
            "at": "2026-11-25T09:12:30.000Z",
            "by": "mercedes"
           },
           "mercedes": {
            "status": "sent",
            "meaning": "Mercedes answered it."
           }
          }
         ],
         "total": 1,
         "nextCursor": null
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/review-posts": {
   "post": {
    "operationId": "createReviewPost",
    "summary": "Make a review post",
    "description": "A thank-you post for chosen 4–5 star reviews on file (any, not only new ones): the same video Mercedes makes for a new review, a 9:16 Short for the feeds and X plus a 16:9 copy for Google when Google is connected (nothing connected: the Short waits in the Media Center). Send one of reviewId (from GET /reviews), reviewIds (up to 5) or latest (the newest 1–5, optionally with source, for example google). Always held for the owner's approval in Tasks; approving schedules it. Once per review: one that already has a post comes back as exists. 1–3 star reviews are refused with the reason (422 review_not_eligible when none can be made). Permission: draft.write.",
    "tags": [
     "Scope"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "latest": 2,
        "source": "google"
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "status": "held_for_approval",
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "posts": [
          {
           "reviewId": "upload_post:AbC123",
           "by": "Dana",
           "rating": 5,
           "source": "google",
           "status": "queued",
           "jobIds": [
            "…",
            "…"
           ]
          },
          {
           "reviewId": "upload_post:Xy9",
           "by": "Sam",
           "rating": 3,
           "source": "google",
           "status": "refused",
           "reason": "Only 4 and 5 star reviews get a thank-you post (this one is 3 stars)."
          }
         ],
         "say": "I’m making a thank-you post for Dana’s review. It’ll be in your Tasks for approval. Sam: Only 4 and 5 star reviews get a thank-you post (this one is 3 stars).",
         "message": "Held for approval: each review post comes to the owner's Tasks; approving schedules it for the connected platforms."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/reply-settings": {
   "get": {
    "operationId": "getReplySettings",
    "summary": "Mercedes reply settings",
    "description": "Whether Mercedes answers comments on the location's posts (and the networks that covers) and which new Google reviews she answers: off, all or high (only 4–5 star); how each is handled (auto, or ask = the owner approves each answer in Tasks first) and how many answers wait for the owner (waitingForYou). Includes a plain explanation of each. Permission: read.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "canEdit": true,
         "comments": {
          "available": true,
          "enabled": true,
          "networks": [
           "facebook",
           "instagram",
           "youtube",
           "linkedin",
           "tiktok",
           "threads",
           "bluesky",
           "x"
          ],
          "explainer": "Mercedes answers comments on your posts for you…",
          "notes": {
           "x": "Replies are capped per day, carry no links, and nothing can be removed there."
          }
         },
         "reviews": {
          "available": true,
          "mode": "all",
          "label": "All reviews",
          "choices": [
           {
            "id": "off",
            "label": "Off"
           },
           {
            "id": "all",
            "label": "All reviews"
           },
           {
            "id": "high",
            "label": "Only 4–5 star"
           }
          ],
          "networks": [
           "google_business"
          ],
          "googleConnected": true,
          "explainer": "Mercedes answers new Google reviews for you…"
         },
         "summary": "I answer your comments, and I answer all your new Google reviews."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "setReplySettings",
    "summary": "Change Mercedes reply settings",
    "description": "Send any of comments (true or false), reviews (off, all or high), commentsHow and reviewsHow (auto or ask). Audited. Returns the settings as GET does. Permission: draft.write.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "comments": true,
        "reviews": "high",
        "reviewsHow": "ask"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "canEdit": true,
         "comments": {
          "enabled": true
         },
         "reviews": {
          "mode": "high",
          "label": "Only 4–5 star"
         },
         "summary": "I answer your comments, and I answer your new 4 and 5 star Google reviews."
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/comment-activity": {
   "get": {
    "operationId": "getCommentActivity",
    "summary": "Comment activity",
    "description": "What Mercedes did with comments on the location's posts: counts for the last days (default 7, max 30) of comments replied to, removed, hidden, left for the owner, failed, and the recent actions with network, commenter first name, comment, and her reply or reason. Paginated. Permission: read.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "days",
      "in": "query",
      "required": false,
      "description": "1–30 (default 7).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 30
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Page size (default 20).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "nextCursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "enabled": true,
         "period": {
          "days": 7,
          "since": "2026-11-19T00:00:00.000Z"
         },
         "counts": {
          "replied": 6,
          "removed": 1,
          "hidden": 0,
          "left": 0,
          "failed": 0,
          "unconfirmed": 0
         },
         "activity": [
          {
           "at": "2026-11-25T14:02:00.000Z",
           "action": "replied",
           "network": "facebook",
           "author": "Sam",
           "comment": "Do you do gutter cleaning too?",
           "category": "question",
           "reply": "We do, Sam! Give us a call and we'll get you on the schedule."
          }
         ],
         "total": 7,
         "nextCursor": null
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/content-guide": {
   "get": {
    "operationId": "getContentGuide",
    "summary": "Content guide (coaching for your agent)",
    "description": "Everything needed to write posts and replies for this location in one call: business facts (services, towns, phone, website, main call to action, tone, brand rules, offers, words to avoid), the next keyword and town from the rotation and the keyword rule, recent posts not to repeat, each connected network's sizes, ratios, lengths, caption and hashtag limits and link rule, the copy rules Studio enforces, the industry rules (Fair Housing and others), and the review and comment reply rules. Query: network, format. Permission: read.",
    "tags": [
     "Platform requirements"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "network",
      "in": "query",
      "required": false,
      "description": "Only this network.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "text, photo, video or document.",
      "schema": {
       "type": "string",
       "enum": [
        "text",
        "photo",
        "video",
        "document"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "order": "Write … then validate_post … then create_post.",
         "business": {
          "name": "Maple Cafe",
          "services": [
           "Brunch",
           "Catering"
          ],
          "serviceAreas": [
           {
            "city": "Carmel",
            "state": "IN"
           }
          ],
          "mainCallToAction": {
           "kind": "book",
           "value": "maplecafe.com"
          },
          "tone": "friendly"
         },
         "keywords": {
          "next": {
           "keyword": {
            "say": "brunch in carmel",
            "town": "Carmel"
           },
           "town": {
            "city": "Carmel",
            "state": "IN"
           }
          },
          "maxPerPost": 2
         },
         "recentPosts": {
          "posts": [
           {
            "title": "Pumpkin pancakes are back",
            "date": "2026-11-20T15:00:00.000Z"
           }
          ]
         },
         "rules": [
          {
           "id": "google-no-contact-details",
           "rule": "Google Business posts never include a phone number…"
          }
         ],
         "links": "Never put a link in the post body…",
         "platforms": {
          "networks": [
           {
            "network": "instagram",
            "hashtags": {
             "max": 5
            }
           }
          ]
         },
         "industry": {
          "recipe": "general_local_business",
          "compliance": []
         },
         "replies": {
          "reviews": {
           "instructions": "…",
           "checks": {
            "generic": "…"
           }
          },
          "comments": {
           "instructions": "…"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/inbox": {
   "get": {
    "operationId": "getInbox",
    "summary": "What is new",
    "description": "New and unanswered Google reviews and comments, posts waiting for approval or with change requests, failed posts and open tasks since a time (default 24 hours ago). Poll every 15 minutes or more; there are no webhooks yet. Permission: read.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "ISO time (default 24 hours ago).",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "since": "2026-11-25T15:00:00.000Z",
         "reviews": {
          "new": 1,
          "unanswered": 1,
          "newUnanswered": []
         },
         "comments": {
          "new": 2,
          "unanswered": 1,
          "newUnanswered": []
         },
         "posts": {
          "pendingApproval": 2,
          "changesRequested": 0,
          "failed": 0,
          "scheduledNext7Days": 5
         },
         "tasks": {
          "open": 3
         },
         "waitingForApproval": {
          "reviews": 1,
          "comments": 0
         },
         "mercedes": "Mercedes is also answering here comments and Google reviews…"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/reviews/{reviewId}/reply": {
   "post": {
    "operationId": "replyToReview",
    "summary": "Answer a Google review",
    "description": "Body: text, optional dryRun. The text must meet Mercedes' bar (first name, something specific they said, contact details on 1–3 stars); otherwise 422 reply_quality with the reason and fix. dryRun only checks (read permission). With publish.execute and direct publishing for this key and location it posts (201). Otherwise (draft.write is enough) it waits in the owner's Tasks like an Ask-me-first answer: 202 {status:'held_for_approval', taskId, replaced}; approving posts it once, Skip drops it, and it replaces a waiting draft of Mercedes'. Google is re-checked right before sending (409 already_answered if someone answered). Permission: draft.write.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "reviewId",
      "in": "path",
      "required": true,
      "description": "Review id from GET /reviews (URL-encode it).",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "text": "Thank you, Dana! So glad the patio turned out the way you pictured it."
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "reviewId": "upload_post:AbC123",
         "status": "sent",
         "by": "agent",
         "text": "Thank you, Dana! …",
         "at": "2026-11-26T15:00:00.000Z",
         "state": "APPROVED"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/comments": {
   "get": {
    "operationId": "listComments",
    "summary": "Comments on recent posts",
    "description": "Comments on the location's posts from the last 14 days, newest first: network, post, commenter first name, text, status, answered and by whom (mercedes or agent). Query: unanswered, since, network, limit, cursor. Each post is read for new comments at most every 10 minutes. Permission: read.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "unanswered",
      "in": "query",
      "required": false,
      "description": "true: only comments that still need an answer.",
      "schema": {
       "type": "string",
       "enum": [
        "true",
        "false"
       ]
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "ISO time.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "network",
      "in": "query",
      "required": false,
      "description": "One network.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Page size (default 50).",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "nextCursor from the previous page.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
         "comments": [
          {
           "id": "facebook:1234_5678",
           "network": "facebook",
           "post": {
            "id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
            "title": "Fresh seasonal menu"
           },
           "author": "Sam",
           "text": "Do you cater?",
           "commentedAt": "2026-11-26T14:00:00.000Z",
           "status": "queued",
           "state": "new",
           "answered": false,
           "by": null
          }
         ],
         "total": 1,
         "nextCursor": null,
         "actions": {
          "x": {
           "reply": true,
           "remove": []
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/comments/{commentId}/reply": {
   "post": {
    "operationId": "replyToComment",
    "summary": "Reply to a comment",
    "description": "Body: text, optional dryRun. Generic, copied or made-up-price replies return 422 reply_quality. With direct publishing for this key and location it posts (201); otherwise 202 held_for_approval with taskId (an owner Task, replacing a waiting draft of Mercedes'). X replies are capped per day (429 x_daily_cap). Permission: draft.write.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "description": "Comment id from GET /comments (URL-encode it).",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "text": "We do, Sam! Give us a call and we'll plan your event."
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "commentId": "facebook:1234_5678",
         "status": "replied",
         "by": "agent",
         "reply": "We do, Sam! …"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/comments/{commentId}/hide": {
   "post": {
    "operationId": "hideComment",
    "summary": "Hide a comment",
    "description": "Spam or abuse only, never a real complaint. Where the network allows hiding (409 not_supported_on_network otherwise). Needs direct publishing. Permission: publish.execute.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "description": "Comment id from GET /comments (URL-encode it).",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "reason": "spam"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "commentId": "instagram:987",
         "status": "hidden",
         "by": "agent"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/locations/{locationId}/comments/{commentId}/delete": {
   "post": {
    "operationId": "deleteComment",
    "summary": "Delete a comment",
    "description": "Spam or abuse only, never a real complaint. Facebook, Instagram, YouTube and LinkedIn. Needs direct publishing. Permission: publish.execute.",
    "tags": [
     "Replies and reviews"
    ],
    "parameters": [
     {
      "name": "locationId",
      "in": "path",
      "required": true,
      "description": "Location ID (UUID) from GET /locations.",
      "schema": {
       "type": "string",
       "format": "uuid"
      }
     },
     {
      "name": "commentId",
      "in": "path",
      "required": true,
      "description": "Comment id from GET /comments (URL-encode it).",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "description": "8–128 characters [A-Za-z0-9._:-]. Replaying the same key with the same body returns the first result; a different body returns 409.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       },
       "example": {
        "reason": "prize scam"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "commentId": "facebook:1234_5678",
         "status": "removed",
         "by": "agent"
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/reports": {
   "get": {
    "operationId": "getBusinessReport",
    "summary": "Business report",
    "description": "Every location of one business, per platform and per location. businessId is optional for business and location keys. Permission: read.",
    "tags": [
     "Reports"
    ],
    "parameters": [
     {
      "name": "businessId",
      "in": "query",
      "required": false,
      "description": "Business ID.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "period",
      "in": "query",
      "required": false,
      "description": "7d, 30d, 90d or custom (default 30d).",
      "schema": {
       "type": "string",
       "enum": [
        "7d",
        "30d",
        "90d",
        "custom"
       ]
      }
     },
     {
      "name": "start",
      "in": "query",
      "required": false,
      "description": "Custom start date YYYY-MM-DD.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "end",
      "in": "query",
      "required": false,
      "description": "Custom end date YYYY-MM-DD.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "compare",
      "in": "query",
      "required": false,
      "description": "previous (default) or none.",
      "schema": {
       "type": "string",
       "enum": [
        "previous",
        "none"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        },
        "example": {
         "businessId": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
         "source": "live",
         "period": {
          "days": 30
         },
         "totals": {
          "views": {
           "status": "ok",
           "current": 9100,
           "previous": 7700
          }
         },
         "networks": [
          {
           "locationId": "3f2a9c1e-5b7d-4e8a-9c0b-1d2e3f4a5b6c",
           "network": "instagram",
           "views": {
            "status": "ok",
            "current": 4100,
            "previous": 3600
           }
          }
         ],
         "posts": []
        }
       }
      }
     },
     "default": {
      "description": "Error: {code, message}",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "x-mcp": {
  "url": "https://bizinga.studio/mcp",
  "transport": "streamable-http",
  "auth": "x-api-key or Authorization: Bearer"
 },
 "x-error-codes": [
  {
   "status": 400,
   "code": "invalid_request",
   "meaning": "A field is missing or malformed. The message names it."
  },
  {
   "status": 400,
   "code": "invalid_cursor",
   "meaning": "The cursor is not one we issued. Start again without cursor."
  },
  {
   "status": 401,
   "code": "unauthorized",
   "meaning": "Missing, invalid, expired or revoked key."
  },
  {
   "status": 403,
   "code": "forbidden",
   "meaning": "The key lacks the permission for this action."
  },
  {
   "status": 403,
   "code": "location_out_of_scope",
   "meaning": "The location is outside the key's businesses or locations."
  },
  {
   "status": 403,
   "code": "business_out_of_scope",
   "meaning": "The business is outside the key's scope."
  },
  {
   "status": 403,
   "code": "approval_not_delegated",
   "meaning": "Only a person in Studio can approve this post."
  },
  {
   "status": 404,
   "code": "not_found",
   "meaning": "The post or record does not exist in this location."
  },
  {
   "status": 404,
   "code": "route_not_found",
   "meaning": "No such endpoint. Check the method and path."
  },
  {
   "status": 409,
   "code": "conflict",
   "meaning": "The record changed, or the Idempotency-Key was reused with a different body."
  },
  {
   "status": 409,
   "code": "network_not_connected",
   "meaning": "A requested network is not connected on the location."
  },
  {
   "status": 409,
   "code": "post_not_cancellable",
   "meaning": "The post was already sent or handed to the network."
  },
  {
   "status": 409,
   "code": "post_not_shareable",
   "meaning": "Only approved, scheduled or published posts have share links."
  },
  {
   "status": 415,
   "code": "unsupported_media_type",
   "meaning": "Media must be JPEG, PNG or MP4."
  },
  {
   "status": 422,
   "code": "quality_check_failed",
   "meaning": "A red pre-publish quality check failed. details.checks lists each with a fix. Nothing was saved."
  },
  {
   "status": 422,
   "code": "media_size_not_allowed",
   "meaning": "The photo or video is not a size every listed network takes. details.issues names each network, the sizes it takes and the fix (often: send that network, always Google, as its own post). Nothing was saved."
  },
  {
   "status": 422,
   "code": "post_rules_failed",
   "meaning": "The post breaks a platform rule (Google text with a phone number, email or @handle: use googleCta instead; more than 5 Instagram hashtags; YouTube without youtubeAudience; a Google button without a valid url). details.issues lists each with a fix. Nothing was saved."
  },
  {
   "status": 403,
   "code": "reply_needs_approval",
   "meaning": "Hiding or deleting a comment needs direct publishing on for this key at the location. Nothing was removed. (Replies are held for approval instead: 202 held_for_approval.)"
  },
  {
   "status": 409,
   "code": "already_answered",
   "meaning": "The review already has an answer (from the owner, Mercedes or another agent)."
  },
  {
   "status": 409,
   "code": "already_handled",
   "meaning": "The comment was already answered or removed."
  },
  {
   "status": 409,
   "code": "not_supported_on_network",
   "meaning": "The network does not allow that action (for example removing a comment on X)."
  },
  {
   "status": 422,
   "code": "reply_quality",
   "meaning": "The reply failed a quality check (generic, no first name, copied, missing contact details on a low review). details.reason and details.fix say what to change."
  },
  {
   "status": 422,
   "code": "review_not_eligible",
   "meaning": "None of the chosen reviews can get a review post (1–3 stars, or no reviewer name). details.posts gives the reason for each."
  },
  {
   "status": 409,
   "code": "review_post_held",
   "meaning": "The review post could not be started right now (for example the location is not active). details.posts gives the reason."
  },
  {
   "status": 429,
   "code": "x_daily_cap",
   "meaning": "X replies are capped per day for each location."
  },
  {
   "status": 429,
   "code": "rate_limited",
   "meaning": "Over 120 requests per minute for this key. Wait Retry-After seconds."
  },
  {
   "status": 503,
   "code": "unavailable",
   "meaning": "A dependency is temporarily unavailable. Retry later."
  }
 ]
}