Skip to main content
POST
/
v2
/
workspace
Create Workspace
curl --request POST \
  --url https://api.sonderplan.com/v2/workspace \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Sydney Studio",
  "id": 9458,
  "description": "Sydney Office, Level 2",
  "resources": [
    {
      "name": "Edit Suite 1",
      "description": "Sydney Office, Level 2",
      "type_id": 1,
      "type_person_id": 0,
      "parent_id": 2908,
      "parent_name": "Cameras",
      "icon": [
        {
          "name": "Avid_Icon",
          "size": 174285,
          "alias": "7e73ab25155974c230d09494548201b9f5056ef",
          "extension": "png",
          "mime_type": "image/png"
        }
      ]
    }
  ],
  "access": [
    {
      "id": 4,
      "acl": "RW",
      "name": "Administrators",
      "type": "group"
    }
  ],
  "feed": "<string>",
  "working_week": 3,
  "country_region": "AU-NSW",
  "show_public_holiday": true
}
'
import requests

url = "https://api.sonderplan.com/v2/workspace"

payload = {
"name": "Sydney Studio",
"id": 9458,
"description": "Sydney Office, Level 2",
"resources": [
{
"name": "Edit Suite 1",
"description": "Sydney Office, Level 2",
"type_id": 1,
"type_person_id": 0,
"parent_id": 2908,
"parent_name": "Cameras",
"icon": [
{
"name": "Avid_Icon",
"size": 174285,
"alias": "7e73ab25155974c230d09494548201b9f5056ef",
"extension": "png",
"mime_type": "image/png"
}
]
}
],
"access": [
{
"id": 4,
"acl": "RW",
"name": "Administrators",
"type": "group"
}
],
"feed": "<string>",
"working_week": 3,
"country_region": "AU-NSW",
"show_public_holiday": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Sydney Studio',
id: 9458,
description: 'Sydney Office, Level 2',
resources: [
{
name: 'Edit Suite 1',
description: 'Sydney Office, Level 2',
type_id: 1,
type_person_id: 0,
parent_id: 2908,
parent_name: 'Cameras',
icon: [
{
name: 'Avid_Icon',
size: 174285,
alias: '7e73ab25155974c230d09494548201b9f5056ef',
extension: 'png',
mime_type: 'image/png'
}
]
}
],
access: [{id: 4, acl: 'RW', name: 'Administrators', type: 'group'}],
feed: '<string>',
working_week: 3,
country_region: 'AU-NSW',
show_public_holiday: true
})
};

fetch('https://api.sonderplan.com/v2/workspace', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sonderplan.com/v2/workspace",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Sydney Studio',
'id' => 9458,
'description' => 'Sydney Office, Level 2',
'resources' => [
[
'name' => 'Edit Suite 1',
'description' => 'Sydney Office, Level 2',
'type_id' => 1,
'type_person_id' => 0,
'parent_id' => 2908,
'parent_name' => 'Cameras',
'icon' => [
[
'name' => 'Avid_Icon',
'size' => 174285,
'alias' => '7e73ab25155974c230d09494548201b9f5056ef',
'extension' => 'png',
'mime_type' => 'image/png'
]
]
]
],
'access' => [
[
'id' => 4,
'acl' => 'RW',
'name' => 'Administrators',
'type' => 'group'
]
],
'feed' => '<string>',
'working_week' => 3,
'country_region' => 'AU-NSW',
'show_public_holiday' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sonderplan.com/v2/workspace"

payload := strings.NewReader("{\n \"name\": \"Sydney Studio\",\n \"id\": 9458,\n \"description\": \"Sydney Office, Level 2\",\n \"resources\": [\n {\n \"name\": \"Edit Suite 1\",\n \"description\": \"Sydney Office, Level 2\",\n \"type_id\": 1,\n \"type_person_id\": 0,\n \"parent_id\": 2908,\n \"parent_name\": \"Cameras\",\n \"icon\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ]\n }\n ],\n \"access\": [\n {\n \"id\": 4,\n \"acl\": \"RW\",\n \"name\": \"Administrators\",\n \"type\": \"group\"\n }\n ],\n \"feed\": \"<string>\",\n \"working_week\": 3,\n \"country_region\": \"AU-NSW\",\n \"show_public_holiday\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sonderplan.com/v2/workspace")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sydney Studio\",\n \"id\": 9458,\n \"description\": \"Sydney Office, Level 2\",\n \"resources\": [\n {\n \"name\": \"Edit Suite 1\",\n \"description\": \"Sydney Office, Level 2\",\n \"type_id\": 1,\n \"type_person_id\": 0,\n \"parent_id\": 2908,\n \"parent_name\": \"Cameras\",\n \"icon\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ]\n }\n ],\n \"access\": [\n {\n \"id\": 4,\n \"acl\": \"RW\",\n \"name\": \"Administrators\",\n \"type\": \"group\"\n }\n ],\n \"feed\": \"<string>\",\n \"working_week\": 3,\n \"country_region\": \"AU-NSW\",\n \"show_public_holiday\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.sonderplan.com/v2/workspace")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Sydney Studio\",\n \"id\": 9458,\n \"description\": \"Sydney Office, Level 2\",\n \"resources\": [\n {\n \"name\": \"Edit Suite 1\",\n \"description\": \"Sydney Office, Level 2\",\n \"type_id\": 1,\n \"type_person_id\": 0,\n \"parent_id\": 2908,\n \"parent_name\": \"Cameras\",\n \"icon\": [\n {\n \"name\": \"Avid_Icon\",\n \"size\": 174285,\n \"alias\": \"7e73ab25155974c230d09494548201b9f5056ef\",\n \"extension\": \"png\",\n \"mime_type\": \"image/png\"\n }\n ]\n }\n ],\n \"access\": [\n {\n \"id\": 4,\n \"acl\": \"RW\",\n \"name\": \"Administrators\",\n \"type\": \"group\"\n }\n ],\n \"feed\": \"<string>\",\n \"working_week\": 3,\n \"country_region\": \"AU-NSW\",\n \"show_public_holiday\": true\n}"

response = http.request(request)
puts response.read_body
{
  "success": {
    "id": 1
  }
}
{
"error": {
"code": "404",
"message": "Requested resource was not found"
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Workspace object that needs to be added

Workspace model

name
string
required

Name of the workspace

Example:

"Sydney Studio"

id
integer

Automatically generated unique workspace id

Example:

9458

description
string

Additional info about the workspace

Example:

"Sydney Office, Level 2"

resources
Resource Summary Model · object[]

The resources that have been assigned to the workspace

access
User Group Access Summary · object[]

The users and groups who have been given access to the workspace

feed
string

iCalendar subscription feed URL (if enabled)

working_week
integer

Identifer of one of the following predefined working week templates. 0 = Monday -> Friday (Saturday / Sunday), 1 = Monday -> Saturday (Sunday), 2 = Saturday -> Thursday (Friday), 3 = Sunday -> Thursday (Friday / Saturday)

Example:

3

country_region
string

Identifier of the country / state that public holidays should be loaded for. Only required if show_public_holiday = true

Example:

"AU-NSW"

show_public_holiday
boolean

Should public holidays be loaded on the workspace

Example:

true

Response

Successful Operation

success
object