Can't create a Public Workspace through the API

Hey,
I was trying to create a public workspace programatically. I am able to create a personal one however, changing the type variable to public gives me the following error:
{"error":{"name":"invalidParamError","message":"body.roles is invalid"}}

Also, if I try team the error changes to:
{"error":{"name":"invalidParamError","message":"body.visibilityStatus is invalid"}}

Am I not allowed to create a Public Workspace through API? I can do it with the app.

Thank you

Hi, @andreolveira!

We have tested the POST workspace as we document it and it works.

We noticed you’re getting an invalid param error for body.roles , which isn’t a valid request body param in POST (PUT doesn’t support it either).

This is the accepted request body for the workspace creation:

{
    "workspace": {
        "name": "{{workspaceName}}",
        "type": "{{workspaceType}}",
        "description": "{{workspaceDescription}}"
    }
}

The second error response is also an unsupported param in PUT/POST (visibilityStatus ).

Please, follow the Postman API documentation, and if you get an error with the proper request body, please let us know, and post the specific request information so we can try to reproduce it.

Thanks for your time!

Hey. Thank you for your response. I simply copied the curl example and changed personal to public as seen in the image and the error keeps showing up

Thanks for your reply, @andreolveira!
We will check why you get this error. It should not happen if you can do it via the UI.
Thanks for your patience.

Thank you!
Screenshot 2024-09-27 at 10.16.39
Just making sure I’m not crazy :slight_smile:

Can you please execute the /me API and tell me your userId and teamId?
I think this information can be shared, as it’s not a password like the Postman API key.

The userId is 38277111 and the teamId is 6472005. I solved the problem with the team type, it’s just the public that is still not working

For some reason it’s working now… Not sure what changed

Nothing on our side, I believe…
In any case, if you find any other problem related to this endpoint or any other in the Postman API, please let us know.