SmartMemory
POST
/memory/edge

Add a direct edge between two nodes in the graph.

This is a lower-level operation than link() - it creates a raw edge with custom properties. Use link() for standard memory linking.

Requires authentication and validates memory ownership with tenant isolation.

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The token is either a Clerk session JWT or a SmartMemory API key (prefix sm_live_, sm_test_, or legacy sk_).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/memory/edge" \  -H "Content-Type: application/json" \  -d '{    "source_id": "string",    "target_id": "string",    "relation_type": "string"  }'
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}