Introduction
Welcome to the Keystone Client API documentation. This API provides access to data stored in the Backbone through standard HTTP requests.
We have language bindings in cURL, JavaScript, PHP and C#! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/endpoint_goes_here/' \
--header 'Authorization: Bearer {token}'
Make sure to replace
{token}with your API token.
The Client API uses OAuth2 Bearer tokens for authorization, and expects all requests to include a token in the Authorization header like the following:
Authorization: Bearer {token}
POST Generating an API token
curl --location --request POST 'https://client-api.keystone-software.tech/oauth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"grant_type": "client_credentials",
"client_id": {id},
"client_secret": "{secret}",
"scope": "*"
}'
The above command returns JSON structured like this:
{
"token_type": "Bearer",
"expires_in": 31622400,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.
eyJhdWQiOiIxIiwianRpIjoiYzUzYTk2OTcxZTdjNzZlYWExMjI2NzA2MzRjYzc1ZGVlZTZkNjdiNmY4OTMzYWRiMDFkMGMzY
2U5NWZhMmQ0MjZkYzRiODYzZTM1YjYyODIiLCJpYXQiOjE1ODIwOTc5NTgsIm5iZiI6MTU4MjA5Nzk1OCwiZXhwIjoxNjEzNz
IwMzU4LCJzdWIiOiIxMyIsInNjb3BlcyI6W119.
nc1T8zdVzwo3bM_TCWYuK-Tvhr30lHxY-BIfHFg1V9Qf2klPlDlbmDTrjocZmeVhv7mNehgOeixsGkkiACYei2Xc2RtUfLLqk
haaTLvdMVmbQtIgn2XkxiGlHwbYvSODdwoFa_-x_20xMtXQdDlc0RwrbOOc3d5zv5basyePkE4hzyD5kInb6uEIy1eqd-tdbE
omEp04EAGHmSselcpCCAyH_5dIoySWnFSmawsUZWMgDszEu5Bz3OhdhdWBi1rwGJcV1i4dm1X4uUIJUdIYj3PxLETjgLMt9J6
XVyu5-tzMOq_3Ahkp11WppTU2wJl8bFSfXLIk8I9H_ZRlbbYT8efEWujmD2euhj00XebidpG-jL7Wen1ziehtjyY4htCd6BLl
CAHYc0D0OSjvTZHfOtlg7g8e33axceA-Du3U7HmK4B0tzZfiHWdpxXsuq8xLfLLJwUqZhZSxrZy6pPaEHkZ5aBe8soqeG-M6x
h_a8AZyIT40FmHa6fF1q8QZE5yiy1P8g4kSgPxsyTZmBM4MoavSfDYP915sJJXqkf5-cuheqX8CMQ5d1M17ZgwIFcQXpjXvNH
NsGUQeqvpoBSrZ6aKXtAD60fb636rdM39F4-DoHAYou37q9-cbNJCSLsvaYPVI8Lf9Z26byUxXWVoimq2zcDh1UtOardN34La
Ci2g"
}
The
"access_token"value is your API Bearer token. Use this in your Authorization header.
This endpoint generates an API token using the provided credentials. The generated token will be an OAuth Bearer token in JWT format.
HTTP Request
POST https://client-api.keystone-software.tech/oauth/token
Query Parameters
| Parameter | Description | Required |
|---|---|---|
| grant_type | Defines what type of authentication is used. Accepted value is the string client_credentials |
yes |
| client_id | Your API Client ID | yes |
| client_secret | Your API Client Secret. | yes |
| scope | Defines the scope of the token. Accepted value is * |
yes |
Schemas
These endpoints are used for fetching Schemas and schema data, such as a specific Type, in JSON format.
GET All schemas
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"message": "4 schemas found",
"schemas": [
{
"name": "D&W v2",
"uuid": "904c519b-39b5-59a1-8fa2-2f35317bb6cf"
},
{
"name": "Wells",
"uuid": "079e6997-8a47-5be5-9603-a627151ad822"
},
{
"name": "Rigs",
"uuid": "dfc45506-0200-5317-908e-f9398f36f1d1"
},
{
"name": "Areas",
"uuid": "fd3e6bab-da49-5629-bb4e-07f9173756f9"
}
]
}
This endpoint returns a list containing the names and UUIDs of all currently known schemas.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema
GET Information about a given schema
This code uses the Wells schema as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"name": "Wells",
"uuid": "079e6997-8a47-5be5-9603-a627151ad822",
"meta": {
"count": 1,
"current": "1.1"
},
"releases": [
{
"version": "1.1",
"uuid": "4d0a7a64-c3a8-5298-b2e6-c08556aa3691"
}
]
}
This endpoint returns both the metadata and a list of releases known for a given schema
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<UUID>
GET Metadata for a given schema
This code uses the Wells schema as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/meta' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"name": "Wells",
"uuid": "079e6997-8a47-5be5-9603-a627151ad822",
"meta": {
"count": 1,
"current": "1.1"
}
}
This endpoint returns only the metadata for a given schema
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<UUID>/meta
GET Release list for a given schema
This code uses the Wells schema as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/release' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"name": "Wells",
"uuid": "079e6997-8a47-5be5-9603-a627151ad822",
"releases": [
{
"version": "1.1",
"uuid": "4d0a7a64-c3a8-5298-b2e6-c08556aa3691"
}
]
}
This endpoint returns only the release list for a given schema
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<UUID>/release
GET A Schema Release
This code uses the Wells schema as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/release/4d0a7a64-c3a8-5298-b2e6-c08556aa3691' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"version": "1.1",
"uuid": "4d0a7a64-c3a8-5298-b2e6-c08556aa3691",
"meta": {
"types": 3,
"schemas": 0
},
"types": {
"28fa4fd0-b7cf-5b92-a7a2-41e52de20308": {
"name": "Wellbore",
"uuid": "28fa4fd0-b7cf-5b92-a7a2-41e52de20308",
"fields": {
"78272902-df99-5dc8-bcef-3828c3753e13": {
"name": "Universal Wellbore Identifier",
"uuid": "78272902-df99-5dc8-bcef-3828c3753e13",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1.1"
},
"parents": [
"6446d270-44fb-53a5-8d24-5be0e2fb7841"
],
"abstract": false,
"canonical": "wellbore",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
},
"6446d270-44fb-53a5-8d24-5be0e2fb7841": {
"name": "Well",
"uuid": "6446d270-44fb-53a5-8d24-5be0e2fb7841",
"fields": {
"5259b07f-c328-557e-950b-7c201ce1b160": {
"name": "Unique Well Identifier",
"uuid": "5259b07f-c328-557e-950b-7c201ce1b160",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1"
},
"parents": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
],
"abstract": false,
"canonical": "well",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
},
"f77ed44a-2c8c-506d-be52-fd67c177836e": {
"name": "Wells",
"uuid": "f77ed44a-2c8c-506d-be52-fd67c177836e",
"fields": {
"edbba81d-d342-58f4-bc4b-e96e4d44107a": {
"name": "Description",
"uuid": "edbba81d-d342-58f4-bc4b-e96e4d44107a",
"multi": false,
"value": null,
"static": false,
"canonical": "description",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
},
"fc971471-ec8d-5ec6-8488-bfcc1d5abe89": {
"name": "Name",
"uuid": "fc971471-ec8d-5ec6-8488-bfcc1d5abe89",
"multi": false,
"value": null,
"static": false,
"canonical": "name",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": [],
"parents": [
null
],
"abstract": false,
"canonical": "wells",
"interfaces": []
}
},
"schema": []
}
This endpoint returns both the release metadata, and the actual schema json for a given schema and release.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<Schema UUID>/release/<Release UUID>
GET A specific type from a Schema Release
This code uses the Wells schema and the Wellbore type as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/release/4d0a7a64-c3a8-5298-b2e6-c08556aa3691/type/wellbore' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"type": {
"name": "Wellbore",
"uuid": "28fa4fd0-b7cf-5b92-a7a2-41e52de20308",
"fields": {
"78272902-df99-5dc8-bcef-3828c3753e13": {
"name": "Universal Wellbore Identifier",
"uuid": "78272902-df99-5dc8-bcef-3828c3753e13",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1.1"
},
"parents": [
"6446d270-44fb-53a5-8d24-5be0e2fb7841"
],
"abstract": false,
"canonical": "wellbore",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
}
}
This endpoint returns a specific Type from the given schema release. The type may be specified either by UUID or Canonical ID.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<Schema UUID>/release/<Release UUID>/type/<Type UUID or Canonical>
GET All implementors of a specific Type
This code uses the Wells schema and the Well type as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/release/4d0a7a64-c3a8-5298-b2e6-c08556aa3691/type/well/implementors' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"type": {
"name": "Well",
"uuid": "6446d270-44fb-53a5-8d24-5be0e2fb7841",
"fields": {
"5259b07f-c328-557e-950b-7c201ce1b160": {
"name": "Unique Well Identifier",
"uuid": "5259b07f-c328-557e-950b-7c201ce1b160",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1"
},
"parents": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
],
"abstract": false,
"canonical": "well",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
},
"implementors": []
}
This endpoint returns a Type, along with a list of all types implementing it, from the given schema.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<Schema UUID>/release/<Release UUID>/type/<Type UUID or Canonical>/implementors
GET All permissible children of a specific Type
This code uses the Wells schema and the Well type as an example
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/079e6997-8a47-5be5-9603-a627151ad822/release/4d0a7a64-c3a8-5298-b2e6-c08556aa3691/type/well/children' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"type": {
"name": "Well",
"uuid": "6446d270-44fb-53a5-8d24-5be0e2fb7841",
"fields": {
"5259b07f-c328-557e-950b-7c201ce1b160": {
"name": "Unique Well Identifier",
"uuid": "5259b07f-c328-557e-950b-7c201ce1b160",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1"
},
"parents": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
],
"abstract": false,
"canonical": "well",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
},
"children": {
"28fa4fd0-b7cf-5b92-a7a2-41e52de20308": {
"name": "Wellbore",
"uuid": "28fa4fd0-b7cf-5b92-a7a2-41e52de20308",
"fields": {
"78272902-df99-5dc8-bcef-3828c3753e13": {
"name": "Universal Wellbore Identifier",
"uuid": "78272902-df99-5dc8-bcef-3828c3753e13",
"value": null,
"static": false,
"canonical": "uwi",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": [],
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": [],
"canonical": "constraints"
}
}
}
},
"values": {
"690d1d92-143d-5c32-a976-7f9e173bae3d": "L1.1"
},
"parents": [
"6446d270-44fb-53a5-8d24-5be0e2fb7841"
],
"abstract": false,
"canonical": "wellbore",
"interfaces": [
"f77ed44a-2c8c-506d-be52-fd67c177836e"
]
}
}
}
This endpoint returns a Type, along with a list of all types that have it as a permissible parent, from the given schema.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/schema/<Schema UUID>/release/<Release UUID>/type/<Type UUID or Canonical>/children
Repositories
These endpoints are used for fetching repositories containing one or more nodes.
GET All repositories
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"message": null,
"data": [
{
"uuid": "48118f74-e566-4fab-a677-1f3dbf539093",
"name": "Repository 1",
"schema": "7e876090-d558-5f35-953b-2c1addfe0607",
"root": {
"uuid": "71ce5d03-1832-49ae-ba79-a52edad4dd41",
"createdAt": 1581943939,
"updatedAt": 1581943939,
"deletedAt": null,
"type": {
"name": "Timeplan",
"uuid": "7ddc7d42-b78c-5f63-9691-2a774fa5eef7",
"fields": {
"46c927e2-cadc-5c31-8116-f7c826035dee": {
"name": "Field 1",
"uuid": "46c927e2-cadc-5c31-8116-f7c826035dee",
"value": null,
"static": false,
"canonical": "field_one",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": {},
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": {},
"canonical": "constraints"
}
}
},
"ef61dd50-ad2f-5b98-ae70-6448a6668ecc": {
"name": "Status",
"uuid": "ef61dd50-ad2f-5b98-ae70-6448a6668ecc",
"value": null,
"static": false,
"canonical": "status",
"valueType": "d5bd4c5e-74f2-5508-864a-fefd9c0e625d",
"valueUnit": "type",
"validators": {
"alerts": {
"name": "Alerts",
"rules": {},
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": {},
"canonical": "constraints"
}
}
}
},
"values": {},
"parents": [
null
],
"abstract": false,
"canonical": "timeplan",
"interfaces": [
"618baae7-46b1-5287-811a-6668369697ea",
"e501a4c4-2c14-5dbf-afde-be20e8da0e93"
]
},
"parent": null,
"values": {
"46c927e2-cadc-5c31-8116-f7c826035dee": null,
"ef61dd50-ad2f-5b98-ae70-6448a6668ecc": null
}
}
}
]
}
This endpoint returns a list of all currently active repositories, along with their root node, and its type (consolidated).
The consolidation of the root node type means that the type is included with all its data from the schema, such as all its fields, their names and default values, and any validators or constraints they may have.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/repo
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| root_type | String(UUID) | - | Filters list of returned repositories to only those whose root node matches this type |
| schema | String(UUID) | - | Filters list of returned repositories to only those using this schema |
| uuid | String(UUID) | - | Filters list of returned repositories to those who contain any element with a uuid property matching this parameter value |
| type | String(UUID) | - | Filters list of returned repositories to those who contain a node with a type property matching this UUID |
| descendants | String(Criterion) | - | Will add the property descendants to each of the returned repositories, which contains all nodes in the repository matching the provided Criterion. |
GET A specific repository
curl --location --request GET 'https://client-api.keystone-software.tech/api/v1/schema/{uuid}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}'
The above command returns JSON structured like this:
{
"success": true,
"message": null,
"data": {
"7350b2e2-4027-482c-8b0c-bca9bda48dd1": {
"uuid": "7350b2e2-4027-482c-8b0c-bca9bda48dd1",
"createdAt": 1582104215,
"updatedAt": 1582104215,
"deletedAt": null,
"type": "7ddc7d42-b78c-5f63-9691-2a774fa5eef7",
"parent": null,
"values": {}
}
}
}
{schema_json}will contain the entire schema in JSON format.
This endpoint will return a specified repository, along with a selection of its nodes based on the request parameters. If no parameters are provided, the response will contain only the root node of the repository, keyed to its UUID.
HTTP Request
GET https://client-api.keystone-software.tech/api/v1/repo/<UUID>
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| consolidate | Integer(boolean) or Array(String) | 0 | Which node properties to consolidate with schema and node information. If given as an array, the following entries set to "1" or "true" will control the consolidation of different node properties: "type" will expand the node's "type" property into the type object rather than its UUID. "fields" only works if the "type" is set and will expand each UUID of the "fields" property of an expanded type to a field object from the schema. "values" will expand any UUID in the "values" property into the object it refers to. "defaults" controls whether or not the default values from the type fields should be present in the node's "values" property. If the parameter is given as an integer = 1, all these consolidation entries are enabled. |
| meta | Integer(boolean) | 0 | If set to true, the response will provide the same metadata as consolidate in a much more condensed and size efficient way. With meta parameter all metadata related to the types in the repo will be provided in their own data entry. Here all types are listed once and can be used as a reference to the relevant entries in the repo. |
| recurse | Integer(boolean) or String(Criterion) | 0 | If set to true, the response will return nodes hierarchically, giving each node a children property containing any children it might have, and will recurse as deep as possible. If set to a Criterion, acts as if set to true, with the exception that the recursion will go no deeper when a node matching the Criterion is encountered. |
| node | String(Criterion) | - | If set to a node UUID, will define this node as the root node for the request. If set to a type Criterion, will run the request once per matching node as if node were set to their UUIDs and merge the result set. |
| filter | String(Criterion) | - | Filters the result set. Behavior will differ slightly depending on other parameters: If node is set to a type, request will be executed only for those nodes who match the filter as well as the type. If recurse is set, recursion will only go deeper when nodes match the filter. In other cases, the response will contain all descendants of the root node who match the filter, regardless of depth. |
| values | Integer with an optional operator prefix or a String value | - | Works much like filter, but filters on field values. Valid operators are >, <, = and ≠. |
| lineage | Integer(boolean) | 0 | Requires consolidate set to 1. Will append the property lineage to all nodes in the result set, containing the complete hierarchical path to this node, starting at and including the root node. |
| keyless | Integer(boolean) | 0 | If set to 1, will convert all UUID-keyed objects to numerically-indexed arrays. |
PATCH A specific repository
Update a specific node, and set the new value for field "description" to "My new description" using the following payload
[
{
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a92d",
"values": {
"e1b2ad9e-3519-58b7-acf2-218680f952bd": "My new description"
}
}
]
curl --location --request PATCH 'https://client-api.keystone-software.tech/api/v1/repo/{uuid}' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a92d",
"values": {
"e1b2ad9e-3519-58b7-acf2-218680f952bd": "My new description"
}
}
]'
This payload shows how to add a new child node with values. Note that the parent node must be defined by UUID, and the child must have a type specified.
[
{
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a92d",
"children": [
{
"type": "d7582b76-9343-5069-a1a3-99e784da052e",
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a11d",
"values": {
"e1b2ad9e-3519-58b7-acf2-218680f952bd": "My new event"
}
}
]
}
]
If the patch validates against the backbone, the response will look like this:
{
"success": true,
"message": "Commit posted to backbone, repository updated"
}
This endpoint will update a repository specified by an UUID based on the given payload. The payload should be formatted as an array of Nodes, though not keyed on UUID.
All UUIDs must be valid v4 UUIDs.
HTTP Request
PATCH https://client-api.keystone-software.tech/api/v1/repo/<UUID>
POST A new node to a specific repository
Example payload for adding a node. Parent and type must be specified by UUID, and the parent must already exist.
{
"parent": "8d156846-87ce-4609-aaba-bf3b7d77a92d",
"type": "d7582b76-9343-5069-a1a3-99e784da052e",
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a11d",
"values": {
"e1b2ad9e-3519-58b7-acf2-218680f952bd": "My new event"
}
}
curl --location --request POST 'https://client-api.keystone-software.tech/api/v1/repo/48118f74-e566-4fab-a677-1f3dbf539093' \
--header 'Content-Type: application/json' \
--data-raw '{
"parent": "8d156846-87ce-4609-aaba-bf3b7d77a92d",
"type": "d7582b76-9343-5069-a1a3-99e784da052e",
"uuid": "8d156846-87ce-4609-aaba-bf3b7d77a11d",
"values": {
"e1b2ad9e-3519-58b7-acf2-218680f952bd": "My new event"
}
}'
If the post validates against the backbone, the response will look like this:
{
"success": true,
"message": "Commit posted to backbone, repository updated"
}
This endpoint will create a new node to a specified repository, based on the attached payload.
All UUIDs must be valid v4 UUIDs.
HTTP Request
POST https://client-api.keystone-software.tech/api/v1/repo/<UUID>
Definitions
Schema
An example schema might look like this
{
"name": "TestSchema",
"uuid": "0f685cc8-b2dd-5180-b4b3-6840a978a136",
"types": {
"203d3848-f89c-565c-b5c7-ce200454d0ec": {
"name": "Child Type 1",
"uuid": "203d3848-f89c-565c-b5c7-ce200454d0ec",
"fields": {},
"values": {},
"parents": [
"26e74ea6-58d7-5cac-8f7c-ad4456815843"
],
"abstract": false,
"canonical": "ctype1",
"interfaces": [
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7"
]
},
"26e74ea6-58d7-5cac-8f7c-ad4456815843": {
"name": "RootType",
"uuid": "26e74ea6-58d7-5cac-8f7c-ad4456815843",
"fields": {},
"values": {},
"parents": [
null
],
"abstract": false,
"canonical": "root",
"interfaces": [
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7"
]
},
"2ce83c1c-7c59-5e15-91f4-a1c30fa824b1": {
"name": "Child Type 3",
"uuid": "2ce83c1c-7c59-5e15-91f4-a1c30fa824b1",
"fields": {},
"values": {},
"parents": [
"db5bcb0b-1d64-5ac9-a201-b471ae7ec741"
],
"abstract": false,
"canonical": "ctype3",
"interfaces": [
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7"
]
},
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7": {
"name": "InterfaceType",
"uuid": "8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7",
"fields": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": {
"name": "Text Field",
"uuid": "436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4",
"value": null,
"static": false,
"canonical": "tfield",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": {},
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": {},
"canonical": "constraints"
}
}
}
},
"values": {},
"parents": [],
"abstract": true,
"canonical": "itype",
"interfaces": []
},
"db5bcb0b-1d64-5ac9-a201-b471ae7ec741": {
"name": "Child Type 2",
"uuid": "db5bcb0b-1d64-5ac9-a201-b471ae7ec741",
"fields": {},
"values": {},
"parents": [
"203d3848-f89c-565c-b5c7-ce200454d0ec"
],
"abstract": false,
"canonical": "ctype2",
"interfaces": [
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7"
]
}
}
}
Schemas are used as the ruleset for creating and validating nodes stored in repositories, and consist of a collection of types in a JSON format.
Schemas are sometimes separated into Schema Releases, which are specific released versions of a given schema.
A node which validates to a given Schema Release might not validate against other releases of the same Schema, and a node which validates against a given Schema might not validate against any other Schema.
Type
An example abstract type with a text field
"8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7": {
"name": "InterfaceType",
"uuid": "8cd1b219-6f6b-5d83-a472-d1bb55cfb1d7",
"fields": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": {
"name": "Text Field",
"uuid": "436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4",
"value": null,
"static": false,
"canonical": "tfield",
"valueType": "text",
"valueUnit": null,
"validators": {
"alerts": {
"name": "Alerts",
"rules": {},
"canonical": "alerts"
},
"constraints": {
"name": "Constraints",
"rules": {},
"canonical": "constraints"
}
}
}
},
"values": {},
"parents": [],
"abstract": true,
"canonical": "itype",
"interfaces": []
},
A type mainly consists of a set of field definitions, definitions of any other types used as interfaces, and rules governing how this type may manifest as a node.
Particularly whether or not this is allowed at all, governed by the abstract property, and nodes of which type may be used as a parent for this type, governed by the parents property.
Repository
A simple repository with a few nodes of example types
{
"uuid": "c1d92def-5ee4-4a3f-a8ce-1185f1b5f32d",
"createdAt": 1581973978,
"updatedAt": 1582111722,
"deletedAt": null,
"type": "26e74ea6-58d7-5cac-8f7c-ad4456815843",
"parent": null,
"values": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": "root_node_field_value"
},
"children": {
"90f98f3a-ad6a-4451-a5fc-b581ba8c87d6": {
"uuid": "90f98f3a-ad6a-4451-a5fc-b581ba8c87d6",
"createdAt": 1581973978,
"updatedAt": 1582111722,
"deletedAt": null,
"type": "203d3848-f89c-565c-b5c7-ce200454d0ec",
"parent": "c1d92def-5ee4-4a3f-a8ce-1185f1b5f32d",
"values": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": "child_1_1_field_value"
},
"children": {
"465abfd5-1196-4a29-85d4-124ed4465842": {
"uuid": "465abfd5-1196-4a29-85d4-124ed4465842",
"createdAt": 1581973978,
"updatedAt": 1582111722,
"deletedAt": null,
"type": "db5bcb0b-1d64-5ac9-a201-b471ae7ec741",
"parent": "90f98f3a-ad6a-4451-a5fc-b581ba8c87d6",
"values": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": "child_2_field_value"
},
"children": {}
}
}
},
"9012c1f4-58aa-4bcb-ac21-ea0656a7e74c": {
"uuid": "9012c1f4-58aa-4bcb-ac21-ea0656a7e74c",
"createdAt": 1581973978,
"updatedAt": 1582111722,
"deletedAt": null,
"type": "203d3848-f89c-565c-b5c7-ce200454d0ec",
"parent": "c1d92def-5ee4-4a3f-a8ce-1185f1b5f32d",
"values": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": "child_1_2_field_value"
},
"children": {}
}
}
}
The term Repository as used in this documentation refers to a hierarchical collection of nodes defined by a single UUID and a name.
All repositories have a Root Node which is the topmost node in the hierarchy, and the only one that does not have a defined parent.
Node
A sample node from the above repository
"9012c1f4-58aa-4bcb-ac21-ea0656a7e74c": {
"uuid": "9012c1f4-58aa-4bcb-ac21-ea0656a7e74c",
"createdAt": 1581973978,
"updatedAt": 1582111722,
"deletedAt": null,
"type": "203d3848-f89c-565c-b5c7-ce200454d0ec",
"parent": "c1d92def-5ee4-4a3f-a8ce-1185f1b5f32d",
"values": {
"436814b1-31b2-5c17-8c0a-fdb7c8a9e3e4": "child_1_2_field_value"
},
"children": {}
}
Nodes are usually objects keyed on their UUID.
They contain properties defining their UUID, their type, their parent, their field values, and any child nodes they might have.
The values property contains any explicit field values this node has set, keyed on the field's UUID.
Canonical Name
This is a human-readable identifier for schema types.
Stored in the canonical property on types.
Criterion
Parameters that expect or accept a Criterion will accept any of the following:
- A specific node UUID
- A specific type UUID
- A canonical name matching a type
- Any of the above matching an interface of a node
- An array of any of these
UUID
The Client API uses version 4 UUIDs.