Apply a batch of typed changes as one commit
POST
/api/v1/projects/{projectId}/item-actions/apply
const url = 'https://app.avera.io/api/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/item-actions/apply';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"actions":[{"type":"ATTRIBUTE_EDIT","payload":{"container":true,"nodeType":"ARRAY","string":true,"integralNumber":true,"missingNode":true,"valueNode":true,"pojo":true,"number":true,"short":true,"int":true,"long":true,"double":true,"bigDecimal":true,"bigInteger":true,"textual":true,"boolean":true,"binary":true,"floatingPointNumber":true,"empty":true,"array":true,"null":true,"object":true,"float":true,"embeddedValue":true},"subjectItemId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","localRef":"example","authorActor":"USER","originatingAIProposalId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","parentCommentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","parentActionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}],"expectedSeqs":[{"itemId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","seq":1}]}'};
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/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/item-actions/apply \ --header 'Content-Type: application/json' \ --data '{ "actions": [ { "type": "ATTRIBUTE_EDIT", "payload": { "container": true, "nodeType": "ARRAY", "string": true, "integralNumber": true, "missingNode": true, "valueNode": true, "pojo": true, "number": true, "short": true, "int": true, "long": true, "double": true, "bigDecimal": true, "bigInteger": true, "textual": true, "boolean": true, "binary": true, "floatingPointNumber": true, "empty": true, "array": true, "null": true, "object": true, "float": true, "embeddedValue": true }, "subjectItemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "localRef": "example", "authorActor": "USER", "originatingAIProposalId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentCommentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parentActionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ], "expectedSeqs": [ { "itemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "seq": 1 } ] }'The one-hop equivalent of propose then accept, through the same executor seam: every action runs its own permission check and state gate, and the batch applies whole or is refused whole. Each expectedSeq names the seq a row was read at; 200 with an empty conflicts list means applied, 409 means nothing was written and each conflict names an item whose seq moved since the caller read it. The response returns every touched item with its attributes and new seq.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
actions
required
Array<object>
object
type
required
string
payload
required
object
container
boolean
nodeType
string
string
boolean
integralNumber
boolean
missingNode
boolean
valueNode
boolean
pojo
boolean
number
boolean
short
boolean
int
boolean
long
boolean
double
boolean
bigDecimal
boolean
bigInteger
boolean
textual
boolean
boolean
boolean
binary
boolean
floatingPointNumber
boolean
empty
boolean
array
boolean
null
boolean
object
boolean
float
boolean
embeddedValue
boolean
subjectItemId
string | null format: uuid
localRef
string | null
authorActor
required
string
originatingAIProposalId
string | null format: uuid
parentCommentId
string | null format: uuid
parentActionId
string | null format: uuid
expectedSeqs
required
Array<object>
object
itemId
required
string format: uuid
seq
required
integer format: int64
Responses
Section titled “Responses”OK
Media type*/*
object
applied
required
Array<object>
object
index
required
integer format: int32
type
required
string
localRef
string | null
producedItemIds
required
Array<string>
producedRelationshipIds
required
Array<string>
items
required
Array<object>
object
id
required
string format: uuid
itemTypeId
required
string
canonicalId
required
string format: uuid
number
required
string
revision
string | null
seq
required
integer format: int64
status
required
string
workflowStateId
required
string
projectId
required
string format: uuid
branchId
required
string format: uuid
createdAt
required
string format: date-time
createdBy
required
string format: uuid
modifiedAt
required
string format: date-time
modifiedBy
required
string format: uuid
attributes
object | null
wasEverReleased
boolean | null
frozenAttributeIds
Array<string> | null
conflicts
required
Array<object>
object
itemId
required
string format: uuid
expectedSeq
required
integer format: int64
actualSeq
integer | null format: int64
reason
required
string