SnozeDevelopers
API referenceDatabases

Update a relation's label and delete behavior

Renames the link and changes its `onDelete` behavior; the two ends, their fields and their cardinalities are immutable. Requires the `databases:write` permission on both databases the relation joins, and responds with not-found when the relation has no end on the database in the path. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.

PATCH
/v1/workspaces/{workspaceId}/databases/{databaseId}/relations/{relationId}
AuthorizationBearer <token>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

In: header

Path Parameters

workspaceId*string
databaseId*string
relationId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/workspaces/string/databases/string/relations/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "id": "string",    "workspaceId": "string",    "label": "string",    "fromDatabaseId": "string",    "fromFieldId": "string",    "fromCardinality": "one",    "toDatabaseId": "string",    "toFieldId": "string",    "toCardinality": "one",    "onDelete": "detach",    "createdAt": "string",    "updatedAt": "string"  }}