Contract introspection
GET /verbs/:id/contract returns the output of buildVerbContract(verb, getPrimitiveMetadataById): declaration, action, primitive, inputs, outputs, and steps (for composed verbs). The same contract plus HTTP usage enrichment is also available via the verb.contract primitive when called through the verb executor.
{
"verb": {
"id": "507f...",
"name": "Create person",
"version": 1,
"type": "primitive"
},
"contract": {
"declaration": "shapeA",
"action": "atom.create",
"primitive": {
"id": "atom.create",
"version": "1.0.0",
"description": "..."
},
"inputs": {
"data": {
"source": "runtime",
"required": true,
"description": "...",
"primitiveType": "object"
}
},
"outputs": {
"atom": {
"type": "object",
"description": "..."
}
},
"steps": []
}
}Alternative: via the verb executor
Provision (or look up) a verb whose action is verb.contract and execute it with the target verbId as runtime input. The response includes a third usage block describing how to call that verb over HTTP.
curl -X POST "https://api.sociallux.io//verbs/<verbContractVerbId>/execute" \
-H "Content-Type: application/json" \
-d '{
"input": {
"verbId": "507f1f77bcf86cd799439011"
}
}'
# Response excerpt (execution.output)
{
"verb": {
"id": "507f...",
"name": "Create person",
"description": "...",
"type": "primitive",
"owner": {
"userId": "...",
"organizationAtomId": null
},
"isPublic": false
},
"contract": { /* same as GET /verbs/:id/contract */ },
"usage": {
"method": "POST",
"path": "/verbs/507f.../execute",
"bodyShape": {
"input": {
"data": {
"type": "object",
"required": true,
"description": "..."
}
}
},
"exampleRequest": {
"method": "POST",
"url": "/verbs/507f.../execute",
"headers": { "Content-Type": "application/json" },
"body": { "input": { "data": {} } }
},
"exampleResponse": {
"message": "Verb executed successfully",
"execution": {
"verbId": "507f...",
"type": "primitive",
"output": { "atom": {} },
"trace": [
{ "step": 0, "action": "<action>", "status": "success", "output": { "atom": {} } }
]
}
}
}
}