SynapSynapDocs
Hub REST API

Relations

The Relations operations of the Hub REST API (3 operations).

For BuildersOpen-source podSynap CloudGenerated from Synap-core/backend@c31e261ab (main)

List relations

GET
/relations

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Query Parameters

userId*string
workspaceId*string
entityId?string

Filter to relations involving this entity (either side).

type?string

Filter by relation type.

Response Body

Array of relations

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://pod.example.com/api/hub/relations?userId=string&workspaceId=string'
Example Response
[  {    "id": "string",    "userId": "string",    "workspaceId": "string",    "sourceEntityId": "string",    "targetEntityId": "string",    "type": "string",    "metadata": {      "property1": null,      "property2": null    },    "createdAt": "string"  }]

Create a relation

POST
/relations

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Request Body

application/json
  1. body
userId*string
workspaceId*string
sourceEntityId*string
targetEntityId*string
type*string

Relation type identifier (e.g. parent_of, references).

metadata?
agentUserId?string
reasoning?string
sourceMessageId?string

Response Body

Created relation

application/json
  1. response
id*string
userId*string
workspaceId?string|null
sourceEntityId*string
targetEntityId*string
type*string
metadata?
createdAt?string|
Example Request
curl -X POST 'https://pod.example.com/api/hub/relations' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string",  "workspaceId": "string",  "sourceEntityId": "string",  "targetEntityId": "string",  "type": "string"}'
Example Response
{  "id": "string",  "userId": "string",  "workspaceId": "string",  "sourceEntityId": "string",  "targetEntityId": "string",  "type": "string",  "metadata": {    "property1": null,    "property2": null  },  "createdAt": "string"}

Delete a relation

DELETE
/relations/{relationId}

Authorization

bearerAuth
headerAuthorizationBearer <API key>

Pod API key (Bearer) issued via /api/hub/setup/agent or pod admin tooling. Browser/web clients may use the X-Session-Token header instead. See GET /api/hub/auth/status to introspect the calling key.

Path Parameters

relationId*string

Request Body

application/json
  1. body
userId?string
workspaceId?string
agentUserId?string
reasoning?string
sourceMessageId?string

Response Body

Deletion result

application/json
  1. response
ok*boolean
[key: string]?unknown
Example Request
curl -X DELETE 'https://pod.example.com/api/hub/relations/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "ok": true,  "property1": null,  "property2": null}