Delete Space

Deletes a Space.

MethodDELETE
URLhttps://{subdomain}.kintone.com/k/v1/space.json
URL(guest space)https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/space.json
Authentication Password Authentication , Session Authentication
Content-Typeapplication/json

Contents

Permissions

  • Only Space Administrators can use this API.

Request Parameters

Parameter Value Required Description
id Integer or String Yes The Space ID.

Sample Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
var body = {
  'id': 1001
};

kintone.api(kintone.api.url('/k/v1/space.json', true), 'DELETE', body, function(resp) {
  // success
  console.log(resp);
}, function(error) {
  // error
  console.log(error);
});

XMLHttpRequest

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var body = {
  'id': 1001,
  // CSRF TOKEN: used for all APIs that have an HTTP method of POST, PUT and DELETE on Kintone.
  '__REQUEST_TOKEN__': kintone.getRequestToken()
};

var url = 'https://{subdomain}.kintone.com/k/v1/space.json';
var xhr = new XMLHttpRequest();
xhr.open('DELETE', url);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onload = function() {
  if (xhr.status === 200) {
    // success
    console.log(JSON.parse(xhr.responseText));
  } else {
    // error
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send(JSON.stringify(body));

Response Parameters

An empty JSON object will be returned.

Sample Response

1
{}

Limitations

  • If the Space or Guest Space feature is turned off, an error will be returned.