Relaciones
Use el endpoint de Relaciones para consultar las relaciones entre entidades de Violet.
Usa el violet-relationships endpoint para consultar las relaciones entre entidades. Recomendamos usar el explore endpoint para identificar el sourceID para la entidad o entidades que te interesan, luego el violet-relationships endpoint para crear estructuras como líneas de pedido de compra que pertenecen a una orden de compra, o piezas que pertenecen a un ensamblaje.
Get all Violet Relationships, or relationship graph from a source entity. When sourceId is provided, returns a graph (entityNodes, requirementNodes, links) for traversal: Assembly → BOM → Parts, Part/BOM line → PO line → PO, PO ↔ Invoice ↔ Bill, PO/line → receipts/delivery. Use recursiveRelationshipTypes / nonRecursiveRelationshipTypes to restrict traversal; see GET /model for types.
Violet entity ID to start graph traversal from. If omitted, returns all relationships.
Comma-separated relationship types to follow recursively (e.g. assemblyContains,contains for BOM; containsPOLine,receipts,linkedTo for PO/delivery/3-way match). See GET /model for all types.
assemblyContains,containsComma-separated relationship types to include only one level.
containsWhen sourceId is omitted, cursor for keyset pagination: relationship id from the last item of the previous response. Omit for the first page. Ignored when sourceId is provided.
When sourceId is omitted, max readable relationships per page (default 100, max 500). Ignored when sourceId is provided.
100Without sourceId: array of relationships (paginated). With sourceId: graph of nodes and links.
GET /api/violet-relationships HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Without sourceId: array of relationships (paginated). With sourceId: graph of nodes and links.
{
"entityNodes": [
{
"id": "text"
}
],
"requirementNodes": [
{
"id": "text"
}
],
"links": [
{
"id": "text",
"sourceId": "text",
"targetId": "text",
"metadata": {},
"relationshipType": "containsPOLine",
"pushPendingStatus": "create",
"deletedAt": "2026-01-01T00:00:00.000Z",
"isCustom": true,
"requirementId": "text",
"nameOverride": "text"
}
]
}Relationship model for MCP/assistant: which entity types can be related and in which direction. Returns allRelationshipTypes and relationshipTypeExamples (from current DB specs). Use with GET /violet-relationships?sourceId=... to traverse Assembly–BOM–Part, Part–PO line–PO, PO–Invoice–Bill, etc. Optional suggestPath: comma-separated entity types (e.g. "Part,Purchase Order" or "Purchase Order,Invoice,Bill" for 3-way match); response includes suggestedTypesForPath to pass as recursiveRelationshipTypes.
Comma-separated entity types to get suggested relationship types for (e.g. "Part,Purchase Order" or "Purchase Order,Invoice,Bill" for 3-way match). Response includes suggestedTypesForPath to pass as recursiveRelationshipTypes to getEntityRelationships.
GET /api/violet-relationships/model HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"allRelationshipTypes": [
"containsPOLine"
],
"relationshipTypeExamples": {
"ANY_ADDITIONAL_PROPERTY": [
{
"sourceEntityType": "text",
"targetEntityType": "text"
}
]
},
"suggestedTypesForPath": [
"containsPOLine"
]
}¿Te fue útil?

