> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinkplatform.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Choose User guide for browser tasks, Developers for CLI, SDK and external agents, and Administration for organization management.
> Confirm identity and organization/project context before operations. Documentation access does not grant ThinkPlatform permissions.
> Review side effects, verify changes with a read, and do not blindly retry an operation with an uncertain outcome.
> Use documented UI steps for the web app and documented public CLI or SDK interfaces for automation. Follow each page’s prerequisites and authentication requirements.

# Resource workflows

> Read project resources, update a page title, and page through data lake files.

For every resource method and default, see the [API reference](https://docs.thinkplatform.ai/python-sdk/api-reference.md). For returned fields and JSON aliases, see [models and results](https://docs.thinkplatform.ai/python-sdk/models.md). The [database workflow](https://docs.thinkplatform.ai/python-sdk/database.md) covers schema inspection, row queries, and verified writes.

Start with a known organization and project. Resource calls enforce the permissions of your credential; setting context does not grant access.

## Essential methods

Signatures below omit `self`. Unless noted, context-aware methods accept keyword-only `org_id=None, project_id=None`, falling back to the client context.

| Method | Return and behavior |
| - | - |
| `auth.whoami()` | `AuthenticatedUser` with optional `id` and `username`. |
| `organizations.list()` | `list[Organization]`; optional `id`, `name` fields. No pagination arguments. |
| `projects.list(*, org_id=None)` | `list[Project]`; optional `id`, `name`, `organization_id`, `user_role`. Requires organization context; no pagination arguments. |
| `home.data(*, org_id=None, project_id=None)` | Mapping containing dashboard data. |
| `home.pages.list(...)` | `list[Mapping[str, Any]]`; no pagination arguments. |
| `home.pages.get(page_id, ...)` | A page mapping. |
| `home.pages.create(payload, ...)` | Created page mapping; writes data. |
| `home.pages.update(page_id, payload, ...)` | Updated page mapping; writes data. |
| `home.pages.delete(page_id, ...)` | `None`; deletes a page. |
| `datalake.list(*, path="", continuation_token=None, org_id=None, project_id=None)` | `DatalakeListPage`; consume `items`, then pass `continuation_token` into another call. No automatic iteration. |
| `datalake.preview_text(path, ...)` | `DatalakeTextPreview`. |

`home`, `dashboard`, and `canvas` refer to the same resource namespace. For example, `client.canvas.pages.list()` and `client.home.pages.list()` use the same page API. See [Canvas pages](https://docs.thinkplatform.ai/cli/guides/canvas-pages.md) for the CLI workflow.

For container-backed apps, use [`client.hosted_apps`](https://docs.thinkplatform.ai/python-sdk/hosted-apps) for publication management and a request-bound client for delegated data access inside an app. [`client.lakehouse.statements`](https://docs.thinkplatform.ai/python-sdk/lakehouse) submits SQL and retrieves status and result chunks. These namespaces require client 0.6.133 or later and the corresponding deployment services.

## Read, then conditionally update a page

Set `THINKPLATFORM_ORG_ID`, `THINKPLATFORM_PROJECT_ID`, and `THINKPLATFORM_PAGE_ID` along with `THINKPLATFORM_API_BASE_URL` and a bearer token in `THINKPLATFORM_ACCESS_TOKEN` as described in [authentication](https://docs.thinkplatform.ai/python-sdk/authentication.md). The example reads the page first and changes its title only when `THINKPLATFORM_APPLY_UPDATE=yes`; leave that flag unset to inspect without writing. Confirm the page ID and intended title before enabling it. After the update, a separate GET checks the stored title. These requests are not an atomic compare-and-swap; another writer can change the page between them.

```python theme={"system"}
import os
from thinkplatform.sdk import StaticTokenCredential, ThinkPlatformClient

with ThinkPlatformClient(
    base_url=os.environ["THINKPLATFORM_API_BASE_URL"],
    credential=StaticTokenCredential(os.environ["THINKPLATFORM_ACCESS_TOKEN"]),
    org_id=int(os.environ["THINKPLATFORM_ORG_ID"]),
    project_id=int(os.environ["THINKPLATFORM_PROJECT_ID"]),
) as client:
    page_id = os.environ["THINKPLATFORM_PAGE_ID"]
    page = client.home.pages.get(page_id)
    desired_title = "Project status"
    print(page.get("title"))
    if os.environ.get("THINKPLATFORM_APPLY_UPDATE") == "yes":
        if page.get("title") != desired_title:
            client.home.pages.update(page_id, {"title": desired_title})
            verified = client.home.pages.get(page_id)
            if verified.get("title") != desired_title:
                raise RuntimeError("The stored page title does not match the requested title.")
            print(verified.get("title"))
```

## Follow a continuation token

```python theme={"system"}
import os
from thinkplatform.sdk import StaticTokenCredential, ThinkPlatformClient

with ThinkPlatformClient(
    base_url=os.environ["THINKPLATFORM_API_BASE_URL"],
    credential=StaticTokenCredential(os.environ["THINKPLATFORM_ACCESS_TOKEN"]),
    org_id=int(os.environ["THINKPLATFORM_ORG_ID"]),
    project_id=int(os.environ["THINKPLATFORM_PROJECT_ID"]),
) as client:
    token = None
    seen_tokens = set()
    for _ in range(20):
        page = client.datalake.list(path="", continuation_token=token)
        for item in page.items:
            print(item.path, item.is_directory, item.size)
        token = page.continuation_token
        if not token:
            break
        if token in seen_tokens:
            raise RuntimeError("The server repeated a continuation token.")
        seen_tokens.add(token)
    else:
        raise RuntimeError("Stopped at the 20-page budget; the inventory is incomplete.")
```

This example makes at most 20 page requests and rejects repeated continuation tokens. If more pages remain after the limit, it raises an error to indicate that the inventory is incomplete. Adjust the limit for your workload.

Pagination is method-specific. A list return value is not a page object; do not assume `has_more`, `next_cursor`, or a common paginator exists.

## Other resource families

The client also exposes `agents` (including tasks, teams, workspaces and memories), `tasks`, `flows`, `apps`, `hooks`, `webhooks`, `skills`, `modules`, `devices`, `db.tables`, `db.rows`, and `mlops`. See the [API reference](https://docs.thinkplatform.ai/python-sdk/api-reference.md) for their methods and return types. Some CLI operations have no equivalent SDK method.

Many resource methods return Pydantic models with attribute access, optional fields, and support for additional server fields. Canvas pages and some other endpoints return mappings instead: use `page.get("title")`, not `page.title`. Raw download methods return `RawResponse` with `status_code`, `body` bytes, `headers`, and `content_type`. Low-level `request_json()`, `request_raw()`, and `request_multipart()` are available when you already know the API contract; they do not infer resource payload schemas.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.