Kepla API

Roles

Every user in your account must have a role. It defines the resources they have access to within the Kepla application. You can create as many custom roles as you need, and manage existing ones. Roles are identified by their ID and are referenced on the user resources.

Roles Overview

{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)
  "capabilities": {
  "capabilities": { ... }
Object

A capabilities object (see the definition).

    ":typeId": {
    ":typeId": { ... }
Object

The type ID to apply these capabilities to. Use a '*' wildcard inside this object to make all true.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createassignedActivities": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageTags": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true
Boolean
    },
    "default": {
    "default": { ... }
Object

These capabilities apply to the whole account, or to record types when no specific type capabilities have been defined.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createTasks": true,
Boolean
      "createTaxonomies": true,
Boolean
      "createTransactions": true,
Boolean
      "createTypes": true,
Boolean
      "createassignedActivities": true,
Boolean
      "createassignedTasks": true,
Boolean
      "createassignedTransactions": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteTasks": true,
Boolean
      "deleteTransactions": true,
Boolean
      "deleteTypes": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "deleteassignedTasks": true,
Boolean
      "deleteassignedTransactions": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageAccount": true,
Boolean
      "manageIntegrations": true,
Boolean
      "manageRelationships": true,
Boolean
      "manageRoles": true,
Boolean
      "manageTags": true,
Boolean
      "manageUsers": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readTasks": true,
Boolean
      "readTransactions": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "readassignedTasks": true,
Boolean
      "readassignedTransactions": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateTasks": true,
Boolean
      "updateTaxonomies": true,
Boolean
      "updateTransactions": true,
Boolean
      "updateTypes": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true,
Boolean
      "updateassignedTasks": true,
Boolean
      "updateassignedTransactions": true
Boolean
    }
  },
  "createdAt": "2016-07-17T22:44:35.748Z",
String (Date-time)
  "id": "6bc6a35b-0445-485d-b59e-54ec9ed9f581",
String
  "name": "My Custom Role",
String
  "system": "restricted"
String

System roles are created as defaults in Kepla. You can't set, modify or delete them.

}

List Roles

Open in API Explorer
GET /roles

Returns a list of all roles in the account and their capabilities.

Example Request

Format:
curl --request GET \
  --url https://api.kepla.com/v1/roles \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/roles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/roles",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("GET", "/v1/roles", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/roles",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "https://api.kepla.com/v1/roles"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}

Responses

200 Success

A list of all roles on the account

Roles List
[
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)
  "capabilities": {
  "capabilities": { ... }
Object

A capabilities object (see the definition).

    ":typeId": {
    ":typeId": { ... }
Object

The type ID to apply these capabilities to. Use a '*' wildcard inside this object to make all true.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createassignedActivities": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageTags": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true
Boolean
    },
    "default": {
    "default": { ... }
Object

These capabilities apply to the whole account, or to record types when no specific type capabilities have been defined.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createTasks": true,
Boolean
      "createTaxonomies": true,
Boolean
      "createTransactions": true,
Boolean
      "createTypes": true,
Boolean
      "createassignedActivities": true,
Boolean
      "createassignedTasks": true,
Boolean
      "createassignedTransactions": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteTasks": true,
Boolean
      "deleteTransactions": true,
Boolean
      "deleteTypes": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "deleteassignedTasks": true,
Boolean
      "deleteassignedTransactions": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageAccount": true,
Boolean
      "manageIntegrations": true,
Boolean
      "manageRelationships": true,
Boolean
      "manageRoles": true,
Boolean
      "manageTags": true,
Boolean
      "manageUsers": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readTasks": true,
Boolean
      "readTransactions": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "readassignedTasks": true,
Boolean
      "readassignedTransactions": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateTasks": true,
Boolean
      "updateTaxonomies": true,
Boolean
      "updateTransactions": true,
Boolean
      "updateTypes": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true,
Boolean
      "updateassignedTasks": true,
Boolean
      "updateassignedTransactions": true
Boolean
    }
  },
  "createdAt": "2016-07-17T22:44:35.748Z",
String (Date-time)
  "id": "6bc6a35b-0445-485d-b59e-54ec9ed9f581",
String
  "name": "My Custom Role",
String
  "system": "restricted"
String

System roles are created as defaults in Kepla. You can't set, modify or delete them.

]

Retrieve a Role

Open in API Explorer
GET /roles/:role

Retrieves the specified role object

Example Request

Format:
curl --request GET \
  --url https://api.kepla.com/v1/roles/:role \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/roles/:role")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/roles/:role",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("GET", "/v1/roles/:role", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/roles/:role",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "https://api.kepla.com/v1/roles/:role"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
role String (uuid) Required

The role ID to retrieve

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Responses

200 Success Roles Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)
  "capabilities": {
  "capabilities": { ... }
Object

A capabilities object (see the definition).

    ":typeId": {
    ":typeId": { ... }
Object

The type ID to apply these capabilities to. Use a '*' wildcard inside this object to make all true.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createassignedActivities": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageTags": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true
Boolean
    },
    "default": {
    "default": { ... }
Object

These capabilities apply to the whole account, or to record types when no specific type capabilities have been defined.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createTasks": true,
Boolean
      "createTaxonomies": true,
Boolean
      "createTransactions": true,
Boolean
      "createTypes": true,
Boolean
      "createassignedActivities": true,
Boolean
      "createassignedTasks": true,
Boolean
      "createassignedTransactions": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteTasks": true,
Boolean
      "deleteTransactions": true,
Boolean
      "deleteTypes": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "deleteassignedTasks": true,
Boolean
      "deleteassignedTransactions": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageAccount": true,
Boolean
      "manageIntegrations": true,
Boolean
      "manageRelationships": true,
Boolean
      "manageRoles": true,
Boolean
      "manageTags": true,
Boolean
      "manageUsers": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readTasks": true,
Boolean
      "readTransactions": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "readassignedTasks": true,
Boolean
      "readassignedTransactions": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateTasks": true,
Boolean
      "updateTaxonomies": true,
Boolean
      "updateTransactions": true,
Boolean
      "updateTypes": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true,
Boolean
      "updateassignedTasks": true,
Boolean
      "updateassignedTransactions": true
Boolean
    }
  },
  "createdAt": "2016-07-17T22:44:35.748Z",
String (Date-time)
  "id": "6bc6a35b-0445-485d-b59e-54ec9ed9f581",
String
  "name": "My Custom Role",
String
  "system": "restricted"
String

System roles are created as defaults in Kepla. You can't set, modify or delete them.

}

Create a Role

Open in API Explorer
POST /roles

Create a new custom role on the account

Example Request

Format:
curl --request POST \
  --url https://api.kepla.com/v1/roles \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"name":"My Custom Role","capabilities":{"default":{"*":true}}}'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/roles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'
request["content-type"] = 'application/json'
request.body = "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/roles",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ name: 'My Custom Role',
  capabilities: { default: { '*': true } } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

payload = "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}"

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE",
    'content-type': "application/json"
    }

conn.request("POST", "/v1/roles", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/roles",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE",
    "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/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/roles"

	payload := strings.NewReader("{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}")

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")
	req.Header.Add("content-type", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
payload Object Required
{
  "name": "My Custom Role",
String
  "capabilities": {
  "capabilities": { ... }
Object
    "default": {
    "default": { ... }
Object
      "*": true
Boolean
    }
  }
}

Responses

201 Success

A representation of the newly created role

Roles Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)
  "capabilities": {
  "capabilities": { ... }
Object

A capabilities object (see the definition).

    ":typeId": {
    ":typeId": { ... }
Object

The type ID to apply these capabilities to. Use a '*' wildcard inside this object to make all true.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createassignedActivities": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageTags": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true
Boolean
    },
    "default": {
    "default": { ... }
Object

These capabilities apply to the whole account, or to record types when no specific type capabilities have been defined.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createTasks": true,
Boolean
      "createTaxonomies": true,
Boolean
      "createTransactions": true,
Boolean
      "createTypes": true,
Boolean
      "createassignedActivities": true,
Boolean
      "createassignedTasks": true,
Boolean
      "createassignedTransactions": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteTasks": true,
Boolean
      "deleteTransactions": true,
Boolean
      "deleteTypes": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "deleteassignedTasks": true,
Boolean
      "deleteassignedTransactions": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageAccount": true,
Boolean
      "manageIntegrations": true,
Boolean
      "manageRelationships": true,
Boolean
      "manageRoles": true,
Boolean
      "manageTags": true,
Boolean
      "manageUsers": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readTasks": true,
Boolean
      "readTransactions": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "readassignedTasks": true,
Boolean
      "readassignedTransactions": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateTasks": true,
Boolean
      "updateTaxonomies": true,
Boolean
      "updateTransactions": true,
Boolean
      "updateTypes": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true,
Boolean
      "updateassignedTasks": true,
Boolean
      "updateassignedTransactions": true
Boolean
    }
  },
  "createdAt": "2016-07-17T22:44:35.748Z",
String (Date-time)
  "id": "6bc6a35b-0445-485d-b59e-54ec9ed9f581",
String
  "name": "My Custom Role",
String
  "system": "restricted"
String

System roles are created as defaults in Kepla. You can't set, modify or delete them.

}

Update a Role

Open in API Explorer
PUT /roles/:role

Updates the specified role by setting the values passed. The entire capabilities object will be replaced by the one provided, updating individual capabilities is not supported.

Example Request

Format:
curl --request PUT \
  --url https://api.kepla.com/v1/roles/:role \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"name":"My Custom Role","capabilities":{"default":{"*":true}}}'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/roles/:role")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'
request["content-type"] = 'application/json'
request.body = "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/roles/:role",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ name: 'My Custom Role',
  capabilities: { default: { '*': true } } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

payload = "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}"

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE",
    'content-type': "application/json"
    }

conn.request("PUT", "/v1/roles/:role", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/roles/:role",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE",
    "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/ioutil"
)

func main() {

	url := "https://api.kepla.com/v1/roles/:role"

	payload := strings.NewReader("{\"name\":\"My Custom Role\",\"capabilities\":{\"default\":{\"*\":true}}}")

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

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")
	req.Header.Add("content-type", "application/json")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
payload Object Required
{
  "name": "My Custom Role",
String
  "capabilities": {
  "capabilities": { ... }
Object
    "default": {
    "default": { ... }
Object
      "*": true
Boolean
    }
  }
}

Path Parameters

Name Type Required Description Example
role String (uuid) Required

The role ID to update

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Responses

201 Success Roles Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)
  "capabilities": {
  "capabilities": { ... }
Object

A capabilities object (see the definition).

    ":typeId": {
    ":typeId": { ... }
Object

The type ID to apply these capabilities to. Use a '*' wildcard inside this object to make all true.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createassignedActivities": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageTags": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true
Boolean
    },
    "default": {
    "default": { ... }
Object

These capabilities apply to the whole account, or to record types when no specific type capabilities have been defined.

      "createActivities": true,
Boolean
      "createLists": true,
Boolean
      "createRecords": true,
Boolean
      "createTasks": true,
Boolean
      "createTaxonomies": true,
Boolean
      "createTransactions": true,
Boolean
      "createTypes": true,
Boolean
      "createassignedActivities": true,
Boolean
      "createassignedTasks": true,
Boolean
      "createassignedTransactions": true,
Boolean
      "deleteActivities": true,
Boolean
      "deleteLists": true,
Boolean
      "deleteRecords": true,
Boolean
      "deleteTasks": true,
Boolean
      "deleteTransactions": true,
Boolean
      "deleteTypes": true,
Boolean
      "deleteassignedActivities": true,
Boolean
      "deleteassignedRecords": true,
Boolean
      "deleteassignedTasks": true,
Boolean
      "deleteassignedTransactions": true,
Boolean
      "exportRecords": true,
Boolean
      "importRecords": true,
Boolean
      "manageAccount": true,
Boolean
      "manageIntegrations": true,
Boolean
      "manageRelationships": true,
Boolean
      "manageRoles": true,
Boolean
      "manageTags": true,
Boolean
      "manageUsers": true,
Boolean
      "readActivities": true,
Boolean
      "readLists": true,
Boolean
      "readRecords": true,
Boolean
      "readTasks": true,
Boolean
      "readTransactions": true,
Boolean
      "readassignedActivities": true,
Boolean
      "readassignedRecords": true,
Boolean
      "readassignedTasks": true,
Boolean
      "readassignedTransactions": true,
Boolean
      "updateLists": true,
Boolean
      "updateRecords": true,
Boolean
      "updateTasks": true,
Boolean
      "updateTaxonomies": true,
Boolean
      "updateTransactions": true,
Boolean
      "updateTypes": true,
Boolean
      "updateassignedActivities": true,
Boolean
      "updateassignedRecords": true,
Boolean
      "updateassignedTasks": true,
Boolean
      "updateassignedTransactions": true
Boolean
    }
  },
  "createdAt": "2016-07-17T22:44:35.748Z",
String (Date-time)
  "id": "6bc6a35b-0445-485d-b59e-54ec9ed9f581",
String
  "name": "My Custom Role",
String
  "system": "restricted"
String

System roles are created as defaults in Kepla. You can't set, modify or delete them.

}

Delete a Role

Open in API Explorer
DELETE /roles/:role

Deletes the specified role and removes all the users associated with the role from the account.

Example Request

Format:
curl --request DELETE \
  --url https://api.kepla.com/v1/roles/:role \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/roles/:role")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/roles/:role",
  "headers": {
    "accept": "application/json",
    "authorization": "Bearer YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.kepla.com")

headers = {
    'accept': "application/json",
    'authorization': "Bearer YOUR API KEY HERE"
    }

conn.request("DELETE", "/v1/roles/:role", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.kepla.com/v1/roles/:role",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "authorization: Bearer YOUR API KEY HERE"
  ),
));

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

curl_close($curl);

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

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

func main() {

	url := "https://api.kepla.com/v1/roles/:role"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("authorization", "Bearer YOUR API KEY HERE")

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

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

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
fole String (uuid) Required

The role ID to delete.

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a

Responses

204 Success (Empty Response)