{
  "openapi": "3.0.3",
  "info": {
    "title": "Umtal API",
    "version": "1",
    "description": "Umtal measures how a business is described in the answers from ChatGPT, Gemini, Claude and Google's AI Overview. With an API key, another system (for example a tool that writes content for the website) can fetch what Umtal knows about the business and use it in its own work. It can also report which pages it published on the business's website, and Umtal measures them. That is the only thing the API can write.\n\n**The key.** The owner (or the person who pays) makes the key in Umtal under **Meg → Umtal-API** (Me → Umtal API). It is shown once, and it belongs to one business. The API is part of Forsprang and the plans above it.\n\nFields in version 1 are fixed: new fields may come, none is removed or renamed without a v2.",
    "contact": {
      "name": "Umtal",
      "email": "contact@umtal.no",
      "url": "https://umtal.no/docs/api"
    }
  },
  "servers": [
    {
      "url": "https://umtal.no/api",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Insight",
      "description": "Read what Umtal knows about the business."
    },
    {
      "name": "Publications",
      "description": "Report pages you published, so Umtal measures them."
    }
  ],
  "paths": {
    "/v1/innsikt": {
      "get": {
        "tags": [
          "Insight"
        ],
        "operationId": "getInsight",
        "summary": "Get the insight package",
        "description": "Everything Umtal knows about the business the key belongs to, from the regular measurements. The numbers change when Umtal has measured again, so fetching once a day is enough. At most 60 calls an hour per key.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-11-24T06:00:00Z",
            "description": "The time of your previous fetch. The package then says in `changes` what is new after it."
          }
        ],
        "responses": {
          "200": {
            "description": "The insight package.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsightPackage"
                }
              }
            }
          },
          "400": {
            "description": "`since` is not an ISO 8601 date and time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_since"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown key or a revoked key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_key"
                }
              }
            }
          },
          "403": {
            "description": "The business is on Gratis (free). The API is part of the paid plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "plan_required"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 calls in the last hour for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "number"
                },
                "description": "Seconds to wait."
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "unavailable"
                }
              }
            }
          }
        }
      }
    },
    "/v1/publiseringer": {
      "post": {
        "tags": [
          "Publications"
        ],
        "operationId": "reportPublication",
        "summary": "Report a page you published",
        "description": "Tell Umtal about a page you put on the business's website. Umtal then shows its questions before and after in `publications`. The same address again replaces the earlier report: `201` the first time, `200` after. At most 60 calls an hour per key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicationInput"
              },
              "example": {
                "url": "https://example.no/the-page-you-published",
                "questionIds": [
                  123,
                  456
                ],
                "adviceId": 789,
                "title": "The page's title",
                "publishedAt": "2026-11-24T08:00:00Z"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved, first time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationSaved"
                }
              }
            }
          },
          "200": {
            "description": "Saved, replacing an earlier report of the same address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationSaved"
                }
              }
            }
          },
          "400": {
            "description": "`url` is missing, or `publishedAt` is not a date or lies in the future.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_body"
                }
              }
            }
          },
          "422": {
            "description": "The address is not on the business's website (`not_own_site`), or an id is not this business's (`unknown_questions`, `unknown_advice`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "not_own_site"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown key or a revoked key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_key"
                }
              }
            }
          },
          "403": {
            "description": "The business is on Gratis (free). The API is part of the paid plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "plan_required"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 calls in the last hour for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "number"
                },
                "description": "Seconds to wait."
              }
            }
          },
          "500": {
            "description": "Something failed on our side. Try again in a minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "unavailable"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Publications"
        ],
        "operationId": "removePublication",
        "summary": "Remove a reported page",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The address you reported."
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "404": {
            "description": "No page with that address was reported."
          },
          "400": {
            "description": "`url` is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_body"
                }
              }
            }
          },
          "401": {
            "description": "No key, an unknown key or a revoked key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "invalid_key"
                }
              }
            }
          },
          "403": {
            "description": "The business is on Gratis (free). The API is part of the paid plans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "plan_required"
                }
              }
            }
          },
          "429": {
            "description": "More than 60 calls in the last hour for this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "…",
                  "code": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "number"
                },
                "description": "Seconds to wait."
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your key, `umtal_…`, sent as `Authorization: Bearer umtal_…`."
      }
    },
    "schemas": {
      "Interval": {
        "type": "object",
        "properties": {
          "low": {
            "type": "number"
          },
          "high": {
            "type": "number"
          }
        },
        "required": [
          "low",
          "high"
        ],
        "description": "95 % uncertainty interval, in percent."
      },
      "Share": {
        "type": "object",
        "properties": {
          "mentioned": {
            "type": "number",
            "description": "Answers that name the business."
          },
          "answers": {
            "type": "number",
            "description": "Answers read."
          },
          "sharePct": {
            "type": "number",
            "description": "mentioned / answers in percent. Null without answers.",
            "nullable": true
          },
          "interval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Interval"
              }
            ],
            "nullable": true
          },
          "recommended": {
            "type": "number",
            "description": "Answers that recommend the business. Null where the answers could not be judged for it.",
            "nullable": true
          },
          "recommendedPct": {
            "type": "number",
            "nullable": true
          },
          "recommendedInterval": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Interval"
              }
            ],
            "nullable": true
          },
          "measure": {
            "type": "string",
            "enum": [
              "recommended",
              "mentioned"
            ],
            "description": "Which figure the Umtal app shows."
          }
        },
        "required": [
          "mentioned",
          "answers",
          "sharePct",
          "interval",
          "recommended",
          "recommendedPct",
          "recommendedInterval",
          "measure"
        ],
        "description": "A share of answers. Always read it together with `answers` and `interval`: «2 of 4 answers» is not the same as «50 %»."
      },
      "MarketRef": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "locale": {
            "type": "string",
            "example": "nb-NO"
          }
        },
        "required": [
          "id",
          "locale"
        ]
      },
      "Question": {
        "type": "object",
        "properties": {
          "promptId": {
            "type": "number",
            "description": "The question's id. Use it as `questionIds` when you report a page."
          },
          "question": {
            "type": "string"
          },
          "market": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketRef"
              }
            ],
            "nullable": true
          },
          "branded": {
            "type": "boolean",
            "description": "True when the question names the business itself, e.g. «What is Namuda?»."
          },
          "now": {
            "$ref": "#/components/schemas/Share"
          },
          "before": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Share"
              }
            ],
            "nullable": true,
            "description": "The same figures in the measurement before. Null when the question was not asked then."
          },
          "byEngine": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "engine": {
                  "type": "string"
                },
                "mentioned": {
                  "type": "number"
                },
                "answers": {
                  "type": "number"
                },
                "recommended": {
                  "type": "number",
                  "nullable": true
                }
              }
            }
          },
          "namedInstead": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "answers": {
                  "type": "number"
                }
              },
              "description": "Who the answers name instead."
            }
          },
          "recommendedInstead": {
            "description": "Who the answers recommend instead."
          },
          "citedPages": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A page the answers build on."
            }
          },
          "whyOthersWin": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "business": {
                  "type": "string"
                },
                "claim": {
                  "type": "string",
                  "description": "The reason, in short."
                },
                "criterion": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "description": "The site the answer leaned on.",
                  "nullable": true
                },
                "engine": {
                  "type": "string"
                },
                "excerpt": {
                  "type": "string",
                  "description": "The sentence in the answer that names the other business. Never the whole answer.",
                  "nullable": true
                }
              },
              "description": "Why the answers chose others where the business was not recommended. Up to three per question."
            }
          }
        },
        "required": [
          "promptId",
          "question",
          "branded",
          "now",
          "before",
          "byEngine",
          "namedInstead",
          "citedPages",
          "whyOthersWin"
        ]
      },
      "Measurement": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Share"
          },
          {
            "type": "object",
            "properties": {
              "runId": {
                "type": "number"
              },
              "measuredAt": {
                "type": "string",
                "format": "date-time"
              },
              "questions": {
                "type": "number",
                "description": "Questions read in this measurement."
              },
              "samplesPerQuestion": {
                "type": "number",
                "description": "How many times each question was asked each AI."
              }
            }
          }
        ]
      },
      "Advice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "market": {
            "allOf": [
              {
                "$ref": "#/components/schemas/MarketRef"
              }
            ],
            "nullable": true
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "why": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "accepted",
              "done"
            ]
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "questionIds": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "sentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "brainMoveId": {
            "type": "number",
            "nullable": true
          },
          "draft": {
            "type": "object",
            "properties": {
              "platform": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "nullable": true
              },
              "published": {
                "type": "boolean"
              },
              "publishedAt": {
                "type": "string",
                "nullable": true
              },
              "publishedUrl": {
                "type": "string",
                "nullable": true
              },
              "gone": {
                "type": "boolean"
              }
            },
            "description": "The draft Umtal put on the business's website.",
            "nullable": true
          },
          "effect": {
            "type": "object",
            "properties": {
              "verdict": {
                "type": "string",
                "enum": [
                  "worked",
                  "no_difference",
                  "too_early"
                ]
              },
              "reason": {
                "type": "string",
                "nullable": true
              },
              "measure": {
                "type": "string"
              },
              "measuredAt": {
                "type": "string",
                "nullable": true
              },
              "difference": {
                "type": "number",
                "nullable": true
              },
              "treated": {
                "description": "Before and after for the questions the advice is about."
              },
              "control": {
                "description": "Before and after for the control questions."
              }
            },
            "description": "What was measured after the advice was done.",
            "nullable": true
          }
        },
        "required": [
          "id",
          "type",
          "title",
          "status",
          "questionIds"
        ],
        "description": "A piece of advice («grep») Umtal has given."
      },
      "Stand": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "number"
          },
          "measuredAt": {
            "type": "string",
            "format": "date-time"
          },
          "answers": {
            "type": "number"
          },
          "mentioned": {
            "type": "number"
          },
          "recommended": {
            "type": "number",
            "nullable": true
          }
        }
      },
      "Publication": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "questionIds": {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "adviceId": {
            "type": "number",
            "nullable": true
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "reportedAt": {
            "type": "string",
            "format": "date-time"
          },
          "before": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Stand"
              }
            ],
            "nullable": true,
            "description": "The questions' figures in the last measurement before the page went out."
          },
          "after": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Stand"
              }
            ],
            "nullable": true,
            "description": "The same in the newest measurement after it."
          },
          "citedInAnswers": {
            "type": "number",
            "description": "How many answers have cited the page since."
          },
          "status": {
            "type": "string",
            "enum": [
              "too_early",
              "measured"
            ],
            "description": "`too_early` until there is a measurement after the page. Before and after, not proof of cause."
          }
        },
        "required": [
          "url",
          "questionIds",
          "publishedAt",
          "reportedAt",
          "status"
        ]
      },
      "InsightPackage": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "1"
            ]
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "business": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              },
              "plan": {
                "type": "string"
              },
              "industry": {
                "type": "string",
                "description": "What the business does, in its own words.",
                "nullable": true
              },
              "segment": {
                "type": "string",
                "description": "Umtal's code for the business's segment.",
                "nullable": true
              },
              "sells": {
                "type": "string",
                "enum": [
                  "yes",
                  "no"
                ],
                "nullable": true
              },
              "buyers": {
                "type": "string",
                "enum": [
                  "private",
                  "business",
                  "both",
                  "none"
                ],
                "nullable": true
              },
              "typicalOffer": {
                "type": "object",
                "properties": {
                  "unit": {
                    "type": "string"
                  },
                  "price": {
                    "type": "number"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "basis": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "description": "One typical thing the business sells, with a typical price.",
                "nullable": true
              }
            }
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number"
                },
                "locale": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "primary": {
                  "type": "boolean"
                }
              }
            }
          },
          "latestMeasurement": {
            "type": "object",
            "properties": {
              "runId": {
                "type": "number"
              },
              "measuredAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "description": "Null before the first measurement.",
            "nullable": true
          },
          "measure": {
            "type": "string",
            "enum": [
              "recommended",
              "mentioned"
            ]
          },
          "visibility": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Share"
              },
              {
                "type": "object",
                "properties": {
                  "byEngine": {
                    "type": "array",
                    "items": {
                      "allOf": [
                        {
                          "type": "object",
                          "properties": {
                            "engine": {
                              "type": "string"
                            }
                          }
                        },
                        {
                          "$ref": "#/components/schemas/Share"
                        }
                      ]
                    }
                  },
                  "excludingBranded": {
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "questions": {
                            "type": "number"
                          }
                        }
                      },
                      {
                        "$ref": "#/components/schemas/Share"
                      }
                    ],
                    "nullable": true,
                    "description": "The same without the questions that name the business itself. Use this to see how the business stands in its market."
                  }
                }
              }
            ],
            "description": "The latest measurement.",
            "nullable": true
          },
          "trend": {
            "type": "object",
            "properties": {
              "measurements": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Measurement"
                }
              },
              "changeOutsideNoise": {
                "type": "boolean",
                "description": "Whether the change from the previous measurement is larger than chance.",
                "nullable": true
              },
              "recommendedChangeOutsideNoise": {
                "type": "boolean",
                "nullable": true
              },
              "note": {
                "type": "string",
                "description": "«for tidlig å si» (too early to say) with fewer than three measurements.",
                "nullable": true
              },
              "sizeChanged": {
                "type": "boolean",
                "description": "True when the latest measurement has another size than the one before. Then compare shares, never counts.",
                "nullable": true
              }
            }
          },
          "gaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            },
            "description": "Questions where no answer in the latest measurement names the business. Start here."
          },
          "strengths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Question"
            },
            "description": "Questions where the business is named."
          },
          "competitors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "isTrackedCompetitor": {
                  "type": "boolean"
                },
                "questions": {
                  "type": "number"
                },
                "engines": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "recommended": {
                  "type": "number",
                  "nullable": true
                }
              }
            }
          },
          "criteria": {
            "type": "object",
            "properties": {
              "missing": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "criterion": {
                      "type": "string"
                    },
                    "questions": {
                      "type": "number"
                    },
                    "engines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "examples": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "description": "What the answers praise others for and never the business. Worth writing about."
                }
              },
              "own": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "criterion": {
                      "type": "string"
                    },
                    "claims": {
                      "type": "number"
                    },
                    "examples": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "description": "What the answers praise the business for."
                }
              },
              "movements": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "nullable": true
                  },
                  "criteria": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                },
                "description": "Criteria and sources growing or falling over the latest measurements (`real: true` when outside the noise)."
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain": {
                  "type": "string"
                },
                "citations": {
                  "type": "number"
                }
              },
              "description": "The domains the answers cite most in the latest measurement."
            }
          },
          "advice": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Advice"
            }
          },
          "facts": {
            "type": "object",
            "properties": {
              "site": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              },
              "ownerAnswers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "adviceId": {
                      "type": "number"
                    },
                    "question": {
                      "type": "string"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "answeredAt": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              },
              "openQuestions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "adviceId": {
                      "type": "number"
                    },
                    "question": {
                      "type": "string"
                    }
                  }
                }
              },
              "voice": {
                "type": "object",
                "properties": {
                  "address": {},
                  "speaksAs": {},
                  "formality": {},
                  "sentences": {},
                  "words": {},
                  "samples": {},
                  "adjectives": {}
                },
                "description": "How the business writes: form of address, «vi» or «jeg», formality, sentence length, its own words, example sentences and tone.",
                "nullable": true
              },
              "wishes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "What the business has told Umtal. Use it instead of guessing."
          },
          "brainMove": {
            "type": "object",
            "properties": {
              "id": {
                "type": "number"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "status": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "whyNow": {
                "type": "string"
              },
              "insight": {
                "type": "string"
              },
              "questionIds": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "targets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "questionId": {
                      "type": "number"
                    },
                    "question": {
                      "type": "string"
                    },
                    "mentioned": {
                      "type": "number"
                    },
                    "recommended": {
                      "type": "number",
                      "nullable": true
                    },
                    "answers": {
                      "type": "number"
                    }
                  }
                }
              },
              "competitor": {
                "type": "string",
                "nullable": true
              },
              "criteriaToOwn": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "format": {
                "type": "string",
                "enum": [
                  "artikkel",
                  "faq-side",
                  "sammenligning",
                  "profiltekst",
                  "kilde"
                ],
                "description": "article, FAQ page, comparison, profile text, source"
              },
              "angle": {
                "type": "string"
              },
              "outline": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sourcesToEarn": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "tasteTest": {
                "type": "object",
                "properties": {
                  "recommended": {
                    "type": "number"
                  },
                  "tests": {
                    "type": "number"
                  }
                },
                "description": "In how many of Umtal's own tests the assistant recommended the business with the text.",
                "nullable": true
              },
              "adviceIds": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "basedOnMeasurement": {
                "type": "object",
                "properties": {
                  "runId": {
                    "type": "number"
                  },
                  "measuredAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "nullable": true
              },
              "newerMeasurementSince": {
                "type": "boolean"
              }
            },
            "description": "This week's plan from Umtal. Null before the first plan.",
            "nullable": true
          },
          "publications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Publication"
            }
          },
          "nextMeasurementAt": {
            "type": "string",
            "format": "date-time",
            "description": "When Umtal measures next. Fetch again after it.",
            "nullable": true
          },
          "changes": {
            "type": "object",
            "properties": {
              "since": {
                "type": "string",
                "format": "date-time"
              },
              "newMeasurement": {
                "type": "boolean"
              },
              "adviceDone": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "adviceSent": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "newBrainMove": {
                "type": "boolean"
              }
            },
            "description": "Only with `?since=`: what is new after that time.",
            "nullable": true
          },
          "risingQuestions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "question": {
                  "type": "string"
                },
                "why": {
                  "type": "string",
                  "nullable": true
                },
                "searchVolume": {
                  "type": "number",
                  "nullable": true
                },
                "addedAt": {
                  "type": "string",
                  "nullable": true
                }
              },
              "description": "Questions Umtal added because more people have started asking them."
            }
          }
        },
        "required": [
          "version",
          "generatedAt",
          "business",
          "markets",
          "latestMeasurement",
          "measure",
          "visibility",
          "trend",
          "gaps",
          "strengths",
          "competitors",
          "criteria",
          "sources",
          "advice",
          "facts",
          "brainMove",
          "publications",
          "nextMeasurementAt",
          "changes",
          "risingQuestions"
        ]
      },
      "PublicationInput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "example": "https://example.no/the-page-you-published",
            "description": "Required. A page on the business's own website. Tracking tails (`utm_…`) and `www.` are removed."
          },
          "questionIds": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "maxItems": 50,
            "description": "The questions the page is written for (`promptId` from `gaps`/`strengths`). Without them, and with `adviceId`, the advice's questions are used."
          },
          "adviceId": {
            "type": "number",
            "description": "The advice the page carries out (`id` in `advice`). The advice is then marked as done in Umtal.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "maxLength": 500,
            "nullable": true
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the page went out. Without it, the time of the call is used. Never in the future.",
            "nullable": true
          }
        },
        "required": [
          "url"
        ]
      },
      "PublicationSaved": {
        "type": "object",
        "properties": {
          "publication": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "title": {
                "type": "string",
                "nullable": true
              },
              "questionIds": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "adviceId": {
                "type": "number",
                "nullable": true
              },
              "publishedAt": {
                "type": "string",
                "format": "date-time"
              },
              "reportedAt": {
                "type": "string",
                "format": "date-time"
              },
              "keyId": {
                "type": "number"
              }
            }
          },
          "adviceMarkedDone": {
            "type": "boolean"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A sentence for a person."
          },
          "code": {
            "type": "string",
            "description": "A stable code for a program."
          }
        },
        "required": [
          "error",
          "code"
        ]
      }
    }
  }
}