Skip to content

Manage Layouts

Layouts are the saved dashboard configurations you build in the Zelos App. agent.layouts gives you the same CRUD surface from Python — useful for provisioning team dashboards from code, backing them up, or generating them from templates.

Layouts live in Zelos Cloud, so the agent must be logged in (zelos login). The snippets below assume an agent connected via connect():

from zelos_sdk.agent import connect

with connect() as agent:
    ...

List and inspect

for layout in agent.layouts.list():
    scope = "personal" if layout.is_personal else "team"
    print(f"{layout.name:30} {scope:8} {layout.id}")

Each Layout carries id, name, data (the panel configuration as a dict), is_personal, team_id, created_at, updated_at, and the owning email. Fetch one by id with agent.layouts.show(id).

Create

created = agent.layouts.create("My Dashboard", {"panels": []})
print(created.id)

# Scope to yourself instead of the team
personal = agent.layouts.create("Scratch", {"panels": []}, is_personal=True)

data accepts any JSON-serializable dict. The easiest way to author one is to build the layout in the app, then copy its data from show().

Update

update() patches only what you pass — omitted fields keep their current values (the SDK fetches the current layout first when needed):

agent.layouts.update(created.id, name="Renamed Dashboard")
agent.layouts.update(created.id, data={"panels": []}, is_personal=True)

Passing no fields at all raises ValueError.

Delete

agent.layouts.delete(created.id)

Errors

Exception When
ValueError Malformed layout id, non-JSON-serializable data, or an update() with no fields. Raised before any network call.
AgentError Layout not found, agent not logged in, or the call failed.