Skip to content
Skip to main contentWhere does your team stand on AI adoption?
CONTACT SALESSTART BUILDING

Space configuration

Configure how a Builder Space behaves across users, regions, and devices. Use these operations to manage targeting attributes, locales and locale groups, responsive breakpoints, and other environment-level settings.

Get Space settings

Get the current settings for your Builder Space. For more details, see Spaces Overview.

Framework

Query

const response = await adminSDK .query({ settings: true, });

Response

{ "data": { "settings": { ... } } }

Targeting attributes

Set custom targeting attributes

Replace every custom targeting attribute for the current space while preserving the existing locale definition.

Framework

Query:

const result = await adminSDK .chain.mutation.setCustomTargetingAttributes({ attributes: [ { key: "plan", schema: { type: "string", enum: ["free", "pro", "enterprise"] } } ] }) .execute();

Response:

{ "data": { "setCustomTargetingAttributes": [ { "key": "locale", "schema": { "type": "string", "enum": ["en-US"] } }, { "key": "plan", "schema": { "type": "string", "enum": ["free", "pro", "enterprise"] } } ] } }

Delete custom targeting attributes

Remove a single non-locale attribute.

Framework

Query:

const result = await adminSDK .chain.mutation.deleteCustomTargetingAttribute({ key: "plan" }) .execute();

Response:

{ "data": { "deleteCustomTargetingAttribute": [ { "key": "device" } ] } }

Upsert custom targeting attributes

Create or update a single attribute, except locale.

Framework

Query:

const result = await adminSDK .chain.mutation.upsertCustomTargetingAttribute({ key: "device", schema: { type: "string", enum: ["mobile", "desktop"] } }) .execute();

Response:

{ "data": { "upsertCustomTargetingAttribute": [ { "key": "device", "schema": { "type": "string", "enum": ["mobile", "desktop"] } } ] } }

Locales

Set Space locales

Remove a locale value and clean up related groups.

Framework

Query:

const result = await adminSDK .chain.mutation.setSpaceLocales({ locales: ["en-US", "de-DE", "es-ES"] }) .execute();

Response:

{ "data": { "setSpaceLocales": { "enum": ["en-US", "de-DE", "es-ES"] } } }

Upsert Space locale

Add or update a locale entry, optionally attaching descriptions and groups.

Framework

Query:

const result = await adminSDK .chain.mutation.upsertSpaceLocale({ locale: { name: "fr-FR", description: "French", groups: ["eu"] } }) .execute();

Response:

{ "data": { "upsertSpaceLocale": { "enum": ["en-US", "fr-FR"], "descriptions": [ { "name": "en-US", "description": "English" }, { "name": "fr-FR", "description": "French", "groups": ["eu"] } ] } } }

Delete Space locale

Remove a locale value and clean up related groups.

Framework

Query:

const result = await adminSDK .chain.mutation.deleteSpaceLocale({ locale: "fr-FR" }) .execute();

Response:

{ "data": { "deleteSpaceLocale": { "enum": ["en-US"] } } }

Locale groups

Set Space locale group

Replace the complete set of locale groups.

Framework

Query:

const result = await adminSDK .chain.mutation.setSpaceLocaleGroups({ groups: [ { name: "amer", defaultLocale: "en-US" }, { name: "emea", defaultLocale: "en-GB" } ] }) .execute();

Response:

{ "data": { "setSpaceLocaleGroups": { "groups": { "amer": "en-US", "emea": "en-GB" } } } }

Delete Space locale groups

Remove a locale group and associated memberships.

Framework

Query:

const result = await adminSDK .chain.mutation.deleteSpaceLocaleGroup({ name: "emea" }) .execute();

Response:

{ "data": { "deleteSpaceLocaleGroup": { "groups": {} } } }

Upsert Space locales

Create or update a locale group with a default locale.

Framework

Query:

const result = await adminSDK .chain.mutation.upsertSpaceLocaleGroup({ name: "emea", defaultLocale: "en-GB" }) .execute();

Response:

{ "data": { "upsertSpaceLocaleGroup": { "groups": { "emea": "en-GB" } } } }

Plugins

Add a plugin

Update the list of plugins.

Framework
const { createAdminApiClient } = require("@builder.io/admin-sdk"); const adminSDK = createAdminApiClient(YOUR_PRIVATE_KEY); await adminSDK.chain.mutation.updatePlugins({ plugins: ["magento"] }).execute({ success: true });

Configure plugin settings

Configure settings for an already added plugin.

Framework
await adminSDK.chain.mutation.updateSpace({ body: { settings: { plugins: { magento: { storeUrl: "https://your-store.com", apiKey: YOUR_API_KEY, apiSecret: YOUR_SECRET_KEY } } } } }).execute({ id: true, settings: { plugins: true } });

Responsive Breakpoints

Set Space breakpoints

Persist responsive breakpoints with validation (integers, ≥2px spacing).

Framework

Query:

const result = await adminSDK .chain.mutation.setSpaceBreakpoints({ breakpoints: { xsmall: 360, small: 640, medium: 1024 } }) .execute();

Response:

{ "data": { "setSpaceBreakpoints": { "xsmall": 360, "small": 640, "medium": 1024 } } }

What's next

Continue to explore the Admin API documentation or use the GraphQL Explorer to try out these queries with your own Space and Organization. Then, visit the Admin API GraphQL Schema for more details on how to modify your queries.

Was this article helpful?