New guide: AI is in production. Is your governance?

Announcing Visual Copilot - Figma to production in half the time

Builder.io
Builder.io
Contact sales

New guide: AI is in production. Is your governance?

Announcing Visual Copilot - Figma to production in half the time

Manage access to your Builder Space and connect it with external systems. Use these operations to retrieve users, configure SSO providers, and create webhooks for automated workflows.

Retrieve all users from a Builder Space.

To get all users from your Builder Space, use the following query.

Query

const response = await adminSDK
  .query({
    users: {
      id: true,
      name: true,
      email: true,
      role: true,
      lastActive: true
    }
  });

Response

{
  "data": {
    "users": [
      {
        "id": "...",
        "name": "Elena Aguilar",
        "email": "elena@builder.io",
        "role": "admin",
        "lastActive": 1746049078845
      },
      ...
    ]
  }
}

To configure SSO providers through the Admin API, SSO must first be enabled for your space. For more details on SSO options, see SSO with your Identity Provider and Using Code Flow with SSO.

To set up a new SAML authentication provider within your space, use the following query.

const result = await adminSDK.chain.mutation.addSAMLProvider({
  settings: {
    displayName: "Company SSO",
    idpEntityId: "https://sso.company.com/entityId",
    ssoURL: "https://sso.company.com/login",
    x509Cert: "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
    rpEntityId: "https://www.builder.io"
  }
});

To set up an OIDC authentication provider within your space, use the following query.

const result = await adminSDK.chain.mutation.addOIDCProvider({
  settings: {
    displayName: "Company SSO",
    clientId: "https://sso.company.com/entityId",
    issuer: ""
  }
});

Add one or more webhooks to existing Spaces.

const result = await adminSDK
  .chain.mutation.updateWebhooks({
    webhooks: [
      {
        url: "https://webhook1.example.com/content-update",
        disablePayload: false,
        customHeaders: [
          {
            name: "Authorization",
            value: "Bearer token123"
          }
        ]
      },
      {
        url: "https://webhook2.example.com/notify",
        disablePayload: true,
        customHeaders: []
      }
    ]
  });

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?