Publish a static view for a User.

Create or update the view that comprises an app's Home tab for a specific user.



Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.


id of the user you want publish a view to.


A view payload. This must be a JSON-encoded string.


A string that represents view state to protect against possible race conditions.


This method supports application/json via HTTP POST. Present your token in your request's Authorization header. Learn more.


Assuming your view object was properly formatted, valid, and the user_id was viable, you will receive a success response.

Common successful response

Typical success response includes the published view payload.

    "ok": true,
    "view": {
        "id": "VMHU10V25",
        "team_id": "T8N4K1JN",
        "type": "home",
        "close": null,
        "submit": null,
        "blocks": [
                "type": "section",
                "block_id": "2WGp9",
                "text": {
                    "type": "mrkdwn",
                    "text": "A simple section with some sample sentence.",
                    "verbatim": false
        "private_metadata": "Shh it is a secret",
        "callback_id": "identify_your_home_tab",
        "state": {
            "values": []
        "hash": "156772938.1827394",
        "clear_on_close": false,
        "notify_on_close": false,
        "root_view_id": "VMHU10V25",
        "previous_view_id": null,
        "app_id": "AA4928AQ",
        "external_id": "",
        "bot_id": "BA13894H"
Common error response

Typical error response, before getting to any possible validation errors.

    "ok": false,
    "error": "invalid_arguments",
    "response_metadata": {
        "messages": [
            "invalid `user_id`"


This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok params in the response.


Error returned when the provided hash doesn't match the current stored value.


Error returned when the given external_id has already be used.


Error returned if the provided view is greater than 250kb.


Error returned if a home view is published but the Home tab isn't enabled for the app.


The token type used in this request is not allowed.


The profile view experiment is not enabled for this user.


A profile id was not provided when trying to publish a view of type profile.


No authentication token provided.


Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.


Authentication token is for a deleted user or workspace when using a bot token.


Authentication token is for a deleted user or workspace or the app has been removed when using a user token.


The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.


The workspace is undergoing an enterprise migration and will not be available until migration is complete.


Administrators have suspended the ability to post a message.


The token used is not granted the specific scope permissions required to complete this request.


The method has been deprecated.


The endpoint has been deprecated.


Two factor setup is required.


The method cannot be called from an Enterprise.


The method was either called with invalid arguments or some detail about the arguments passed are invalid, which is more likely when using complex arguments like blocks or attachments.


The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.


The method was passed an array as an argument. Please only input valid strings.


The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.


The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.


The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.


The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.


The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.


The request has been ratelimited. Refer to the Retry-After header for when to retry the request.


Access to this method is limited on the current network


The method was called via a POST request, but the POST data was either missing or truncated.


The service is temporarily unavailable


The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.


The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.


This table lists the expected warnings that this method will return. However, other warnings can be returned in the case where the service is experiencing unexpected trouble.


The method was called via a POST request, and recommended practice for the specified Content-Type is to include a charset parameter. However, no charset was present. Specifically, non-form-data content types (e.g. text/plain) are the ones for which charset is recommended.


The method was called via a POST request, and the specified Content-Type is not defined to understand the charset parameter. However, charset was in fact present. Specifically, form-data content types (e.g. multipart/form-data) are the ones for which charset is superfluous.

Sample code

Bolt is a foundational framework that makes it faster and easier to build Slack apps with the platform's latest features.

Calling views.publish in Python

Show code to initialize app
# Listen to the app_home_opened Events API event to hear when a user opens your app from the sidebar @app.event("app_home_opened") def app_home_opened(event, client, logger): user_id = event["user"] try: # Call the views.publish method using the WebClient passed to listeners result = client.views_publish( user_id=user_id, view={ # Home tabs must be enabled in your app configuration page under "App Home" # and your app must be subscribed to the app_home_opened event "type": "home", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "*Welcome home, <@{}> :house:*".format(user_id), }, }, { "type": "section", "text": { "type": "mrkdwn", "text": "Learn how home tabs can be more useful and interactive <|*in the documentation*>.", }, }, {"type": "divider"}, { "type": "context", "elements": [ { "type": "mrkdwn", "text": "Psssst this home tab was designed using <|*Block Kit Builder*>", } ], }, ], }, ) except SlackApiError as e: logger.error("Error fetching conversations: {}".format(e))
Show code to run app

New to building Slack apps with Python? Read Getting Started with Bolt for Python.

Was this page helpful?