{
    "openapi": "3.1.0",
    "info": {
        "title": "AutoMarketer API",
        "version": "1.0.0",
        "description": "Read, edit, approve, reject, delete and export the marketing assets AutoMarketer writes for your websites, add and re-analyze websites, steer their autopilot, switch channels and start cycles. Included in every paid plan. Guide: https://automarketer.com/docs/api",
        "contact": {
            "email": "support@automarketer.com"
        }
    },
    "servers": [
        {
            "url": "https://automarketer.com/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Account",
            "description": "The team, plan and usage behind a key."
        },
        {
            "name": "Websites",
            "description": "Websites, their analysis and their autopilot."
        },
        {
            "name": "Channels",
            "description": "The six channels of a website."
        },
        {
            "name": "Assets",
            "description": "The marketing assets AutoMarketer writes: read, edit, approve, reject, delete and export."
        },
        {
            "name": "Runs",
            "description": "Autopilot cycles."
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "tags": [
                    "Account"
                ],
                "operationId": "getMe",
                "summary": "Your team, plan, limits and usage this month",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Me"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites": {
            "get": {
                "tags": [
                    "Websites"
                ],
                "operationId": "listWebsites",
                "summary": "List your websites",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Website"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PageLinks"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            },
            "post": {
                "tags": [
                    "Websites"
                ],
                "operationId": "createWebsite",
                "summary": "Add a website and start its analysis",
                "description": "Same as adding a site in the cockpit: counts against the sites in your plan and starts the same analysis. Poll GET /websites/{website} or listen for website.analyzed.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "url"
                                ],
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "example": "https://yourwebsite.com"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Accepted: the analysis is running",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebsiteDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "409": {
                        "$ref": "#/components/responses/E409"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}": {
            "get": {
                "tags": [
                    "Websites"
                ],
                "operationId": "getWebsite",
                "summary": "One website with brand profile, keywords, plan and channels",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebsiteDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Websites"
                ],
                "operationId": "updateWebsite",
                "summary": "Switch the autopilot on or off, change its mode or cadence",
                "description": "Same as the autopilot switch, Mode and Cadence in the cockpit, with the same plan rules: autopilot mode from Growth, cadence by plan, and switching on only while this month's assets last. Switching off is always allowed.",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "autopilot": {
                                        "type": "boolean"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "copilot",
                                            "autopilot"
                                        ]
                                    },
                                    "frequency": {
                                        "type": "string",
                                        "enum": [
                                            "weekly",
                                            "daily",
                                            "continuous"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebsiteDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}/analyze": {
            "post": {
                "tags": [
                    "Websites"
                ],
                "operationId": "analyzeWebsite",
                "summary": "Analyze a website again",
                "description": "Same as Re-analyze in the cockpit: rebuilds the brand profile, keywords and plan. Shares the limit of 30 analyses an hour per team with the cockpit.",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted: the analysis is running",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebsiteDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "409": {
                        "$ref": "#/components/responses/E409"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}/channels": {
            "get": {
                "tags": [
                    "Channels"
                ],
                "operationId": "listChannels",
                "summary": "The six channels of a website",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Channel"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}/channels/{type}": {
            "patch": {
                "tags": [
                    "Channels"
                ],
                "operationId": "updateChannel",
                "summary": "Switch a channel on or off, or change its mode",
                "description": "Switching on and autopilot mode follow your plan. Switching off is always allowed.",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "seo",
                                "google_ads",
                                "bing_ads",
                                "meta_ads",
                                "social",
                                "email"
                            ]
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "copilot",
                                            "autopilot"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Channel"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "409": {
                        "$ref": "#/components/responses/E409"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}/runs": {
            "get": {
                "tags": [
                    "Runs"
                ],
                "operationId": "listRuns",
                "summary": "Cycles of a website, newest first",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Run"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PageLinks"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            },
            "post": {
                "tags": [
                    "Runs"
                ],
                "operationId": "createRun",
                "summary": "Run one cycle now",
                "description": "Same as \"Run a cycle now\" in the cockpit: one cycle, within your monthly asset allowance. The autopilot switch is not changed.",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted: the cycle is queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Run"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "409": {
                        "$ref": "#/components/responses/E409"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/websites/{website}/export/social": {
            "get": {
                "tags": [
                    "Assets"
                ],
                "operationId": "exportSocialCalendar",
                "summary": "Per-network social calendar CSV",
                "parameters": [
                    {
                        "name": "website",
                        "in": "path",
                        "required": true,
                        "description": "The website id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "network",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "instagram",
                                "facebook",
                                "linkedin",
                                "x",
                                "pinterest"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The CSV file, sent as an attachment.",
                        "content": {
                            "text/csv": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/assets": {
            "get": {
                "tags": [
                    "Assets"
                ],
                "operationId": "listAssets",
                "summary": "List assets, newest first",
                "parameters": [
                    {
                        "name": "website_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "channel",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "seo",
                                "google_ads",
                                "bing_ads",
                                "meta_ads",
                                "social",
                                "email"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "pending_approval",
                                "approved",
                                "scheduled",
                                "published",
                                "rejected",
                                "failed"
                            ]
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "article"
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "description": "Created at or after this time (ISO 8601).",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "description": "Changed at or after this time (ISO 8601).",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Asset"
                                            }
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PageMeta"
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PageLinks"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/assets/{asset}": {
            "get": {
                "tags": [
                    "Assets"
                ],
                "operationId": "getAsset",
                "summary": "One asset with its full content and its editable fields",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AssetDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Assets"
                ],
                "operationId": "updateAsset",
                "summary": "Edit an asset",
                "description": "Same as Edit in the Asset Queue. fields takes the keys of editable_fields from GET /assets/{asset}: a string for kind text and textarea, a list of strings for kind lines. The export files change with the edit.",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "fields": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "oneOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AssetDetail"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Assets"
                ],
                "operationId": "deleteAsset",
                "summary": "Delete an asset",
                "description": "Same as Delete in the Asset Queue: the content is erased and the asset leaves the queue and every export. It still counts toward this month's assets, because it was generated.",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "object": {
                                            "const": "asset"
                                        },
                                        "deleted": {
                                            "const": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/assets/{asset}/approve": {
            "post": {
                "tags": [
                    "Assets"
                ],
                "operationId": "approveAsset",
                "summary": "Approve an asset",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Asset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/assets/{asset}/reject": {
            "post": {
                "tags": [
                    "Assets"
                ],
                "operationId": "rejectAsset",
                "summary": "Reject an asset, with an optional reason",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 1000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Asset"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/assets/{asset}/export": {
            "get": {
                "tags": [
                    "Assets"
                ],
                "operationId": "exportAsset",
                "summary": "Download the export file of an asset",
                "description": "Formats: google_rsa and bing_rsa: csv (Google Ads Editor, Microsoft Advertising bulk). article: html, markdown. email: html. social_post: csv.",
                "parameters": [
                    {
                        "name": "asset",
                        "in": "path",
                        "required": true,
                        "description": "The asset id.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "csv",
                                "html",
                                "markdown"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The export file (CSV, HTML or Markdown), sent as an attachment.",
                        "content": {
                            "text/csv": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "text/html": {
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "text/markdown": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "422": {
                        "$ref": "#/components/responses/E422"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        },
        "/runs/{run}": {
            "get": {
                "tags": [
                    "Runs"
                ],
                "operationId": "getRun",
                "summary": "One cycle, with the ids of the assets it created",
                "parameters": [
                    {
                        "name": "run",
                        "in": "path",
                        "required": true,
                        "description": "The run id.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Run"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "402": {
                        "$ref": "#/components/responses/E402"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    }
                }
            }
        }
    },
    "webhooks": {
        "asset.created": {
            "post": {
                "operationId": "eventAssetCreated",
                "summary": "asset.created",
                "description": "A new asset was generated and saved (pending your approval, or approved on autopilot). Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "asset.approved": {
            "post": {
                "operationId": "eventAssetApproved",
                "summary": "asset.approved",
                "description": "An asset was approved, in the cockpit or through the API. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "asset.rejected": {
            "post": {
                "operationId": "eventAssetRejected",
                "summary": "asset.rejected",
                "description": "An asset was rejected, in the cockpit or through the API. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "asset.updated": {
            "post": {
                "operationId": "eventAssetUpdated",
                "summary": "asset.updated",
                "description": "The content of an asset was edited, in the cockpit or through the API. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "asset.deleted": {
            "post": {
                "operationId": "eventAssetDeleted",
                "summary": "asset.deleted",
                "description": "An asset was deleted, on its own or together with its website, in the cockpit or through the API. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "website.analyzed": {
            "post": {
                "operationId": "eventWebsiteAnalyzed",
                "summary": "website.analyzed",
                "description": "A website analysis finished: status is ready or failed. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "run.completed": {
            "post": {
                "operationId": "eventRunCompleted",
                "summary": "run.completed",
                "description": "An autopilot cycle finished, with its status and the number of assets it created. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        },
        "webhook.test": {
            "post": {
                "operationId": "eventWebhookTest",
                "summary": "webhook.test",
                "description": "Sent by \"Send test event\" in the cockpit. Signed with X-AutoMarketer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your endpoint secret>.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookEvent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Any 2xx status marks the delivery as delivered."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "A team API key (am_live_...) from API & webhooks in the cockpit."
            }
        },
        "responses": {
            "E401": {
                "description": "Missing, invalid or revoked API key.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E402": {
                "description": "The team has no paid plan.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E403": {
                "description": "The key lacks the scope, or the plan does not include this.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E404": {
                "description": "Not found on your team.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E409": {
                "description": "Not possible in the current state (website not ready, a cycle already running, the website already on your team).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E422": {
                "description": "The request is not valid.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "E429": {
                "description": "Rate limit (60 requests per minute per key) or analysis limit reached. See Retry-After.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer"
                            },
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            },
                            "docs": {
                                "type": "string"
                            },
                            "errors": {
                                "type": "object"
                            },
                            "upgrade_url": {
                                "type": "string",
                                "description": "With 403 plan limits."
                            },
                            "pricing_url": {
                                "type": "string",
                                "description": "With 402 plan_required."
                            },
                            "required_scope": {
                                "type": "string",
                                "description": "With 403 insufficient_scope."
                            },
                            "run_id": {
                                "type": "integer",
                                "description": "With 409 run_in_progress."
                            },
                            "website_id": {
                                "type": "integer",
                                "description": "With 409 website_exists."
                            },
                            "formats": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "description": "With 422 on an export format the type does not have."
                            },
                            "editable_fields": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "description": "With 422 on PATCH /assets/{asset}."
                            }
                        }
                    }
                }
            },
            "PageMeta": {
                "type": "object",
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    }
                }
            },
            "PageLinks": {
                "type": "object",
                "properties": {
                    "next": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "Me": {
                "type": "object",
                "properties": {
                    "team": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        }
                    },
                    "plan": {
                        "type": "object",
                        "properties": {
                            "key": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mode": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "frequency": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "channels": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "limits": {
                                "type": "object",
                                "properties": {
                                    "assets_per_month": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "null on Agency: no monthly cap."
                                    },
                                    "sites": {
                                        "type": "integer"
                                    },
                                    "seats": {
                                        "type": "integer"
                                    }
                                }
                            }
                        }
                    },
                    "usage": {
                        "type": "object",
                        "properties": {
                            "assets_this_month": {
                                "type": "integer"
                            },
                            "assets_remaining": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "null on Agency: no monthly cap."
                            },
                            "sites": {
                                "type": "integer"
                            },
                            "month_resets_at": {
                                "type": "string",
                                "format": "date-time"
                            }
                        }
                    },
                    "api_key": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "scopes": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "enum": [
                                        "read",
                                        "write"
                                    ]
                                }
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        }
                    },
                    "rate_limit": {
                        "type": "object",
                        "properties": {
                            "requests_per_minute": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "Website": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "object": {
                        "const": "website"
                    },
                    "url": {
                        "type": "string"
                    },
                    "host": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "analyzing",
                            "ready",
                            "failed"
                        ]
                    },
                    "failure_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "autopilot": {
                        "type": "object",
                        "properties": {
                            "on": {
                                "type": "boolean"
                            },
                            "mode": {
                                "type": "string"
                            },
                            "frequency": {
                                "type": "string"
                            },
                            "last_run_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "next_run_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            }
                        }
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "WebsiteDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Website"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "brand_profile": {
                                "type": [
                                    "object",
                                    "null"
                                ]
                            },
                            "keywords": {
                                "$ref": "#/components/schemas/Keywords"
                            },
                            "plan": {
                                "type": [
                                    "object",
                                    "null"
                                ]
                            },
                            "channels": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Channel"
                                }
                            }
                        }
                    }
                ]
            },
            "Keywords": {
                "type": [
                    "object",
                    "null"
                ],
                "description": "The keyword plan of the analysis. null until the analysis is ready.",
                "properties": {
                    "primary": {
                        "type": "string"
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "theme": {
                                    "type": "string"
                                },
                                "keywords": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "keyword": {
                                                "type": "string"
                                            },
                                            "intent": {
                                                "type": "string",
                                                "enum": [
                                                    "informational",
                                                    "commercial",
                                                    "transactional",
                                                    "navigational"
                                                ]
                                            },
                                            "volume_hint": {
                                                "type": "string",
                                                "enum": [
                                                    "Low",
                                                    "Medium",
                                                    "High"
                                                ]
                                            },
                                            "difficulty_hint": {
                                                "type": "string",
                                                "enum": [
                                                    "Low",
                                                    "Medium",
                                                    "High"
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "negatives": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "Channel": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "seo",
                            "google_ads",
                            "bing_ads",
                            "meta_ads",
                            "social",
                            "email"
                        ]
                    },
                    "label": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "mode": {
                        "type": "string",
                        "enum": [
                            "copilot",
                            "autopilot"
                        ]
                    },
                    "in_plan": {
                        "type": "boolean"
                    },
                    "account_label": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "daily_budget": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "last_generated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "Asset": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "object": {
                        "const": "asset"
                    },
                    "website_id": {
                        "type": "integer"
                    },
                    "channel": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "seo",
                            "google_ads",
                            "bing_ads",
                            "meta_ads",
                            "social",
                            "email",
                            null
                        ]
                    },
                    "type": {
                        "type": "string",
                        "example": "article"
                    },
                    "type_label": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "pending_approval",
                            "approved",
                            "scheduled",
                            "published",
                            "rejected",
                            "failed"
                        ]
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "payload": {
                        "type": "object",
                        "description": "Type-specific fields: headlines and descriptions of an ad, meta title of an article, subject of an email, platform of a social post."
                    },
                    "scheduled_for": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "is_sample": {
                        "type": "boolean"
                    },
                    "run_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "exports": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "format": {
                                    "type": "string"
                                },
                                "url": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "rejection_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Only in the response of POST /assets/{asset}/reject."
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "AssetDetail": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/Asset"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "editable_fields": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "key": {
                                            "type": "string",
                                            "example": "payload__headlines"
                                        },
                                        "label": {
                                            "type": "string"
                                        },
                                        "kind": {
                                            "type": "string",
                                            "enum": [
                                                "text",
                                                "textarea",
                                                "lines"
                                            ]
                                        },
                                        "value": {
                                            "oneOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "Run": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "object": {
                        "const": "run"
                    },
                    "website_id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued",
                            "running",
                            "success",
                            "partial",
                            "skipped",
                            "failed"
                        ]
                    },
                    "trigger": {
                        "type": "string",
                        "enum": [
                            "schedule",
                            "manual",
                            "api"
                        ]
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "assets_created": {
                        "type": "integer"
                    },
                    "channels_touched": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "asset_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "finished_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "WebhookEvent": {
                "type": "object",
                "required": [
                    "id",
                    "type",
                    "created_at",
                    "team_id",
                    "data"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "evt_01j9z3k6x2m7v4q8r5t0w1y2z3"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "asset.created",
                            "asset.approved",
                            "asset.rejected",
                            "asset.updated",
                            "asset.deleted",
                            "website.analyzed",
                            "run.completed",
                            "webhook.test"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "team_id": {
                        "type": "integer"
                    },
                    "data": {
                        "type": "object",
                        "description": "asset.*: {asset} (asset.rejected adds reason). website.analyzed: {website}. run.completed: {run}. webhook.test: {test: true, message, endpoint_id, asset, website, run} with samples in the shape of real events."
                    }
                }
            }
        },
        "x-webhook-retries": {
            "attempts": 7,
            "backoff_seconds": [
                60,
                300,
                1800,
                7200,
                21600,
                43200
            ],
            "disable_after_consecutive_failures": 15
        }
    }
}