Builder
Generate and manage website builder content.
Get every content type and the blocks allowed in it
/builder/content-typesimport { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: contentTypes } = await gc.builder.getContentTypes();
Get the styles schema shared by every block
/builder/stylesimport { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const blockStyles = await gc.builder.getBlockStyles();
Get one block type's own fields and hints; shared styles come from getBlockStyles
/builder/blocks/{blockType}- contentTypeRequired
- query · string
- blockTypeRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { data: block } = await gc.builder.getBlock({ blockType: "hero", contentType: "text/html"});
Delete a section and every block inside it; recoverable from version history
/organizations/{organizationId}/projects/{projectId}/content/sections/delete- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- contentIdRequired
- stringThe entity being edited.
- sectionIdRequired
- string
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.deleteSection({ organizationId: orgs[0].id, projectId: projects[0].id, data: { id: "section-id" }});
Insert a section into a content tree
/organizations/{organizationId}/projects/{projectId}/content/sections/insert- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- section
- object
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
- afterSectionId
- string
- beforeSectionId
- string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.insertSection({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Update a section's own properties; blocks stay untouched and columns cannot be patched
/organizations/{organizationId}/projects/{projectId}/content/sections/update- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- patchRequired
- object
- contentIdRequired
- stringThe entity being edited.
- sectionIdRequired
- string
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.updateSection({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Delete a block, returning it; the prior tree stays in version history
/organizations/{organizationId}/projects/{projectId}/content/blocks/delete- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- blockIdRequired
- string
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.deleteBlock({ organizationId: orgs[0].id, projectId: projects[0].id, data: { id: "block-id" }});
Insert a block into a content tree
/organizations/{organizationId}/projects/{projectId}/content/blocks/insert- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- dataRequired
- object
- typeRequired
- stringBlock type, e.g. heading, text, image.
- styles
- object
- columnId
- string
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
- afterBlockId
- string
- beforeBlockId
- string
- intoSectionId
- string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.insertBlock({ organizationId: orgs[0].id, projectId: projects[0].id, data: {},});
Update a block's data and/or styles by merging only the fields you send; null clears a field
/organizations/{organizationId}/projects/{projectId}/content/blocks/update- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- data
- object
- styles
- object
- blockIdRequired
- string
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.updateBlock({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Move a section before or after a sibling, or append it at the end
/organizations/{organizationId}/projects/{projectId}/content/sections/move- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- contentIdRequired
- stringThe entity being edited.
- sectionIdRequired
- string
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
- afterSectionId
- string
- beforeSectionId
- string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.moveSection({ organizationId: orgs[0].id, projectId: projects[0].id, data: {},});
Move a block beside a sibling or into a section, leaving its data unchanged
/organizations/{organizationId}/projects/{projectId}/content/blocks/move- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- blockIdRequired
- string
- columnId
- string
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
- afterBlockId
- string
- beforeBlockId
- string
- intoSectionId
- string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.moveBlock({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Set whether content is listed and whether it requires a signed-in reader
/organizations/{organizationId}/projects/{projectId}/content/visibility- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- isListed
- booleanWhether this appears anywhere that lists content: the sitemap, blog and category indexes, post grids, next-post navigation and site search. False is "anyone with the link" — the page stays live at its own URL and is simply not advertised. It is NOT a way to make something private; use requiresViewerAuth for that.
- contentIdRequired
- stringThe entity being edited.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
- requiresViewerAuth
- booleanWhether a reader must be signed in to see the body. A gated page does not 404 for an anonymous visitor — it renders the site's own Sign In Page, so someone who followed a link learns that signing in would show it. Only website pages and posts can be gated, and only on a site that has viewer sign-in switched on; without a tenant to sign in to, a gated page is unreachable by everyone.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.setContentVisibility({ organizationId: orgs[0].id, projectId: projects[0].id, data: {},});
Return a published item to draft — status only, never the body
/organizations/{organizationId}/projects/{projectId}/content/unpublish- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- contentIdRequired
- stringThe entity being edited.
- publishAt
- unionWhen to publish. Omit to publish immediately. An ISO timestamp in the future schedules it instead: the item stays a draft, invisible to the public, until a job takes it live within five minutes of that time. Null cancels a schedule already set. A time in the past is rejected rather than published now — say what you mean by omitting this.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.unpublishContent({ organizationId: orgs[0].id, projectId: projects[0].id, data: {}});
Publish a page, post, article, doc or email — status only, never the body
/organizations/{organizationId}/projects/{projectId}/content/publish- organizationIdRequired
- path · string
- projectIdRequired
- path · string
- contentIdRequired
- stringThe entity being edited.
- publishAt
- unionWhen to publish. Omit to publish immediately. An ISO timestamp in the future schedules it instead: the item stays a draft, invisible to the public, until a job takes it live within five minutes of that time. Null cancels a schedule already set. A time in the past is rejected rather than published now — say what you mean by omitting this.
- contentTypeRequired
- stringEntity discriminator: website_page, website_post, website_landing, etc.
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.publishContent({ organizationId: orgs[0].id, projectId: projects[0].id, data: { title: "New Content", body: "Hello world" }});
Find a string or a block type inside content
/organizations/{organizationId}/projects/{projectId}/content/search- query
- query · string
- blockTypes
- query · array
- contentTypes
- query · array
- status
- query · union
- limit
- query · number
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const result = await gc.builder.searchContent({ organizationId: orgs[0].id, projectId: projects[0].id,});
Get a content tree for editing
/organizations/{organizationId}/projects/{projectId}/content- contentTypeRequired
- query · string
- contentIdRequired
- query · string
- organizationIdRequired
- path · string
- projectIdRequired
- path · string
import { createGiantContext } from "@giantcontext/sdk-typescript";
const gc = createGiantContext({ apiKey: process.env.GIANTCONTEXT_API_KEY! });
const { organizations: orgs } = await gc.me.listMyOrganizations();const { projects } = await gc.projects.listProjects({ organizationId: orgs[0].id });
const { content } = await gc.builder.getContent({ organizationId: orgs[0].id, projectId: projects[0].id, contentType: "page", contentId: "content-123",});