# saveWebsiteArticle

Write a new article on a website (`input.folder` is the websiteId; no slug: made from the title), or edit one by slug. Body is Markdown, raw HTML refused; a cover is an uploaded image id. `outcome` REFUSED lists `violations`. Org admins only. Nothing goes live: it opens a website change in the sites repo, which getWebsiteChange follows and publishWebsiteChange puts live on the person's yes.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "saveWebsiteArticle", "variables": {...} }`
- Scope: `ADMIN`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `SaveWebsiteArticleInput!` (required)
  - `folder`: `String!` (required)
  - `slug`: `String`. The article being edited. Omitted for a new article, whose slug is made from its title.
  - `title`: `String!` (required). At most 200 characters.
  - `description`: `String`. For `description`, `date` and `author`: omitted keeps what the article has, null or empty removes it.
  - `date`: `String`
  - `author`: `String`
  - `body`: `String!` (required). The body, Markdown. Raw HTML is refused.
  - `coverUploadedFileId`: `ID`. A new cover photo: an id handed back by `fileUpload.standardFileUpload`, from the caller's own organization. PNG, JPEG or WebP; re-encoded as WebP. Omitted keeps the current cover.
  - `removeCover`: `Boolean`. Drop the current cover. Refused together with `coverUploadedFileId`.

## Response (data, an example)

```json
{
  "websiteArticlesMutation": {
    "save": {
      "outcome": "REFUSED",
      "violations": [
        "…"
      ],
      "slug": "…",
      "pullNumber": 0,
      "headSha": "…"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "saveWebsiteArticle",
    "variables": {
      "input": {
        "folder": "<String>",
        "title": "<String>",
        "body": "<String>"
      }
    }
  }'
```
