Skip to main content

Specs API

Specs API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference​

MethodDescription
createCreates a new specification document.
ensureFolderEnsures the specs folder exists in the workspace.
getRetrieves a specific specification document.
listLists all specification documents.
updateUpdates an existing specification document.

Methods​


create​

client.specs.create(data: CreateSpecRequest): Promise<Spec>

Creates a new specification document.

Registers a new spec with the system using the provided content. The spec can include technical details, API definitions, architecture descriptions, and other structured specification information.

ParameterTypeRequiredDescription
dataCreateSpecRequestYesRequest containing the spec details

Returns: Promise<Spec> — A promise that resolves to the created Spec object

Full reference →


ensureFolder​

client.specs.ensureFolder(data?: EnsureSpecFolderRequest): Promise<unknown>

Ensures the specs folder exists in the workspace.

Creates the specification directory if it doesn't already exist, establishing a location for storing spec files and related documentation. This operation is idempotent and safe to call multiple times.

ParameterTypeRequiredDescription
dataEnsureSpecFolderRequestNoOptional parameters for folder creation

Returns: Promise<unknown> — A promise that resolves when the folder is ensured

Full reference →


get​

client.specs.get(params?: GetSpecParams): Promise<Spec>

Retrieves a specific specification document.

Returns the spec matching the provided query parameters, typically by spec ID or project. The document includes all sections, metadata, and version information.

ParameterTypeRequiredDescription
paramsGetSpecParamsNoQuery parameters to identify the spec

Returns: Promise<Spec> — A promise that resolves to the Spec object

Full reference →


list​

client.specs.list(params?: ListSpecsParams): Promise<Spec[]>

Lists all specification documents.

Returns every spec document in the system, optionally filtered by project, type, or other criteria. Use this for browsing specs or populating specification management UIs.

ParameterTypeRequiredDescription
paramsListSpecsParamsNoOptional query parameters for filtering specs

Returns: Promise<Spec[]> — A promise that resolves to an array of Spec objects

Full reference →


update​

client.specs.update(data: UpdateSpecRequest): Promise<Spec>

Updates an existing specification document.

Modifies the content, metadata, or structure of a spec. Use this to add new sections, update information, change versions, or make other modifications as specifications evolve.

ParameterTypeRequiredDescription
dataUpdateSpecRequestYesRequest containing the spec updates

Returns: Promise<Spec> — A promise that resolves to the updated Spec object

Full reference →