{
 "openapi": "3.1.0",
 "info": {
  "title": "Platemark",
  "version": "1.2.0",
  "description": "Platemark turns data into finished files: chart images from numbers, invoice, quote and receipt PDFs with the math done, template images and short videos. Send numbers and get a clean bar, line, area, pie or donut chart PNG; send line items and get a PDF with the totals computed to the cent; fill a template with text and photo URLs and get a PNG or vertical MP4. REST API, remote MCP server for AI agents, 100 free credits a month.",
  "contact": {
   "email": "support@rowhousesoftware.com"
  }
 },
 "servers": [
  {
   "url": "https://platemark.rowhousesoftware.com"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "A pm_... key from POST /v1/accounts"
   }
  },
  "schemas": {
   "Modifications": {
    "type": "object",
    "additionalProperties": {
     "oneOf": [
      {
       "type": "string"
      },
      {
       "type": "object"
      }
     ]
    },
    "description": "Keyed by slot name. A string, or {text, color}, {image_url} or {text, bg}."
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/v1/accounts": {
   "post": {
    "operationId": "createAccount",
    "summary": "Create a free account and API key",
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "email"
        ],
        "properties": {
         "email": {
          "type": "string",
          "format": "email"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Account and key (shown once)"
     }
    }
   }
  },
  "/v1/account": {
   "get": {
    "operationId": "getAccount",
    "summary": "Plan, credits left and signing secret",
    "responses": {
     "200": {
      "description": "Account"
     }
    }
   }
  },
  "/v1/templates": {
   "get": {
    "operationId": "listTemplates",
    "summary": "Every template with its slots",
    "security": [],
    "responses": {
     "200": {
      "description": "Templates"
     }
    }
   }
  },
  "/v1/images": {
   "post": {
    "operationId": "renderImage",
    "summary": "Fill a template and get a PNG",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "template"
        ],
        "properties": {
         "template": {
          "type": "string",
          "enum": [
           "announcement-story",
           "just-listed-square",
           "just-listed-story",
           "og-image",
           "og-image-photo",
           "product-card-square",
           "quote-card-square",
           "quote-card-story",
           "sale-banner-square",
           "social-post-portrait",
           "social-post-square",
           "video-thumbnail"
          ]
         },
         "modifications": {
          "$ref": "#/components/schemas/Modifications"
         },
         "response": {
          "type": "string",
          "enum": [
           "json"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "PNG",
      "content": {
       "image/png": {}
      }
     },
     "400": {
      "description": "Bad input",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Out of credits"
     }
    }
   }
  },
  "/v1/charts": {
   "post": {
    "operationId": "renderChart",
    "summary": "Turn numbers into a bar, line, area, pie or donut chart PNG",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "type"
        ],
        "properties": {
         "type": {
          "type": "string",
          "enum": [
           "bar",
           "horizontal_bar",
           "stacked_bar",
           "line",
           "area",
           "pie",
           "donut"
          ]
         },
         "title": {
          "type": "string"
         },
         "subtitle": {
          "type": "string"
         },
         "source": {
          "type": "string"
         },
         "labels": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "values": {
          "type": "array",
          "items": {
           "type": [
            "number",
            "null"
           ]
          }
         },
         "series": {
          "type": "array",
          "maxItems": 8,
          "items": {
           "type": "object",
           "required": [
            "values"
           ],
           "properties": {
            "name": {
             "type": "string"
            },
            "values": {
             "type": "array",
             "items": {
              "type": [
               "number",
               "null"
              ]
             }
            }
           }
          }
         },
         "format": {
          "type": "string",
          "enum": [
           "number",
           "currency",
           "percent"
          ]
         },
         "currency": {
          "type": "string"
         },
         "locale": {
          "type": "string"
         },
         "decimals": {
          "type": "integer"
         },
         "highlight": {
          "type": "string"
         },
         "size": {
          "type": "string",
          "enum": [
           "landscape",
           "og",
           "square",
           "portrait",
           "story"
          ]
         },
         "width": {
          "type": "integer"
         },
         "height": {
          "type": "integer"
         },
         "theme": {
          "type": "string",
          "enum": [
           "light",
           "dark"
          ]
         },
         "colors": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "show_values": {
          "type": "boolean"
         },
         "y_min": {
          "type": "number"
         },
         "y_max": {
          "type": "number"
         },
         "response": {
          "type": "string",
          "enum": [
           "png",
           "json",
           "svg"
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "PNG, or JSON with url and alt_text",
      "content": {
       "image/png": {},
       "application/json": {}
      }
     },
     "400": {
      "description": "Bad chart spec",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/videos": {
   "post": {
    "operationId": "renderVideo",
    "summary": "Queue a video made from template or photo scenes",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "scenes"
        ],
        "properties": {
         "scenes": {
          "type": "array",
          "maxItems": 20,
          "items": {
           "type": "object",
           "properties": {
            "template": {
             "type": "string"
            },
            "image_url": {
             "type": "string"
            },
            "modifications": {
             "$ref": "#/components/schemas/Modifications"
            },
            "seconds": {
             "type": "number",
             "minimum": 1,
             "maximum": 30
            },
            "motion": {
             "type": "string",
             "enum": [
              "none",
              "zoom_in",
              "zoom_out",
              "pan_left",
              "pan_right"
             ]
            }
           }
          }
         },
         "transition": {
          "type": "string",
          "enum": [
           "fade",
           "cut"
          ]
         },
         "audio_url": {
          "type": "string"
         },
         "webhook_url": {
          "type": "string"
         }
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Queued job"
     }
    }
   }
  },
  "/v1/documents": {
   "post": {
    "operationId": "renderDocument",
    "summary": "Make an invoice, quote, receipt, certificate or letter PDF with the totals computed",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "type"
        ],
        "additionalProperties": true,
        "properties": {
         "type": {
          "type": "string",
          "enum": [
           "invoice",
           "quote",
           "receipt",
           "certificate",
           "letter"
          ]
         },
         "response": {
          "type": "string",
          "enum": [
           "json"
          ]
         },
         "from": {
          "type": "object"
         },
         "to": {
          "type": "object"
         },
         "currency": {
          "type": "string"
         },
         "tax": {
          "type": "object"
         },
         "discount": {
          "type": "object"
         },
         "items": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "description": {
             "type": "string"
            },
            "quantity": {
             "type": "number"
            },
            "unit_price": {
             "type": "number"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "PDF, or JSON with url and totals",
      "content": {
       "application/pdf": {},
       "application/json": {}
      }
     }
    }
   }
  },
  "/v1/videos/{id}": {
   "get": {
    "operationId": "getVideo",
    "summary": "Video job status and URL",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Job"
     }
    }
   }
  }
 }
}