Relationships
Entity relationship management
Add relationship between entities
Authorization
bearerAuth Supabase JWT token
In: header
Request Body
application/json
Optional note describing this change
Source entity ID
^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$Target entity ID
^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$Predicate on source entity pointing to target
^[a-z][a-z0-9_]*$1 <= length <= 50Predicate on target entity pointing to source. If provided, creates bidirectional relationship.
^[a-z][a-z0-9_]*$1 <= length <= 50Expected current tip CID of source entity
1 <= lengthExpected current tip CID of target entity. Required for bidirectional relationships if target is protected.
1 <= lengthResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://arke-v1.arke.institute/relationships" \ -H "Content-Type: application/json" \ -d '{ "source_id": "01JFKY3XQWM0MJVKM8DK3AEXPY", "target_id": "01JFKY3XQWM0MJVKM8DK3AEXQZ", "source_predicate": "collection", "expect_source_tip": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy" }'{
"source": {
"id": "01KDETYWYWM0MJVKM8DK3AEXPY",
"cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"type": "collection",
"properties": {
"label": "The Pequod's Archive",
"description": "A collection of whaling documents"
},
"relationships": [
{
"predicate": "crew",
"peer": "01KDETYWYWM0MJVKM8DK3AEXPY",
"peer_type": "collection"
}
],
"ver": 1,
"created_at": "2025-12-26T12:00:00.000Z",
"ts": 1735214400000,
"edited_by": {
"user_id": "01JCAPTAINAHAB000000000000",
"user_label": "Captain Ahab",
"method": "manual"
},
"prev_cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
},
"target": {
"id": "01KDETYWYWM0MJVKM8DK3AEXPY",
"cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"type": "collection",
"properties": {
"label": "The Pequod's Archive",
"description": "A collection of whaling documents"
},
"relationships": [
{
"predicate": "crew",
"peer": "01KDETYWYWM0MJVKM8DK3AEXPY",
"peer_type": "collection"
}
],
"ver": 1,
"created_at": "2025-12-26T12:00:00.000Z",
"ts": 1735214400000,
"edited_by": {
"user_id": "01JCAPTAINAHAB000000000000",
"user_label": "Captain Ahab",
"method": "manual"
},
"prev_cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
}
}{
"error": "Validation failed",
"details": {
"issues": [
{
"path": [
"properties",
"label"
],
"message": "Required"
}
]
}
}{
"error": "Unauthorized: Missing or invalid authentication token"
}{
"error": "Forbidden: You do not have permission to perform this action"
}{
"error": "Entity not found"
}{
"error": "Conflict: entity was modified",
"details": {
"expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
}
}Remove relationship between entities
Authorization
bearerAuth Supabase JWT token
In: header
Request Body
application/json
Optional note describing this change
Source entity ID
^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$Target entity ID (peer of the relationship to remove)
^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$Predicate on source entity to remove
^[a-z][a-z0-9_]*$1 <= length <= 50Predicate on target entity to remove. If provided, removes bidirectional relationship.
^[a-z][a-z0-9_]*$1 <= length <= 50Expected current tip CID of source entity
1 <= lengthExpected current tip CID of target entity. Required for bidirectional relationships.
1 <= lengthResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://arke-v1.arke.institute/relationships" \ -H "Content-Type: application/json" \ -d '{ "source_id": "01JFKY3XQWM0MJVKM8DK3AEXPY", "target_id": "01JFKY3XQWM0MJVKM8DK3AEXQZ", "source_predicate": "collection", "expect_source_tip": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy" }'{
"source": {
"id": "01KDETYWYWM0MJVKM8DK3AEXPY",
"cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"type": "collection",
"properties": {
"label": "The Pequod's Archive",
"description": "A collection of whaling documents"
},
"relationships": [
{
"predicate": "crew",
"peer": "01KDETYWYWM0MJVKM8DK3AEXPY",
"peer_type": "collection"
}
],
"ver": 1,
"created_at": "2025-12-26T12:00:00.000Z",
"ts": 1735214400000,
"edited_by": {
"user_id": "01JCAPTAINAHAB000000000000",
"user_label": "Captain Ahab",
"method": "manual"
},
"prev_cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
},
"target": {
"id": "01KDETYWYWM0MJVKM8DK3AEXPY",
"cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"type": "collection",
"properties": {
"label": "The Pequod's Archive",
"description": "A collection of whaling documents"
},
"relationships": [
{
"predicate": "crew",
"peer": "01KDETYWYWM0MJVKM8DK3AEXPY",
"peer_type": "collection"
}
],
"ver": 1,
"created_at": "2025-12-26T12:00:00.000Z",
"ts": 1735214400000,
"edited_by": {
"user_id": "01JCAPTAINAHAB000000000000",
"user_label": "Captain Ahab",
"method": "manual"
},
"prev_cid": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
}
}{
"error": "Validation failed",
"details": {
"issues": [
{
"path": [
"properties",
"label"
],
"message": "Required"
}
]
}
}{
"error": "Unauthorized: Missing or invalid authentication token"
}{
"error": "Forbidden: You do not have permission to perform this action"
}{
"error": "Entity not found"
}{
"error": "Conflict: entity was modified",
"details": {
"expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
"actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
}
}