code: @POST
     @Consumes(MediaType.APPLICATION_JSON)
     @RolesAllowed("administrators")
     @Path("/create-workspace/{repositoryName}")
     public Response createWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
        WorkspaceEntry newWorkspace) throws URISyntaxException
     {
        String errorMessage = new String();
        Status status;
        try
        {
           RepositoryImpl repository = (RepositoryImpl)repositoryService.getRepository(repositoryName);
           repository.configWorkspace(newWorkspace);
           repository.createWorkspace(newWorkspace.getName());
           repositoryService.getConfig().retain(); // save configuration to persistence (file or persister)
           return Response.ok().cacheControl(NO_CACHE).build();
        }
        catch (RepositoryException e)
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.NOT_FOUND;
        }
        catch (RepositoryConfigurationException e)
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.BAD_REQUEST;
        }
        catch (Throwable e) //NOSONAR
        {
           if (log.isDebugEnabled())
           {
              log.error(e.getMessage(), e);
           }
           errorMessage = e.getMessage();
           status = Status.INTERNAL_SERVER_ERROR;
        }
        return Response.status(status).entity(errorMessage).type(MediaType.TEXT_PLAIN_TYPE).cacheControl(NO_CACHE)
           .build();
     }
docs: Adds a new workspace based on the given configuration to the given repository.
  
  @param uriInfo the uri location
  @param repositoryName the name of the repository
  @param newWorkspace the configuration of the new workspace
  @return Response return the Response
  @throws URISyntaxException will be generated the URISyntaxException
  @request
  {code:json}
  {"newWorkspace" : the configuration of the new workspace}
  {code}
  @LevelAPI Experimental