---
title: "Create Relationship"
method: POST
path: "/api/knowledge-graph/relationships"
tags: ["knowledge-graph", "knowledge-graph"]
---

# Create Relationship

`POST /api/knowledge-graph/relationships`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/knowledge-graph/relationships`
- Auth: none declared

Create a relationship between two entities.

## Request body

- RelationshipCreateRequest: Request to create a relationship.
  - `source_entity_id` integer, required
  - `target_entity_id` integer, required
  - `relation_type` string, required: Relationship type
  - `properties` object, nullable

## Response `200`

Successful Response

- RelationshipResponse: Relationship response model.
  - `id` integer, required
  - `source_entity_id` integer, required
  - `source_entity_name` string, nullable
  - `target_entity_id` integer, required
  - `target_entity_name` string, nullable
  - `relation_type` string, required
  - `strength` number
  - `count` integer
  - `first_at` string, date-time, nullable
  - `last_at` string, date-time, nullable
  - `properties` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
