AI-Agent-First Documentation
Prompt your Agent: "Query and mutate records on the 'template' table (ID prefix 'temp_') using platform.records and platform.query.sql, ensuring all lookup fields use plain string IDs."
Template (template)
Templates are reusable pieces of copywriting that can be applied in a variety of ways.
Python SDK & PlatformContext Example
# 1. Query template via parameterized ANSI SQL
rows = await platform.query.sql("SELECT id, name, created_date FROM template ORDER BY created_date DESC LIMIT 25")
# 2. Create template record (Generates 'temp_...' Base62 ID)
created = await platform.records.create("template", [
{"name": "Example Template"}
])| Field API Name | Type / Format | Lookup Target | Flags | Description |
|---|---|---|---|---|
| id | string | — | required | Id |
| name | string | — | required | Name |
| created_date | stringdate-time | — | Created Date | |
| modified_date | stringdate-time | — | Modified Date | |
| created_by | stringlookup | → user (string ID) | requiredsystem | Created By |
| modified_by | stringlookup | → user (string ID) | requiredsystem | Modified By |
| body | stringtext-area | — | Body | |
| type | stringenum | — | required | Type |
| subject | string | — | The subject of the template, especially for emails | |
| query | stringtext-area | — | A SQL query to populate dynamic data | |
| function | stringlookup | → function (string ID) | A function to dynamically fetch merge data | |
| code | jsonjson | — | The code blocks associated with the template from the builder | |
| shared_with | listsharing | — | system | Shared With |
