{
  "openapi": "3.0.4",
  "info": {
    "title": "Metronoms API",
    "description": "Plan, schedule and publish social media posts for your clients, and read their figures.\n\n**API access is an add-on** for workspaces on the Agency or White Label plan, switched on by Metronoms: contact us from Help → Contact support. Without it every call answers 403 `API_ADDON_REQUIRED`.\n\n**Sign in** with an API key from Settings → API and AI assistants: `Authorization: Bearer mtr_live_…` (or `X-Api-Key: mtr_live_…`). A key acts as the person who created it, in that workspace: it can do what their login can do, for the clients they work on, and stops working when their access ends.\n\n**Limits:** 120 requests a minute and 10,000 a day per key; over that the answer is 429 with `Retry-After`.\n\n**Times:** ISO 8601. A time without an offset (`2026-11-02T09:30`) is read in the client's own time zone (see `timeZone` on GET /api/v1/clients). Answers give times in the client's zone, with the offset.\n\n**Post ids:** a post made through Metronoms keeps one id from scheduling to publishing; drafts and imported posts have their own.\n\n**Events:** GET /api/v1/events lists what happened in the last 30 days (posts published or failed, monthly reports ready, new leads in the CRM), newest first, each with a stable unique id, for tools that check for new events such as Zapier.\n\n**Errors** are JSON `{ error, code, message }`: `code` is stable, `message` is a sentence.\n\n**AI assistants and Zapier:** the same operations are available as an MCP server at /mcp (Streamable HTTP) and in the Metronoms app for Zapier, with the Agency and White Label plans. They sign in with their own kind of key (an MCP and Zapier key): that key answers 403 `KEY_KIND_MISMATCH` here, and an API key does there.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.metronoms.com"
    }
  ],
  "paths": {
    "/api/v1/me": {
      "get": {
        "tags": [
          "Workspace"
        ],
        "summary": "Who this key is",
        "description": "The workspace the key works in, the person who made it (it can do what their login can do), and the key's name. Handy to check a key and to name a connection.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Me"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "List clients",
        "description": "The clients you can post for, with each one's time zone. In a business workspace: the one business.",
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ClientList"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{clientId}/accounts": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "List a client's accounts",
        "description": "The client's connected social accounts that posts can go to. Never includes any network's tokens.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1AccountList"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/clients/{clientId}/analytics": {
      "get": {
        "tags": [
          "Clients"
        ],
        "summary": "Get a client's figures",
        "description": "Followers, reach, views, engagement and posts published for a period (days in the client's time zone; default the last 30 days, at most a year).",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Analytics"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Add a photo or video",
        "description": "Upload a file as multipart/form-data (field `file`, optional `clientId`), or send JSON `{ \"url\": \"…\", \"clientId\": \"…\" }` to fetch a public address (public internet only). Up to 200 MB. Use the answer's id in a post's mediaIds.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "A photo or video, up to 200 MB.",
                    "format": "binary"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "The client whose media library it goes into. Optional for the agency team (no client = shared media).",
                    "format": "uuid",
                    "nullable": true
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "required": [
                  "url"
                ],
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "A public http(s) address of a photo or video (up to 200 MB).",
                    "format": "uri"
                  },
                  "clientId": {
                    "type": "string",
                    "description": "The client whose media library it goes into. Optional for the agency team (no client = shared media).",
                    "format": "uuid",
                    "nullable": true
                  }
                }
              },
              "example": {
                "url": "https://example.com/croissants.jpg",
                "clientId": "3f2b8c1e-5d6a-4c1b-9e1a-2b7c8d9e0f12"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Media"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Create a post",
        "description": "A draft, a post scheduled for scheduledAt, or one published now. Same checks and approval rules as the Metronoms composer. Send an Idempotency-Key header to make retries safe: the same key returns the same post.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1CreatePostRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/V1CreatePostRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CreatePostResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1CreatePostResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List posts",
        "description": "Posts on the calendar between from and to (at most 93 days; default the last 7 days and the next 30), oldest first. from/to: a date or an ISO 8601 time; without an offset they are in the client's time zone (UTC without clientId). status: comma-separated draft, scheduled, awaitingApproval, publishing, published, partiallyPublished, failed, canceled.",
        "parameters": [
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1PostList"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/posts/{id}": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a post",
        "description": "Status, time, text, media and per-account results (link once published, a sentence if it failed).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Post"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Posts"
        ],
        "summary": "Delete a post",
        "description": "Cancels a scheduled post (or one awaiting approval) or deletes a draft. A post that has gone out, or is going out, answers 409.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "content": {
              "application/json": { }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List recent events",
        "description": "What happened in the last 30 days, newest first, at most 100 (limit, default 100). type (required; comma-separated): post.published (one event per account a post went out on), post.failed (one per account that failed, or one for the post when it failed before reaching any), report.ready (a monthly report made by the monthly report job, or sent to the client), lead.created (a company added to the CRM; Owners and Members on all clients, plans with the CRM). clientId narrows post and report events to one client. Every event has a stable unique id, so a tool that checks for new events (such as Zapier) can skip the ones it has seen.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1EventList"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "V1Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "network": {
            "type": "string",
            "description": "facebook, instagram, google, threads, tiktok, linkedin, pinterest, youtube, x, bluesky or mastodon."
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "connected, or needsReconnect when the network no longer accepts the connection (reconnect it in Metronoms)."
          }
        }
      },
      "V1AccountList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Account"
            }
          }
        }
      },
      "V1Analytics": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "description": "First day, YYYY-MM-DD."
          },
          "to": {
            "type": "string",
            "description": "Last day, YYYY-MM-DD (inclusive)."
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "followers": {
            "type": "integer",
            "description": "Followers now, across the networks that report them.",
            "format": "int64"
          },
          "followerGrowth": {
            "type": "integer",
            "description": "Change in followers over the period, when known.",
            "format": "int64",
            "nullable": true
          },
          "reach": {
            "type": "integer",
            "format": "int64"
          },
          "views": {
            "type": "integer",
            "format": "int64"
          },
          "impressions": {
            "type": "integer",
            "format": "int64"
          },
          "engagement": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "engagementRate": {
            "type": "number",
            "description": "Engagement as a percentage of reach, when known.",
            "format": "double",
            "nullable": true
          },
          "postsPublished": {
            "type": "integer",
            "format": "int32"
          },
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1NetworkAnalytics"
            }
          }
        }
      },
      "V1Client": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "timeZone": {
            "type": "string",
            "description": "The client's IANA time zone, e.g. America/Chicago. Post times without an offset are read in this zone. Null when the client has none set.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "onboarding, active, paused or churned."
          },
          "website": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "V1ClientList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Client"
            }
          }
        }
      },
      "V1CreatePostRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string",
            "description": "The client the post is for.",
            "format": "uuid"
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The client's accounts to post to (GET /api/v1/clients/{clientId}/accounts). Optional for a draft.",
            "nullable": true
          },
          "text": {
            "type": "string",
            "description": "The post's text.",
            "nullable": true
          },
          "link": {
            "type": "string",
            "description": "A link, kept apart from the text so each network gets it the way it can use it.",
            "nullable": true
          },
          "addWebsiteLink": {
            "type": "boolean",
            "description": "false to leave the client's website link off this post. Without a link of its own, a post gets the client's website (from Business details) as its link unless the client's setting is off.",
            "nullable": true
          },
          "mediaIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Media already uploaded with POST /api/v1/media, in order.",
            "nullable": true
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1MediaUrl"
            },
            "description": "Photos or videos by public address, copied into the client's library first (after mediaIds).",
            "nullable": true
          },
          "scheduledAt": {
            "type": "string",
            "description": "When to publish. ISO 8601 with an offset (2026-11-02T09:30:00-05:00 or ...Z), or a local time without one (2026-11-02T09:30), which is read in the client's time zone. Required unless publishNow or draft is true; for a draft it only places it on the calendar.",
            "nullable": true
          },
          "publishNow": {
            "type": "boolean",
            "description": "Publish straight away instead of at scheduledAt."
          },
          "draft": {
            "type": "boolean",
            "description": "Save as a draft: nothing is published until someone schedules it in Metronoms."
          },
          "facebook": {
            "$ref": "#/components/schemas/V1FormatOption"
          },
          "instagram": {
            "$ref": "#/components/schemas/V1FormatOption"
          },
          "clientApprovesFirst": {
            "type": "boolean",
            "description": "Hold the post until the client approves it: the client is emailed a link to approve it. Scheduled posts only."
          }
        }
      },
      "V1CreatePostResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The post's id, for GET and DELETE /api/v1/posts/{id}.",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "draft, scheduled, awaitingApproval, publishing, published, partiallyPublished, failed or canceled."
          },
          "scheduledAt": {
            "type": "string",
            "description": "When it goes out, in the client's time zone (with its offset). Null for a draft without a time.",
            "format": "date-time",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "clientApproval": {
            "type": "string",
            "description": "Set when the post waits for the client's approval: whether the approval email was sent, and a sentence about it.",
            "nullable": true
          }
        }
      },
      "V1Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "V1Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique and stable: the same event always has the same id, so a tool that checks for new events (such as Zapier) can skip the ones it has seen."
          },
          "type": {
            "type": "string",
            "description": "post.published, post.failed, report.ready or lead.created."
          },
          "at": {
            "type": "string",
            "description": "When it happened, in the client's time zone with its offset (UTC for leads, and for clients with no time zone set).",
            "format": "date-time"
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "description": "The client it's about. Null for leads, which belong to the whole workspace.",
            "format": "uuid",
            "nullable": true
          },
          "clientName": {
            "type": "string",
            "nullable": true
          },
          "post": {
            "$ref": "#/components/schemas/V1EventPost"
          },
          "report": {
            "$ref": "#/components/schemas/V1EventReport"
          },
          "lead": {
            "$ref": "#/components/schemas/V1EventLead"
          }
        }
      },
      "V1EventContact": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          }
        },
        "description": "The first person at the company, when there is one.",
        "nullable": true
      },
      "V1EventDeal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "stage": {
            "type": "string",
            "description": "The pipeline stage it's in, e.g. New lead.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "open, won or lost."
          },
          "monthlyValue": {
            "type": "number",
            "description": "What it's worth a month, in the currency's units (e.g. 450.00).",
            "format": "double",
            "nullable": true
          },
          "oneTimeValue": {
            "type": "number",
            "description": "A one-time amount, in the currency's units.",
            "format": "double",
            "nullable": true
          },
          "currency": {
            "type": "string"
          }
        },
        "description": "The company's deal in the pipeline, when there is one.",
        "nullable": true
      },
      "V1EventLead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The company's id in the CRM.",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "website": {
            "type": "string",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "region": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "category": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "description": "How it came into the CRM: manual (added by someone), findLeads (from Find Leads) or import."
          },
          "contact": {
            "$ref": "#/components/schemas/V1EventContact"
          },
          "deal": {
            "$ref": "#/components/schemas/V1EventDeal"
          },
          "appUrl": {
            "type": "string",
            "description": "Opens the company in the CRM in Metronoms (sign-in needed)."
          }
        },
        "description": "Set for lead.created.",
        "nullable": true
      },
      "V1EventList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1Event"
            },
            "description": "Newest first."
          },
          "hasMore": {
            "type": "boolean",
            "description": "True when the last 30 days hold more events of these types than were returned."
          }
        }
      },
      "V1EventPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The post's id, for GET /api/v1/posts/{id}.",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "published, pending (sent, and the network is still reviewing it, as Google does) or failed."
          },
          "accountId": {
            "type": "string",
            "description": "The account it went out on (or failed on). Null when the post failed before reaching any account.",
            "format": "uuid",
            "nullable": true
          },
          "network": {
            "type": "string",
            "description": "facebook, instagram, google, threads, tiktok, linkedin, pinterest, youtube, x, bluesky or mastodon.",
            "nullable": true
          },
          "accountName": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string",
            "description": "The post's text."
          },
          "link": {
            "type": "string",
            "description": "The post's link, when it has one.",
            "nullable": true
          },
          "mediaCount": {
            "type": "integer",
            "format": "int32"
          },
          "url": {
            "type": "string",
            "description": "Link to the post on the network, once published.",
            "nullable": true
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in words (post.failed).",
            "nullable": true
          },
          "format": {
            "type": "string",
            "description": "reel or story when it went up as one.",
            "nullable": true
          },
          "scheduledAt": {
            "type": "string",
            "description": "When it was scheduled to go out, in the client's time zone.",
            "format": "date-time",
            "nullable": true
          },
          "appUrl": {
            "type": "string",
            "description": "Opens the calendar in Metronoms on the post's day.",
            "nullable": true
          }
        },
        "description": "Set for post.published and post.failed.",
        "nullable": true
      },
      "V1EventReport": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "year": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "description": "1 to 12.",
            "format": "int32"
          },
          "period": {
            "type": "string",
            "description": "The month in words, e.g. September 2026."
          },
          "automatic": {
            "type": "boolean",
            "description": "True when the monthly report job made it; false when someone made it and sent it to the client."
          },
          "sentAt": {
            "type": "string",
            "description": "When it was last emailed to the client. Null when it hasn't been.",
            "format": "date-time",
            "nullable": true
          },
          "sentTo": {
            "type": "string",
            "description": "Who it was last emailed to.",
            "nullable": true
          },
          "postsPublished": {
            "type": "integer",
            "format": "int32"
          },
          "reach": {
            "type": "integer",
            "format": "int64"
          },
          "engagements": {
            "type": "integer",
            "format": "int64"
          },
          "appUrl": {
            "type": "string",
            "description": "Opens the report in Metronoms (sign-in needed)."
          }
        },
        "description": "Set for report.ready.",
        "nullable": true
      },
      "V1FormatOption": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "description": "post, reel or story. Leave out for the usual choice (Instagram: a single video is a Reel).",
            "nullable": true
          }
        },
        "nullable": true
      },
      "V1Me": {
        "type": "object",
        "properties": {
          "workspaceId": {
            "type": "string",
            "format": "uuid"
          },
          "workspaceName": {
            "type": "string"
          },
          "userName": {
            "type": "string",
            "description": "The person who made the key. The key can do what their login can do.",
            "nullable": true
          },
          "userEmail": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string",
            "description": "owner or member."
          },
          "allClients": {
            "type": "boolean",
            "description": "True when the person works on every client; false for a Member on chosen clients."
          },
          "keyId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "keyName": {
            "type": "string",
            "description": "The name given to the key in Settings → API and AI assistants.",
            "nullable": true
          }
        }
      },
      "V1Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "A temporary link to look at the file (about an hour). Use the id, not this link, in posts."
          },
          "type": {
            "type": "string",
            "description": "image or video."
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "durationSeconds": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "fileName": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "V1MediaUrl": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "A public http(s) address of a photo or video; it is copied into our storage first.",
            "nullable": true
          }
        }
      },
      "V1NetworkAnalytics": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "accounts": {
            "type": "integer",
            "format": "int32"
          },
          "followers": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "reach": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "views": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "engagement": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "postsPublished": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "V1Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "status": {
            "type": "string"
          },
          "scheduledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string"
          },
          "link": {
            "type": "string",
            "nullable": true
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1PostMedia"
            }
          },
          "accountIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "facebook": {
            "$ref": "#/components/schemas/V1FormatOption"
          },
          "instagram": {
            "$ref": "#/components/schemas/V1FormatOption"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1PostResult"
            }
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in words, when it failed.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "imported": {
            "type": "boolean"
          }
        }
      },
      "V1PostLink": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "V1PostList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1PostSummary"
            }
          },
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "hasMore": {
            "type": "boolean",
            "description": "True when there are more posts in the range than were returned (use offset)."
          }
        }
      },
      "V1PostMedia": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "A temporary link to the file (a few hours)."
          },
          "type": {
            "type": "string"
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "durationSeconds": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        }
      },
      "V1PostResult": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "network": {
            "type": "string"
          },
          "accountName": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "published, failed, publishing, or pending (the network is still reviewing it, e.g. Google)."
          },
          "url": {
            "type": "string",
            "description": "Link to the post on the network, once published.",
            "nullable": true
          },
          "networkPostId": {
            "type": "string",
            "description": "The network's own id for the post.",
            "nullable": true
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in words.",
            "nullable": true
          },
          "format": {
            "type": "string",
            "description": "reel or story when it went up as one.",
            "nullable": true
          },
          "note": {
            "type": "string",
            "nullable": true
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "V1PostSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "draft, scheduled, awaitingApproval, publishing, published, partiallyPublished, failed or canceled."
          },
          "scheduledAt": {
            "type": "string",
            "description": "When it goes (or went) out, in the client's time zone when known, otherwise UTC.",
            "format": "date-time",
            "nullable": true
          },
          "timeZone": {
            "type": "string",
            "nullable": true
          },
          "text": {
            "type": "string",
            "description": "The start of the text (up to 120 characters)."
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mediaCount": {
            "type": "integer",
            "format": "int32"
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/V1PostLink"
            },
            "description": "Links to the published posts, by network."
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in words, for a failed or partly published post.",
            "nullable": true
          },
          "imported": {
            "type": "boolean",
            "description": "Brought in from the network, not published through Metronoms."
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "description": "An API key (not an MCP and Zapier key), as `Authorization: Bearer mtr_live_…`. `X-Api-Key: mtr_live_…` also works.",
        "scheme": "bearer",
        "bearerFormat": "mtr_live_…"
      }
    }
  },
  "security": [
    {
      "apiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Workspace"
    },
    {
      "name": "Clients"
    },
    {
      "name": "Media"
    },
    {
      "name": "Posts"
    },
    {
      "name": "Events"
    }
  ]
}