Add a System Admin with the APC API

The examples on this page show common ways to use the APC API — they’re not a complete API reference. For the full, interactive API documentation for your installation, including every available query, mutation, and type, go to https://houston.<your-base-domain>/v1, and click on the Docs tab. See Develop and test APC API queries for more on using the built-in GraphQL explorer.

Add a System Admin

To add a user as a System Admin through the APC API, you need the following values:

  • The user’s ID. To retrieve this, request the id value in a users query or run astro workspace user list.
  • System Admin permissions.

You can then run the following query to add the user as a System Admin.

1mutation createSystemRoleBinding (
2 $userId: ID! = "<user-id>"
3 $role: Role! = SYSTEM_ADMIN
4) {
5 createSystemRoleBinding(
6 userId: $userId
7 role: $role
8 ) {
9 id
10 }
11}