创建节点
POST /ontology/v1/nodes
Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type’s ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only; it does not give any agent a memory.
支持状态: supported
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| Idempotency-Key | header | string | true | Unique key for this write, at most 255 characters; resend the same key to replay the first result instead of writing twice. A missing or blank key is refused 400. |
请求体 (application/json)
必填: true
| 名称 | 类型 | 说明 |
|---|---|---|
| type | string | Registered node type name from types.list; an unregistered name is refused and nothing is written. |
| ref | string | Id of the mirrored record in the owning service, which must start with the type’s ref_prefix; omit or null for a concept with no external record. |
| name | string | Display name of the entity, at most 200 characters. |
| aliases | array<string> | Other names this entity is known by; they are matched by search alongside the name. |
| description | string | Profile of the entity, at most 500 characters; omit or null for none. |
| owner | string | Member id whose content this is, restricting it to that member; omit or null to make it readable organization-wide. |
{ "type": "object", "required": [ "type", "name" ], "description": "The entity to record; type must be registered and ref must match that type's prefix.", "properties": { "type": { "type": "string", "description": "Registered node type name from types.list; an unregistered name is refused and nothing is written.", "example": "customer" }, "ref": { "type": "string", "nullable": true, "description": "Id of the mirrored record in the owning service, which must start with the type's ref_prefix; omit or null for a concept with no external record.", "example": "cus_li" }, "name": { "type": "string", "maxLength": 200, "description": "Display name of the entity, at most 200 characters.", "example": "李总" }, "aliases": { "type": "array", "description": "Other names this entity is known by; they are matched by search alongside the name.", "items": { "type": "string", "example": "李总(华东)" }, "example": [] }, "description": { "type": "string", "maxLength": 500, "nullable": true, "description": "Profile of the entity, at most 500 characters; omit or null for none.", "example": "华东区的采购负责人。" }, "owner": { "type": "string", "nullable": true, "description": "Member id whose content this is, restricting it to that member; omit or null to make it readable organization-wide.", "example": "usr_wang" } }}响应
HTTP 201
The recorded node, with the id later reads, updates and relations use.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Node id, used by relations, merges and later reads; treat it as opaque and do not parse it. |
| type | string | Registered node type this entity was recorded as; it never changes after creation. |
| ref | string | Id of the mirrored record in the service that owns it, matching the type's ref_prefix; null for a concept with no external record. |
| name | string | Display name of the entity, at most 200 characters. |
| aliases | array<string> | Other names this entity is known by; they are matched by search alongside the name. |
| description | string | Profile of the entity, at most 500 characters; null when none was recorded. |
| owner | string | Member id whose content this is; null means it is readable organization-wide. Another member's node comes back restricted. |
| merged_into | string | When this node was merged into another, that survivor's id; reads of a merged node resolve to the survivor. |
| created_at | string | System time when the node was first recorded, in ISO 8601 UTC. |
| updated_at | string | System time of the last change to this node's content, in ISO 8601 UTC. |
| deleted_at | string | System time the mirrored record was deleted, when that is known; kept so history stays answerable. |