Link an upstream item to this item
POST
/api/v1/items/{itemId}/relationships/upstream
const url = 'https://app.avera.io/api/v1/items/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/relationships/upstream';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"relationshipTypeId":"example","upstreamItemId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.avera.io/api/v1/items/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/relationships/upstream \ --header 'Content-Type: application/json' \ --data '{ "relationshipTypeId": "example", "upstreamItemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'The path item becomes the downstream endpoint. Creation routes through the typed change seam, which enforces the relationship type’s allowed pairs and the downstream owner’s state gate. Endpoints are canonical ids, so the link survives item versioning untouched.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”itemId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
relationshipTypeId
required
string
upstreamItemId
required
string format: uuid
Example generated
{ "relationshipTypeId": "example", "upstreamItemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”OK
Media type*/*
object
id
required
string format: uuid
relationshipTypeId
required
string
upstreamItemId
required
string format: uuid
downstreamItemId
required
string format: uuid
suspect
required
boolean
suspectReason
string | null
createdAt
required
string format: date-time
createdBy
required
string format: uuid
position
integer | null format: int64