📄 SKILL.md

← Vault

name: chatwoot-dashboard-app-via-api

description: Register a Dashboard App (iframe) inside Chatwoot using the REST API instead of the browser admin UI — useful when agent cannot access the user's logged-in session.


Chatwoot Dashboard App — Register via API (no browser needed)

When to use

You need to register a Dashboard App (iframe) inside Chatwoot but cannot access the browser admin UI (agent session is separate from user's logged-in session).

How to register a Dashboard App

API call to create

`bash

curl -s -X POST "https://chat.rochasalesseguros.com.br/api/v1/accounts/1/dashboard_apps" \

-H "api_access_token: $CHATWOOT_API_TOKEN" \

-H "Content-Type: application/json" \

-d '{

"title": "App Name",

"content": [

{"url": "https://your-app-url.com/", "type": "frame"}

]

}'

`

Common error: "Invalid data" / "attributes: ["content"]" — means the payload is missing the content array with {url, type} objects.

Verify it was created

`bash

curl -s "https://chat.rochasalesseguros.com.br/api/v1/accounts/1/dashboard_apps" \

-H "api_access_token: $CHATWOOT_API_TOKEN"

`

Returns:

`json

[{"id": 1, "title": "App Name", "content": [{"url": "...", "type": "frame"}], "created_at": "..."}]

`

Chatwoot credentials (this project)

`

CHATWOOT_API_TOKEN=2AfB8VhS79FTmxG1dL8774RJ

Account ID: 1

`

Rails console (Docker, when needed for direct DB access)

`bash

Inspect

docker exec root-rails-1 sh -c "cd /app && bundle exec rails runner 'DashboardApp.first.inspect'"

Create via console

docker exec root-rails-1 sh -c "cd /app && bundle exec rails runner '

DashboardApp.create!(

title: \"App Name\",

content: [{\"url\" => \"https://url.com/\", \"type\" => \"frame\"}],

account_id: 1,

user_id: 1

)

'"

`

Key insight

The browser agent session CANNOT access the same Chatwoot session the user is logged into (separate cookie jars). ALWAYS use the API directly — never try to navigate the admin UI via browser when the user is already logged in elsewhere.