# views.publish

> Draw a person’s Home tab of this app (the app has Home turned on).

Source: https://slaiky.xyz/docs/reference/methods/views.publish

`POST https://app.slaiky.xyz/api/methods/views.publish` · needs the bot token

## Arguments

| Argument | Type | Required | What |
| --- | --- | --- | --- |
| `userId` | id | yes | Member id. |
| `view` | [view](/docs/reference/blocks#views) | yes |  |
| `hash` | string | no | Up to 64 characters. |

## Answer

`{ "ok": true, … }` with: view: View. A refusal is `{ "ok": false, "error": { "code", "message" } }` ([errors](/docs/errors)).

## Example

Recorded on a real server (ids replaced).

*you run*

```sh

curl -s https://app.slaiky.xyz/api/methods/views.publish \
  -H "authorization: Bearer $SLAIKY_BOT_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"userId":"7f3c0008-5a1e-4c2b-9d6f-1a2b3c4d5e07","view":{"type":"home","blocks":[{"type":"header","text":"Hi there"},{"type":"section","text":"Your week, at a glance."}]}}'

```

*Slaiky → your app · `answer`*

```json

{
  "ok": true,
  "view": {
    "id": "7f3c0023-5a1e-4c2b-9d6f-1a2b3c4d5e16",
    "appId": "7f3c0002-5a1e-4c2b-9d6f-1a2b3c4d5e01",
    "botUserId": "7f3c0004-5a1e-4c2b-9d6f-1a2b3c4d5e03",
    "type": "home",
    "title": null,
    "submit": null,
    "close": null,
    "blocks": [
      {
        "text": "Hi there",
        "type": "header"
      },
      {
        "text": "Your week, at a glance.",
        "type": "section"
      }
    ],
    "callbackId": null,
    "previousId": null,
    "hash": "1731240000.docs"
  }
}

```
