HTTP API

The API spec for using bedrock

poke: %create-path

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"create-path": {
"path":"/example",
"peers": [
{"ship":"~zod","role":"host"},
{"ship":"~bus","role":"member"}
]
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %edit-path

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"edit-path": {
"path": "/example",
"table-access": {
"realm-note": {
"host": {
"create": true,
"edit": "table",
"delete": "table"
},
"$": {
"create": true,
"edit": "table",
"delete": "table"
}
}
}
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %create-from-space

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"create-from-space": {
"path":"/space-example",
"space-path": "/~zod/spc1",
"space-role": "member"
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %remove-path

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "lopsyp-doztun",
"app": "bedrock",
"mark": "db-action",
"json": {
"remove-path": "/~lopsyp-doztun/cyberpunk/notes"
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %add-peer

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "db",
"mark": "db-action",
"json": {
"add-peer": {
"path":"/example",
"ship":"~fed",
"role":"member"
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %kick-peer

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "db",
"mark": "db-action",
"json": {
"kick-peer": {
"path":"/example",
"ship":"~fed"
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %create custom-type

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "db",
"mark": "db-action",
"json": {
"create": {
"path":"/example",
"type":"foo",
"v":0,
"data": [10, ["a","b","c"], ["a","a","b"],"/some/where",{"a":"b","c":"d"},"/~zod/~2023.6.1..15.28.13..a395"],
"schema": [
["num","ud"],
["strs","list"],
["set-strs","set"],
["mypath","path"],
["my-mapping","map"],
["parent-id","id"]
]
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %create vote:common

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"create": {
"path":"/example2",
"type":"vote",
"v":0,
"data": {
"up":true,
"ship":"~zod",
"parent-type":"foo",
"parent-id":"/~zod/~2023.5.26..15.49.39..c1ae",
"parent-path":"/example"
},
"schema": []
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %relay

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"relay": {
"path":"/target",
"type":"relay",
"v":0,
"data": {
"deleted":false,
"revision":0,
"protocol":"all",
"type":"foo",
"id":"/~zod/~2023.6.22..18.42.18..0a76",
"path":"/example"
},
"schema": []
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %edit

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"edit": {
"id": "/~zod/~2023.6.2..16.45.00..b0e8",
"input-row": {
"path":"/example2",
"type":"vote",
"v":0,
"data": {
"up":false,
"ship":"~zod",
"parent-type":"foo",
"parent-id":"/~zod/~2023.5.26..15.49.39..c1ae",
"parent-path":"/example"
},
"schema": []
}
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %remove

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"remove": {
"id": "/~zod/~2023.6.2..16.45.00..b0e8",
"path":"/example2",
"type":"vote"
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

poke: %remove-many

Method: PUT

{{URL}}/~/channel/123

Body (raw)

[
{
"id": 1,
"action": "poke",
"ship": "{{Ship}}",
"app": "bedrock",
"mark": "db-action",
"json": {
"remove-many": {
"ids": ["/~zod/~2023.7.25..20.54.56..dfdf","/~zod/~2023.7.25..20.54.57..a433"],
"path":"/private",
"type":"foo"
}
}
}
]
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

thread: %create custom-type

Method: POST

{{URL}}/spider/realm/db-action/venter/db-vent

Body (raw)

{
"create": {
"path":"/example",
"type":"foo",
"v":0,
"data": [10, ["a","b","c"], ["a","a","b"],"/some/where",{"a":"b","c":"d"},"/~zod/~2023.6.1..15.28.13..a395"],
"schema": [
["num","ud"],
["strs","list"],
["set-strs","set"],
["mypath","path"],
["my-mapping","map"],
["parent-id","id"]
]
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

thread: %create vote:common

Method: POST

{{URL}}/spider/realm/db-action/venter/db-vent

Body (raw)

{
"create": {
"path":"/example",
"type":"vote",
"v":0,
"data": {
"up":true,
"parent-type":"foo",
"parent-id":"/~zod/~2023.6.21..22.35.46..b3ef",
"parent-path":"/example"
},
"schema": []
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

thread: %create creds:common

Method: POST

{{URL}}/spider/realm/db-action/venter/db-vent

Body (raw)

{
"create": {
"path":"/private",
"type":"creds",
"v":0,
"data": {
"endpoint": "s3.us-east-1.amazonaws.com",
"access-key-id":"ASDFASDFASDFASDFASDF",
"secret-access-key":"asdfasdfasdfasdfasdfasdfasdf+w",
"buckets":["tolwer-mogmer-2"],
"current-bucket":"tolwer-mogmer-2",
"region":"us-east-1"
},
"schema": []
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

thread: %relay

Method: POST

{{URL}}/spider/realm/db-action/venter/db-ven

Body (raw)

{
"relay": {
"path": "/~lux/our",
"type": "relay",
"v": 0,
"data": {
"deleted": false,
"revision": 0,
"protocol": "all",
"type": "lexicon-word",
"id": "/~lux/~2023.6.22..22.41.39..dc98",
"path": "/~lux/randy"
},
"schema": []
}
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

scry: /db

Get all data from the db.

Method: GET

{{URL}}/~/scry/bedrock/db.json

Response

{
"data-tables": [
// all rows
],
"paths": [
// all paths (tables)
],
"peers": [
// all peers from all paths
],
"del-log": [
// all db delete-logs
],
"state-version": 0,
"schemas": [
{
"version": 0,
"schema": [
{
"name": "note_id",
"type": "t"
},
{
"name": "update",
"type": "t"
}
],
"type": "notes-updates"
},
{
"version": 0,
"schema": [],
"type": "creds"
},
{
"version": 0,
"schema": [
{
"name": "title",
"type": "t"
}
],
"type": "notes"
},
{
"version": 0,
"schema": [],
"type": "vote"
},
{
"version": 0,
"schema": [
{
"name": "note_id",
"type": "t"
},
{
"name": "note_edit",
"type": "t"
}
],
"type": "notes-edits"
}
]
}

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

scry: /db/start-ms/<milliseconds>

Gets changes since the timestamp provided.

Method: GET

{{URL}}/~/scry/bedrock/db/start-ms/1685391079544.json

Response

{
"data-tables": [
// all rows
],
"paths": [
// all paths (tables)
],
"peers": [
// all peers from all paths
],
"del-log": [
// all db delete-logs
],
"state-version": 0,
"schemas": [
{
"version": 0,
"schema": [
{
"name": "note_id",
"type": "t"
},
{
"name": "update",
"type": "t"
}
],
"type": "notes-updates"
},
{
"version": 0,
"schema": [],
"type": "creds"
},
{
"version": 0,
"schema": [
{
"name": "title",
"type": "t"
}
],
"type": "notes"
},
{
"version": 0,
"schema": [],
"type": "vote"
},
{
"version": 0,
"schema": [
{
"name": "note_id",
"type": "t"
},
{
"name": "note_edit",
"type": "t"
}
],
"type": "notes-edits"
}
]
}

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

scry: /db/path/

Method: GET

{{URL}}/~/scry/bedrock/db/path/~lomder-librun/realm-forerunners.json

Response

{
"dels": [
// the delete log for this path
{
"id": "/~pasbyr-losneb/~2023.8.3..19.42.57..e1ad",
"timestamp": 1691170586152,
"path": "/~lomder-librun/realm-forerunners",
"type": "notes",
"change": "del-row"
},
],
"path-row": {
"received-at": 1691510071092,
"updated-at": 1691510071092,
"default-access": {
"": {
"edit": "own",
"create": true,
"delete": "own"
},
"host": {
"edit": "table",
"create": true,
"delete": "table"
}
},
"constraints": null,
"host": "~lomder-librun",
"created-at": 1690568988035,
"path": "/~lomder-librun/realm-forerunners",
"replication": "host",
"table-access": {}
},
"peers": [
{
"role": "member",
"received-at": 1691058624001,
"updated-at": 1691058624001,
"ship": "~sampel-palnet",
"created-at": 1691058624001,
"path": "/~lomder-librun/realm-forerunners"
}
]
}

⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃

scry: /db/table/

Method: GET

{{URL}}/~/scry/bedrock/db/table/creds.json

Response

{
"rows": [
{
"received-at": 1691431946289,
"updated-at": 1691431946289,
"data": {
"buckets": [
"Images"
],
"current-bucket": "Images",
"secret-access-key": "<some-key>",
"endpoint": "https://sampel-palnet.sfo3.digitaloceanspaces.com",
"access-key-id": "<key-id>",
"region": "us-east-1"
},
"id": "/~lomder-librun/~2023.8.7..18.12.26..49e1",
"creator": "~lomder-librun",
"created-at": 1691431946289,
"path": "/private",
"type": "creds",
"v": 0
}
],
"type": "creds"
}
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃