Arke
ReferenceAPI Reference

Relationships

Entity relationship management

Add relationship between entities

POST
/relationships

Authorization

bearerAuth
AuthorizationBearer <token>

Supabase JWT token

In: header

Request Body

application/json

note?string

Optional note describing this change

source_id*string

Source entity ID

Match^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$
target_id*string

Target entity ID

Match^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$
source_predicate*string

Predicate on source entity pointing to target

Match^[a-z][a-z0-9_]*$
Length1 <= length <= 50
target_predicate?string

Predicate on target entity pointing to source. If provided, creates bidirectional relationship.

Match^[a-z][a-z0-9_]*$
Length1 <= length <= 50
expect_source_tip*string

Expected current tip CID of source entity

Length1 <= length
expect_target_tip?string

Expected current tip CID of target entity. Required for bidirectional relationships if target is protected.

Length1 <= length

Response 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

DELETE
/relationships

Authorization

bearerAuth
AuthorizationBearer <token>

Supabase JWT token

In: header

Request Body

application/json

note?string

Optional note describing this change

source_id*string

Source entity ID

Match^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$
target_id*string

Target entity ID (peer of the relationship to remove)

Match^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$
source_predicate*string

Predicate on source entity to remove

Match^[a-z][a-z0-9_]*$
Length1 <= length <= 50
target_predicate?string

Predicate on target entity to remove. If provided, removes bidirectional relationship.

Match^[a-z][a-z0-9_]*$
Length1 <= length <= 50
expect_source_tip*string

Expected current tip CID of source entity

Length1 <= length
expect_target_tip?string

Expected current tip CID of target entity. Required for bidirectional relationships.

Length1 <= length

Response 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"
  }
}