# Put or replace one item of the caller's own in an account's feed

`PUT /api/feed/{account}/items/{product}/{key}` · Praecise account · Feed

- Callers: The server of a product in the account service's client list.

## Parameters

- `account` (path, required), string: The Praecise account id: `sub` in ID tokens.
- `product` (path, required), string: The publishing product's client id.
- `key` (path, required), string: The publisher's own name for the thing.

## Request body

`application/json`

```json
{
  "type": "object",
  "required": [
    "kind",
    "text",
    "url"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "message",
        "call",
        "event",
        "reminder",
        "invitation",
        "share",
        "approval",
        "signature",
        "payment",
        "deploy",
        "limit",
        "security",
        "notice"
      ]
    },
    "text": {
      "type": "object",
      "required": [
        "en"
      ],
      "additionalProperties": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 140
          },
          "detail": {
            "type": "string",
            "maxLength": 280
          }
        }
      },
      "description": "By language tag. `en` is the source and compulsory."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The https address that opens the thing, on one of the publishing product's own hosts."
    },
    "needs_action": {
      "type": "boolean"
    },
    "at": {
      "type": "string",
      "format": "date-time"
    },
    "ends_at": {
      "type": "string",
      "format": "date-time"
    },
    "reopen": {
      "type": "boolean",
      "description": "Bring back an item the person finished."
    }
  }
}
```

## Responses

- `200`: Replaced.
- `201`: New.
- `400`: A field is wrong; the error says which.
- `401`: No valid client id and secret.
- `403`: Another product's item, or a feed the caller may not read.
- `404`: No such account, or no such item.
- `429`: Over the limit for a minute. `Retry-After` says when to try again.
- `503`: The feed is not switched on. Nothing to do; do not retry in a loop.

## Example

```sh
curl -X PUT 'https://accounts.praecise.com/api/feed/{account}/items/{product}/{key}' \
  -H 'Authorization: Basic $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "message",
  "text": {},
  "url": "https://example.com"
}'
```
