Main workspace has an ID?

This is kind of confusing, and I’m not sure if there has been a recent change or not.

According to the documentation:

**Please note** that every account has a *Main* workspace that returns a null workspace ID because you cannot return *Main* workspace details via the API.

However, my “Main workspace” does have an ID:

And I can query its details from the API (workspaces object):
image

Has there been a change recently that returns main workspace details?

Hi @EricM,

Thanks for bringing this to our attention! I also had not yet encountered this, but I found out that this is due to our multi-product migration that is being completed over the next few months.

The end result will allow all users to query the main workspace, but for now, only some users have this capability. I’ve added a note for clarification in the documentation, and we will of course provide more updates/new documentation as these changes are rolled out.

Let us know if you have any other questions! :smiley:

Best,
Rachel

2 Likes

Thanks for the information @rachelatmonday. Do you know if this new main workspace functionality will make the main workspace appear in a query like this:

query { workspaces {id name}}

Currently, the main workspace doesn’t appear in this query. Also, do you happen to know when the migration will be complete? Is this functionality a part of a new API version, or will the main workspace suddenly appear in a query like the one above?

@rachelatmonday Not sure if you saw my previous question, but I just wanted to mention you again just in case.

Hi @PluginGenie,

Thanks for pinging me! I am waiting to clarify with our dev team, but I will let you know ASAP. I do know that this functionality will not me a new addition - in other words, the query you shared will start returning an ID.

Best,
Rachel

1 Like

Rachel, thanks for checking with the dev team. I really appreciate it!

Hey @PluginGenie,

Thanks for your patience. Here’s what they said:

  1. This query will return the main workspace for accounts that have already been migrated. If the account hasn’t been migrated, the query will function as it always has.
  2. No timeline at the moment. It’s a big migration that will take a lot of time. We are in the process of migrating and still have a ways to go. Any updates will be communicated through our standard channels as we get them :slight_smile:
  3. This is not part of a new API version. The only new feature related to versioning is the is_default_workspace field that you can use to return whether or not the workspace is the main one (see announcement here).

Let me know if you have any other questions!

Best,
Rachel

1 Like

Thanks for the reply! That is very helpful. I did not know about the is_default_workspace, so that’s good to know.

Hi @rachelatmonday,

Could a workspace’s ID be -1 in some scenarios? I have a client that they are in this situtiation and they can not use the app.

Hello there @apsimos,

That can be the case for some accounts.

On that note, please check this out!!

Hi @Matias.Monday

That is not the case. I want to reach the main workspace via the API. The following query returns empty result.

query {
  workspaces(ids: [-1]){
    id
    name
  }
}

@Matias.Monday Also the following query does not load the workspace which does an ID like -1:

          workspaces{
            id
            name
            is_default_workspace
          }

Hello again,

As a workaround, you can get the name of the main workspace with a query like this one:

query {
  boards (workspace_ids: [null], limit:1) {
    name
    workspace{
      name
      id
    }
  }
}

That last query might not give you the main workspace. The ability to query for said workspace is being gradually released.