Management

Spaces

A Space is a place for Mode users to gather reports related to a team, project, or common theme. An organization may have different types of Spaces depending on their Mode plan. Learn more about Spaces here.

You can use the spaces resource to manage and retrieve information about one or all Spaces in a given organization.

Space object

Properties

token

required

string

id

required

integer

space_type

required

string

name

required

string

description

required

string

state

required

string

restricted

required

boolean

free_default

required

string

_links

required

object

All resource responses contain a set of links that describe other related resources or actions that you can take on this resource. A link is comprised of two main pieces: its name (which describes its relationship to this resource) and its href (the URL of the related action or resource). All resources have at least a _self link which is the URL that will return a representation of this resource.

  • creator
  • detail
  • preview_space_memberships
  • reports
  • self
  • space_memberships
  • space_report_pins
  • user_space_membership
  • web
{
  "token": "f3gtgvfbghnm",
  "id": 45917678,
  "space_type": "dolore consectetur adipisicing cupidatat commodo",
  "name": "cillum Duis ex dolor anim",
  "description": "dolore officia incididunt reprehenderit",
  "state": "incididunt Duis in ex",
  "restricted": true,
  "free_default": "incididunt cillum id nulla ex",
  "_links": {
    "self": {
      "href": "est et cupidatat anim aliquip",
      "templated": false
    },
    "detail": {
      "href": "ad proident aute dolor velit",
      "templated": false
    },
    "reports": {
      "href": "dolor dolor",
      "templated": false
    },
    "creator": {
      "href": "adipisicing",
      "templated": false
    },
    "space_report_pins": {
      "href": "cillum ut i",
      "templated": false
    },
    "web": {
      "href": "adipisicing ut",
      "templated": false
    },
    "user_space_membership": {
      "href": "do est",
      "templated": false
    },
    "space_memberships": {
      "href": "tempor officia anim id",
      "templated": false
    },
    "preview_space_memberships": {
      "href": "mollit pariatur Duis consequat",
      "templated": false
    }
  },
  "_embedded": {}
}

Get a space

To retrieve information about a given Space, send a GET request to the Spaces resource along with a space_token.

Please note that you must have permission to view reports in the Space in question to receive a response. Learn more about levels of permission in Mode.

URL Params

organization

required
string Organization username

space

required
string Space token
Responses

200

Space response

401

Unauthorized

404

Space not found

GET /{organization}/spaces/{space}

curl --include \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://modeanalytics.com/api/{organization}/spaces/{space}'
require 'http'

username = 'you_api_key'
password = 'you_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .get('https://modeanalytics.com/api/{organization}/spaces/{space}')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://modeanalytics.com/api/{organization}/spaces/{space}', headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'GET',
  url: 'https://modeanalytics.com/api/{organization}/spaces/{space}',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  }}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

List spaces

To return a list representing all Spaces in an organization, send a GET request to the spaces resource.

Please note that this list will only include Spaces that are visible to you as the authorizing user, according to your level of permission in Mode. Learn more about levels of permission in Mode.

URL Params

organization

required
string Organization username
Responses

200

Space collection response

401

Unauthorized

404

Organization not found

GET /{organization}/spaces

curl --include \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://modeanalytics.com/api/{organization}/spaces'
require 'http'

username = 'you_api_key'
password = 'you_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .get('https://modeanalytics.com/api/{organization}/spaces')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://modeanalytics.com/api/{organization}/spaces', headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'GET',
  url: 'https://modeanalytics.com/api/{organization}/spaces',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  }}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

Create a space

To create a new Space, send a POST request to the spaces resource.

URL Params

organization

required
string Organization username
POST Body Params

Object: space

space_type

required
string The type of the space, the only option is custom

description

string Description of the space

name

required
string Name of the space
Responses

200

Space response

400

Bad request

401

Unauthorized

403

Forbidden

404

Account not found

POST /{organization}/spaces

curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
     --data-binary "{
  \"space\": {
    \"space_type\": \"Excepteur dolor officia ex\",
    \"name\": \"irure eiusmod labore\",
    \"description\": \"est reprehenderit ad ullamco\"
  }
}" \
'https://modeanalytics.com/api/{organization}/spaces'
require 'http'

values = {
  space: {
    space_type: 'Excepteur dolor officia ex',
    name: 'irure eiusmod labore',
    description: 'est reprehenderit ad ullamco'
  }
}

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .post('https://modeanalytics.com/api/{organization}/spaces', json: values)
puts response
from urllib2 import Request, urlopen

values = """
  {
    "space": {
      "space_type": "Excepteur dolor officia ex",
      "name": "irure eiusmod labore",
      "description": "est reprehenderit ad ullamco"
    }
  }
"""

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://modeanalytics.com/api/{organization}/spaces', data=values, headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'POST',
  url: 'https://modeanalytics.com/api/{organization}/spaces',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  },
  body: "{  \"space\": {    \"space_type\": \"Excepteur dolor officia ex\",    \"name\": \"irure eiusmod labore\",    \"description\": \"est reprehenderit ad ullamco\"  }}"
}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

Update a space

To update a Space, send a POST request to the spaces resource, specifying the Space token.

Please note that you must have permission to view and edit reports in the Space in question to receive a successful response. Learn more about levels of permission in Mode.

URL Params

organization

required
string Organization username

space

required
string Space token
POST Body Params

Object: space

space_type

required
string The type of the space, the only option is custom

description

string Description of the space

name

required
string Name of the space
Responses

200

Space response

400

Bad request

401

Unauthorized

403

Forbidden

404

Space not found

POST /{organization}/spaces/{space}

curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
     --data-binary "{
  \"space\": {
    \"space_type\": \"deserunt do\",
    \"name\": \"laborum qu\",
    \"description\": \"laboris null\"
  }
}" \
'https://modeanalytics.com/api/{organization}/spaces/{space}'
require 'http'

values = {
  space: {
    space_type: 'deserunt do',
    name: 'laborum qu',
    description: 'laboris null'
  }
}

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .post('https://modeanalytics.com/api/{organization}/spaces/{space}', json: values)
puts response
from urllib2 import Request, urlopen

values = """
  {
    "space": {
      "space_type": "deserunt do",
      "name": "laborum qu",
      "description": "laboris null"
    }
  }
"""

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://modeanalytics.com/api/{organization}/spaces/{space}', data=values, headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'POST',
  url: 'https://modeanalytics.com/api/{organization}/spaces/{space}',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  },
  body: "{  \"space\": {    \"space_type\": \"deserunt do\",    \"name\": \"laborum qu\",    \"description\": \"laboris null\"  }}"
}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});

Delete a space

To remove a Space from an organization, send a DELETE request to the spaces resource, specifying the space_token.

Please note that in order to remove a Space from an organization, all the reports (including archived ones) in that Space must be removed first.

URL Params

organization

required
string Organization username

space

required
string Space token
Responses

200

Space response

401

Unauthorized

404

Space not found

DELETE /{organization}/spaces/{space}

curl --include \
     --request DELETE \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://modeanalytics.com/api/{organization}/spaces/{space}'
require 'http'

username = 'you_api_key'
password = 'you_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .delete('https://modeanalytics.com/api/{organization}/spaces/{space}')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://modeanalytics.com/api/{organization}/spaces/{space}', headers=headers)
request.get_method = lambda: 'DELETE'

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'DELETE',
  url: 'https://modeanalytics.com/api/{organization}/spaces/{space}',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  }}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});