Kepla API

Types

Types bring together most of the data in Kepla. Every record you create will live within a type, along with fields, tags, lists and search. You can create, update and delete types through the API though should be careful with any changes as it will often delete data. Types are identified by their ID.

Types Overview

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

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}
{
  "description": "Some help text",
String

Help text on the field.

  "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

  "label": "Full Name",
String

The human-readable name for the field.

  "options": {
  "options": { ... }
Object
    "items": "foo",
String
    ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

  },
  "order": 1,
Integer
  "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

  "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

  "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

}

List Types

Open in API Explorer
GET /types

Returns a list of all types on the account.

Example Request

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

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

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/types",
  "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/types", 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/types",
  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/types"

	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 Types List
[
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
]

Retrieve a Field

Open in API Explorer
GET /types/:type/fields/:field

Retrieves the specified field object from the type.

Example Request

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

url = URI("https://api.kepla.com/v1/types/:type/fields/:field")

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/types/:type/fields/:field",
  "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/types/:type/fields/:field", 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/types/:type/fields/:field",
  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/types/:type/fields/:field"

	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
type String (uuid) Required

Type ID the field is registered to.

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
field String Required

The field ID to retrieve

foo

Responses

200 Success Types Field
{
  "description": "Some help text",
String

Help text on the field.

  "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

  "label": "Full Name",
String

The human-readable name for the field.

  "options": {
  "options": { ... }
Object
    "items": "foo",
String
    ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

  },
  "order": 1,
Integer
  "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

  "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

  "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

}

Retrieve a Type

Open in API Explorer
GET /types/:type

Retrieves the specified type object.

Example Request

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

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

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/types/:type",
  "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/types/:type", 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/types/:type",
  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/types/:type"

	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
type String (uuid) Required

The type ID to retrieve

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

Responses

200 Success Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}

Create a Type

Open in API Explorer
POST /types

Create a new record type with the supplied name.

Example Request

Format:
curl --request POST \
  --url https://api.kepla.com/v1/types \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"name":"My API Type"}'
require 'uri'
require 'net/http'

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

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 API Type\"}"

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

var options = {
  "method": "POST",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/types",
  "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 API Type' }));
req.end();
import http.client

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

payload = "{\"name\":\"My API Type\"}"

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

conn.request("POST", "/v1/types", 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/types",
  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 API Type\"}",
  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/types"

	payload := strings.NewReader("{\"name\":\"My API Type\"}")

	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 API Type"
String

A human-readable name for the type.

}

Responses

201 Success

The example here shows a full type object, for a new type you won't have any tags, lists or fields.

Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}

Create a Field

Open in API Explorer
POST /types/:type/fields

Create a new field on the specified type.

Example Request

Format:
curl --request POST \
  --url https://api.kepla.com/v1/types/:type/fields \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"label":"Example Field","description":"An example description","type":"text","parent":"false","options":{":key":"Small"},"order":42}'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/types/:type/fields")

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 = "{\"label\":\"Example Field\",\"description\":\"An example description\",\"type\":\"text\",\"parent\":\"false\",\"options\":{\":key\":\"Small\"},\"order\":42}"

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

var options = {
  "method": "POST",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/types/:type/fields",
  "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({ label: 'Example Field',
  description: 'An example description',
  type: 'text',
  parent: 'false',
  options: { ':key': 'Small' },
  order: 42 }));
req.end();
import http.client

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

payload = "{\"label\":\"Example Field\",\"description\":\"An example description\",\"type\":\"text\",\"parent\":\"false\",\"options\":{\":key\":\"Small\"},\"order\":42}"

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

conn.request("POST", "/v1/types/:type/fields", 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/types/:type/fields",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"label\":\"Example Field\",\"description\":\"An example description\",\"type\":\"text\",\"parent\":\"false\",\"options\":{\":key\":\"Small\"},\"order\":42}",
  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/types/:type/fields"

	payload := strings.NewReader("{\"label\":\"Example Field\",\"description\":\"An example description\",\"type\":\"text\",\"parent\":\"false\",\"options\":{\":key\":\"Small\"},\"order\":42}")

	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))

}

Path Parameters

Name Type Required Description Example
type String (uuid) Required

The type ID to create the field on

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

Request Body

Name Type Required Description Example
payload Object Required
{
  "label": "Example Field",
String

A human-readable name for the field.

  "description": "An example description",
String

A description shown to users about what the field is for.

  "type": "text",
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

  "parent": "false",
String

A field ID or false. If a field ID is provided this field will appear under it in the client.

  "options": {
  "options": { ... }
Object

A list of options for the field (shown if it is a select field).

    ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

  },
  "order": 42
Integer

The order to display this field in relation to others. Lower numbers show first.

}

Responses

201 Success Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}
400 Invalid Field Types Invalid field
{
  "name": "BadRequestError",
String
  "message": "Invalid field",
String
  "status": 400
Integer
}

Update a Field

Open in API Explorer
PUT /types/:type/fields/:field

Updates the specified field with the provided data.

Example Request

Format:
curl --request PUT \
  --url https://api.kepla.com/v1/types/:type/fields/:field \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"description":"Some help text","id":"4kblhjBOe","label":"Full Name","options":{":key":"Small"},"order":1,"parent":"false","processAs":"name","type":"text"}'
require 'uri'
require 'net/http'

url = URI("https://api.kepla.com/v1/types/:type/fields/:field")

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 = "{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}"

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

var options = {
  "method": "PUT",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/types/:type/fields/:field",
  "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({ description: 'Some help text',
  id: '4kblhjBOe',
  label: 'Full Name',
  options: { ':key': 'Small' },
  order: 1,
  parent: 'false',
  processAs: 'name',
  type: 'text' }));
req.end();
import http.client

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

payload = "{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}"

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

conn.request("PUT", "/v1/types/:type/fields/:field", 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/types/:type/fields/:field",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}",
  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/types/:type/fields/:field"

	payload := strings.NewReader("{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}")

	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))

}

Path Parameters

Name Type Required Description Example
type String (uuid) Required

Type ID the field is registered to

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
field String Required

The field ID to update

foo

Request Body

Name Type Required Description Example
payload Object Required
{
  "description": "Some help text",
String

Help text on the field.

  "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

  "label": "Full Name",
String

The human-readable name for the field.

  "options": {
  "options": { ... }
Object
    "items": "foo",
String
    ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

  },
  "order": 1,
Integer
  "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

  "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

  "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

}

Responses

200 Success Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}

Update a Type

Open in API Explorer
PUT /types/:type

Updates the specified type with the supplied data. Use this endpoint carefully.

Example Request

Format:
curl --request PUT \
  --url https://api.kepla.com/v1/types/:type \
  --header 'accept: application/json' \
  --header 'authorization: Bearer YOUR API KEY HERE' \
  --header 'content-type: application/json' \
  --data '{"name":"My API Update","primaryField":"76chdeu6","fields":[{"description":"Some help text","id":"4kblhjBOe","label":"Full Name","options":{":key":"Small"},"order":1,"parent":"false","processAs":"name","type":"text"}]}'
require 'uri'
require 'net/http'

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

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 API Update\",\"primaryField\":\"76chdeu6\",\"fields\":[{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}]}"

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

var options = {
  "method": "PUT",
  "hostname": "api.kepla.com",
  "port": null,
  "path": "/v1/types/:type",
  "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 API Update',
  primaryField: '76chdeu6',
  fields: 
   [ { description: 'Some help text',
       id: '4kblhjBOe',
       label: 'Full Name',
       options: { ':key': 'Small' },
       order: 1,
       parent: 'false',
       processAs: 'name',
       type: 'text' } ] }));
req.end();
import http.client

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

payload = "{\"name\":\"My API Update\",\"primaryField\":\"76chdeu6\",\"fields\":[{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}]}"

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

conn.request("PUT", "/v1/types/:type", 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/types/:type",
  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 API Update\",\"primaryField\":\"76chdeu6\",\"fields\":[{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}]}",
  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/types/:type"

	payload := strings.NewReader("{\"name\":\"My API Update\",\"primaryField\":\"76chdeu6\",\"fields\":[{\"description\":\"Some help text\",\"id\":\"4kblhjBOe\",\"label\":\"Full Name\",\"options\":{\":key\":\"Small\"},\"order\":1,\"parent\":\"false\",\"processAs\":\"name\",\"type\":\"text\"}]}")

	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))

}

Path Parameters

Name Type Required Description Example
type String (uuid) Required

The type ID to update

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

Request Body

Name Type Required Description Example
payload Object Required
{
  "name": "My API Update",
String

The human-readable name for the type

  "primaryField": "76chdeu6",
String

The field ID to deduplicate records on. Set to null for no deduping.

  fields: [
Array

A complete fields object. This will completely replace the existing object on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
}

Responses

200 Success Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}

Delete a Type

Open in API Explorer
DELETE /types/:type

Deletes the specified type, all its records, transactions, tags and activity. This is a very destructive endpoint.

Example Request

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

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

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/types/:type",
  "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/types/:type", 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/types/:type",
  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/types/:type"

	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
type String (uuid) Required

The type ID to delete

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

Responses

204 Success (Empty Response)

Delete a Field

Open in API Explorer
DELETE /types/:type/fields/:field

Deletes the specified field and any children from the type. You will lose access to any data stored in this field.

Example Request

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

url = URI("https://api.kepla.com/v1/types/:type/fields/:field")

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/types/:type/fields/:field",
  "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/types/:type/fields/:field", 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/types/:type/fields/:field",
  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/types/:type/fields/:field"

	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
type String (uuid) Required

Type ID the field is registered to

04fe9a97-a579-43c5-bb1a-58ed29bf0a6a
field String Required

The field ID to delete

foo

Responses

200 Success Types Default
{
  "accountId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Your account ID.

  fields: [
Array

An object containing all the registered fields on the type.

    {
    { ... }
Object

Field

      "description": "Some help text",
String

Help text on the field.

      "id": "4kblhjBOe",
String

The unique field ID. Data is stored under this ID in a record.

      "label": "Full Name",
String

The human-readable name for the field.

      "options": {
      "options": { ... }
Object
        "items": "foo",
String
        ":key": "Small"
String

An arbitary key (mostly used for ordering) with a possible value.

      },
      "order": 1,
Integer
      "parent": "false",
String

Parent can be set to false or a field ID. If a field ID is set the field will appear in that group on record pages in the client.

      "processAs": "name",
String

Used to process "fancy fields". On groups it can be name or address. On subfields it can be firstName, lastName, address1, address2, city, postalcode, region and country.

      "type": "text"
String

The field type. Can be text, textfield, email, number, select, checkbox, group or date. Once a field is set, it's best not to change the type.

    }
  ]
  "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

Read only. The unique type ID

  lists: [
Array
    {
    { ... }
Object

Type > List

      "conditions": "[[{\"$$hashKey\":\"object:3172\",\"target\":\"fields:NJTg3sr_e\",\"operator\":\"exist\",\"value\":null}]]",
String

A JSON object of list conditions generated by the client. Lists aren't documented as they're really just client config, you can achieve the same result through the API using custom Elasticsearch queries.

      "id": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a",
String (Uuid)

The list ID

      "name": "Example List",
String

A human-readable name for the list

      "typeId": "04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
String (Uuid)

Related type ID for the list

    }
  ]
  "name": "People",
String

The human-readable name for the type.

  "primaryField": "foo",
String

The key to deduplicate records on, or null/false for no deduping.

  tags: [
Array

A copy of all the tags registered on the type.

    {
    { ... }
Object

List

      "items": {
      "items": { ... }
Object
        "color": "#f4983c",
String

(Optional) A HEX code for the color of the tag in the app.

        "id": "a99cfd2a-829c-483d-8c4f-2c8627c027a4",
String (Uuid)
        "name": "api tag",
String

Friendly name for the tag in the app and in exports

        "typeId": "a387d549-2ebd-47f8-a8e3-b54a1d1d6d04"
String (Uuid)
      }
    }
  ]
}