skopik

Team Templates

Team templates turn a desired outcome into a repeatable team shape — the member slots, settings, and shared files a new team starts with. Template files are edited in a draft tree; publishing promotes the draft into the version new teams are created from.

Create a team from a template with teams.createFromTemplate(). To generate a template body from a plain-language prompt, start with teams.draft() — its templateBody can be passed straight to teams.templates.create().

Quick Links

Action Description
teams.templates.list() List team templates.
teams.templates.create() Create a team template.
teams.templates.get() Read a template.
teams.templates.update() Update a template.
teams.templates.archive() Archive a template.
teams.templates.publish() Publish the draft tree.
teams.templates.duplicate() Duplicate a template.
teams.templates.files.list() List template files.
teams.templates.files.read() Read a template file.
teams.templates.files.write() Write a template file.
teams.templates.files.delete() Delete a template file.
teams.templates.files.move() Move or rename a template file.

Reference

teams.templates.list(params?)

List team templates. The SDK scopes the listing to team-kind templates automatically.

const { data: templates } = await client.teams.templates.list({ source: 'user' })

Parameters

Field Type Required Notes
source string No user or curated.
tags string[] No Filter by tags.

Returns ListResponse<Template>{ data: Template[], page? }.

teams.templates.create(input)

Create a team template. The SDK sets the template kind to team automatically; files seeds the template's draft tree.

const { template } = await client.teams.templates.create({
	name: 'Launch Team',
	description: 'A manager plus writer and QA agents for release launches.',
	files: [{ path: 'README.md', content: 'How this team works.' }],
})

Parameters

Field Type Required Notes
name string Yes Template name.
description string No Template description.
tags string[] No Tags for filtering.
icon string No Template icon.
color string No Template accent color.
role string No Role description.
metadata object No Customer metadata.
files { path, content }[] No Files to seed the draft tree.

Returns { template: Template }.

teams.templates.get(templateId)

Read one template.

const { template } = await client.teams.templates.get(templateId)

Returns { template: Template }.

teams.templates.update(templateId, input)

Update a template's details.

const { template } = await client.teams.templates.update(templateId, {
	description: 'A manager plus writer and QA agents for release launches.',
})

Parameters

Field Type Required Notes
name string No Template name.
description string No Template description.
tags string[] No Tags for filtering.
icon string No Template icon.
color string No Template accent color.
role string No Role description.
metadata object No Customer metadata.
files { path, content }[] No Files to write into the draft tree.

Returns { template: Template }.

teams.templates.archive(templateId)

Archive a template. Archived templates are no longer available for creating teams.

await client.teams.templates.archive(templateId)

Returns nothing — resolves when the API confirms archival (HTTP 204).

teams.templates.publish(templateId)

Publish the current draft tree as the template's published version. New teams created with teams.createFromTemplate() use the published version.

const { template, operation } = await client.teams.templates.publish(templateId)

Returns { template: Template, operation: Operation }operation tracks the publish work.

teams.templates.duplicate(templateId, input?)

Duplicate a template, including its files.

const { template: copy, copiedFiles } = await client.teams.templates.duplicate(templateId, {
	name: 'Launch Team (EU)',
})

Parameters

Field Type Required Notes
name string No Name for the copy.
description string No Description for the copy.
tags string[] No Tags for the copy.
metadata object No Customer metadata.

Returns { template: Template, copiedFiles: number }.

teams.templates.files.list(templateId, params?)

List a template's files.

const { version, data: files } = await client.teams.templates.files.list(templateId)

Parameters

Field Type Required Notes
version string | number No Tree to list: draft, published, or a version number.

Returns { version, data: CatalogFileEntry[] } — see CatalogFileEntry.

teams.templates.files.read(templateId, filePath, params?)

Read one template file.

const { file } = await client.teams.templates.files.read(templateId, 'README.md')

Returns { file: CatalogFile } — see CatalogFile.

teams.templates.files.write(templateId, filePath, input)

Write a template file. Edits land in the draft tree; publish() makes them live.

const { file } = await client.teams.templates.files.write(templateId, 'playbooks/launch.md', {
	content: '# Launch playbook',
})

Parameters

Field Type Required Notes
content string Yes File content.

Returns { file: CatalogFileEntry } — see CatalogFileEntry.

teams.templates.files.delete(templateId, filePath)

Delete a template file from the draft tree.

await client.teams.templates.files.delete(templateId, 'playbooks/launch.md')

Returns nothing — resolves when the API confirms deletion (HTTP 204).

teams.templates.files.move(templateId, input)

Move or rename a template file within the draft tree.

const { data: files } = await client.teams.templates.files.move(templateId, {
	from: 'playbooks/launch.md',
	to: 'playbooks/release.md',
})

Parameters

Field Type Required Notes
from string Yes Current file path.
to string Yes New file path.

Returns { data: CatalogFileEntry[] } — see CatalogFileEntry.

Types

CatalogFile

Field Type Notes
path string File path within the template.
content string File content.

CatalogFileEntry

Field Type Notes
path string File path within the template.
dir boolean Whether the entry is a directory.
size number Size in bytes.