Guide
Kits

Kits

A kit is the primary container for sections and assets. Each kit can contain multiple versions and each version contains an "outline" made up of sections and headings.

If you are looking to fetch assets from any kit, you can jump to the Assets documentation to fetch specific assets or use search to quey your asset library.

Fetch all Kits

Returns a list of all kits in the space

const kits = await lingo.fetchKits();
const brandKit = kits.find(k => k.name === "Brand");

Kit Properties

name

string

The name of the kit.

description

string

The description of the kit.

kitId

string

The unique identifier for the kit

privacy

string

private, public or password

spaceId

number • required

The id of the space that owns the kit.

status

string

The status of the kit (always `active`).

useVersion

string

The recommended version of the kit.

versions

Version[]

An array of versions in the kit. Which versions are included is determined by the `include` argument when fetching a kit.

Fetch a Kit (with versions)

Returns a single kit and its versions

const kit = awaitlingo.fetchKit("<kitId>", "versions");
 
console.log(`${kit.name} has ${kit.version.lenghth} versions.`);
const recommendedVersion = kit.versions.find(v => v.version === kit.useVersion);

Arguments

kitId

string • required

The uuid for the kit.

include

string

'use_versions' (default) will include the draft and recommended versions, 'versions' will include all versions and null, no versions.

Kit Properties

name

string

The name of the kit.

description

string

The description of the kit.

kitId

string

The unique identifier for the kit

privacy

string

private, public or password

spaceId

number • required

The id of the space that owns the kit.

status

string

The status of the kit (always `active`).

useVersion

string

The recommended version of the kit.

versions

Version[]

An array of versions in the kit. Which versions are included is determined by the `include` argument when fetching a kit.

Kit Version Properties

kitId

string

The unique identifier for the kit the version is in.

version

number

The numeric version.

versionIdentifier

string

A string identifier of the version. (e.g. v1.0)

notes

string

Release notes provided for the version.

status

string

The status of the kit (always `active`).

counts

object

Counts of `items`, `assets`, and `sections` in this version.

sections

Section[]

An array of sections in the version.Only included when fetching the kit outline.

Fetch a Kit Outline

Retrieve the outline of a kit. The outline includes the version information along with a list of sections and headers within each section.

const outline = awaitlingo.fetchKitOutline("<kitId>", 0);
 
const { versionIdentifier, sections } = outline;
console.log(`Version ${versionIdentifier} has ${sections.length} sections`);

Arguments

kitId

string • required

The uuid for the kit.

version

Number • required

The version of the kit to fetch an outline of. Default 0

Kit Version Properties

kitId

string

The unique identifier for the kit the version is in.

version

number

The numeric version.

versionIdentifier

string

A string identifier of the version. (e.g. v1.0)

notes

string

Release notes provided for the version.

status

string

The status of the kit (always `active`).

counts

object

Counts of `items`, `assets`, and `sections` in this version.

sections

Section[]

An array of sections in the version.Only included when fetching the kit outline.

Outline Section Properties

name

string

The uuid of the section.

version

string

The version of the section. (will always match the containing kit version)

shortId

string

A shortend version of the section id.

counts

object

Counts of assets and items in the section

displayOrder

number

The relative order of the section within the version.

headers

OutlineHeader[]

A list of headers in the section.

Outline Header Properties

name

string

The name of the heading.

version

string

The version of the heading. (will always match the containing section)

shortId

string

A shortend version of UUID.

displayOrder

number

The relative order of the section within the version.


Create a kit

Creating content requires an API token with write access enabled.

Create a new kit.

Returns the new kit

const kit = await lingo.createKit("My Kit");

Arguments

name

string • required

The name for the new kit.