graph TD

    %% Definitions - Nodes
    H["Looker is displaying a 404 error on a web page or in the JavaScript console."]
    d1{"Is the 404 error appearing in a browser, or in a response to a Looker API call?"}
    d2{"Check the Network tab of the JavaScript console. Is the request URL a Looker URL?"}
    d3{"Check for typos in the URL. For example: '/look/123' instead of '/looks/123'"}
    d4{"Is the request URL a deploy webhook?"}
    d5{"Are the request path and verb correct?"}
    d6{"Is the endpoint available in dev and prod mode?"}
    d8{"Are you using the webhook to deploy a specific branch or ref?"}
    d9{"Is there a webhook secret enabled on the project?"}
    d10{"Do all of the values in the request URL and request body refer to resources that actually exist on the Looker instance?"}
    d12{"Is the required permission a valid embed permission?"}
    d13{"Is the user seeing the 404 a signed embed user?"}
    d14{"Does the user have the required permissions in at least one role?"}
    d15{"Are any of the required permissions model-specific?"}
    d16{"Is the LookML model in the model set for at least one of the user's roles with the required permission?"}
    d17{"Is the requested resource content that lives in a folder? (This includes Looks, dashboards, and Looker Studio reports.)"}
    d18{"Does the user have the correct access level to the folder where the content lives?"}
    d19{"Find the access_grant definition in the LookML project. Does the user have one of the required values for the specified user attribute?"}
    d20{"Is the requested resource an Explore with required_access_grants defined on it?"}
    d21{"Do you still see the error while sudoing as the affected user?"}
    h2["First, let's check to make sure the request URL itself is correct and is available in the current context."]
    h3["Look up the documentation for the API endpoint throwing the 404 error. You can also check API Explorer if it is installed on your instance."]
    h4["The error is being thrown by an external resource separate from Looker. If the request URL belongs to a custom application that connects to Looker, check your application's code and logs to further troubleshoot the error. "]
    h5["Fix the request path and verb. For example: POST /api/4.0/embed/ sso_url"]
    h6["Fix the typos in the URL. If the URL was generated by Looker (such as in a link from another page), reach out to Support to get the URL corrected in the product."]
    h7["Some endpoints can only be used in dev mode, such as create_project, deploy_to_production, and reset_project_to_production. Use the update_session endpoint with request body {workspace_id: dev} to switch the API session to dev mode."]
    h8["Make sure Advanced Deploy Mode is enabled on the project."]
    h9["You've verified that the request URL itself is correct and is available in the current context. Next, let's make sure all resources referenced in the request are available in the current context."]
    h10["Make sure required conditions for the endpoint's availability are set. Examples: reset_project_to_production is unavailable on shared branches. deploy_ref_to_production is available only when Advanced Deploy Mode is enabled."]
    h11["Since embed users cannot be assigned the required permission, the user will not be able to make this request successfully."]
    h12["Make sure you are supplying the webhook secret in the request."]
    h13["Check IDs such as folder IDs and dashboard IDs to make sure the ID connects to a valid resource that has not been deleted. "]
    h14["Since the resources exist but this user gets a 404 when attempting to access them, there is most likely an issue with the user's permissions and/or access. Review the permissions list to determine For example, a request for a dashboard will require access data see_looks see_user_dashboards. Then examine the user's roles on the user edit page in the Admin - Users panel."]
    h15["Add the required permissions to a role assigned to the user."]
    h16["Give the user or one of the user's groups access to the folder."]
    h17["Edit the user's value for the specified user attribute to one of the required values in the access grant."]
    h18["Deploy your project to make the resource available in prod. Alternatively, if the Looker user seeing the 404 has the develop permission, enter development mode to access the resource. (For API, use the update_session endpoint with request body {workspace_id: dev} to switch the API session to dev mode)."]
    h19["Next, let's check to see if the 404 is being thrown due to incorrect user permissions or access. Sudo as the user seeing the 404 error."]
    h20["You've verified that the user has the correct permissions and access."]
    h21["Add the model to the model set of one of the roles that the user is assigned to."]
    h22["Double check all of the steps in the process to see if there is anything you might have missed. If you are still unable to resolve the 404 error, reach out to Support."]


    %% Graph Connections
    H ---- h2
    h2 ---> d1

    d1 --->|Looker API call| h3
    d1 --->|Browser| d2

    d2 --->|No| h4
    d2 --->|Yes| d3

    d3 --->|Found typos| h6
    d3 --->|No typos| d4


    d4 --->|Yes| d8
    d4 --->|No| d10
    d8 --->|No| d9
    d8 --->|Yes| h8

    d9 --->|No| h12
    d9 --->|Yes| h8

    h12 --->|Continue if 404 persists| d10
    h8 --->|Continue if 404 persists| d10

    h3 --->|Continue if 404 persists| d5
    d5 --->|Not sure| h5
    d5 --->|Yes| d6

    h5 --->|Continue if 404 persists| d6

    d6 --->|Yes| d4
    d6 --->|Not sure| h7

    h7 --->|Continue if 404 persists| h10

    h10 --->|Continue if 404 persists| h9

    h9 ---> d10

    d10 --->|Not sure| h13
    d10 --->|Yes| h18

    h19 ---> d21

    d21 --->|Yes| h14
    d21 --->|No| h20

    h20 --->|Continue if 404 persists| h22
    h17 --->|Continue if 404 persists| h22

    d14 --->|Yes| d15
    d14 --->|No| h15

    d13 --->|Yes| d12
    d13 --->|No| d14

    d12 --->|No| h11
    d12 --->|Yes| h15

    h15 --->|Continue if 404 persists| d15

    d15 --->|Yes| d16
    d15 --->|No| d18

    d16 --->|Yes| d17
    d16 --->|No| h21

    h21 --->|Continue if 404 persists| d17

    d17 --->|Yes| d18
    d17 --->|No| d20


    d18 --->|Yes| h22
    d18 --->|Not sure| h16

    d19 --->|Yes| h22
    d19 --->|No| h17

    d20 --->|Yes| d19
    d20 --->|No| h22

    h18 --->|Continue if 404 persists| h19
    h13 --->|Continue if 404 persists| d13

    %% Styling

    classDef start fill:#ECECFF,stroke:#000,stroke-width:3px,font-weight:bold;
    class H start

    classDef decision fill:#D8EED8,stroke:#000,stroke-width:2px,font-weight:normal;
    class d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21 decision

    classDef solution fill:#FEF6E0,stroke:#000,stroke-width:2px,font-weight:normal;
    class h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22 solution

    classDef explain fill:#FEEFE3,stroke:#000,stroke-width:2px,font-weight:normal;
    class h2,h7,h9,h11,h19 explain

    classDef support fill:#FCE0E0,stroke:#000,stroke-width:2px,font-weight:normal;
    class h22 support

    %% Click events

    click d4 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#webhook"
    click d6 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#conditional-endpoints"
    click d7 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#conditional-endpoints"
    click d8 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#webhook"
    click d9 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#conditional-endpoints"
    click d10 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#check_if_requested_resources_exist"
    click d12 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click d13 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#embed-permissions"
    click d15 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click d16 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click d17 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#content-access"
    click d19 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#access-grants"
    click d20 href "https://cloud.google.com/looker/docs/reference/param-explore-required-access-grants"
    click h3 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#api-docs"
    click h7 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#conditional-endpoints"
    click h8 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#advanced-deploy-mode"
    click h10 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#conditional-endpoints"
    click h11 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#embed-permissions"
    click h14 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click h15 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click h18 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#resources-exist"
    click h19 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#impersonate"
    click h21 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#user-permissions"
    click h22 href "https://cloud.google.com/looker/docs/best-practices/404-troubleshooting#support"