Actions
Create a Node Request Action
Create a new action on an existing Node Request. Node Request Actions represent user-driven or automated steps in a moderation workflow for requests related to project nodes (e.g., access, registration withdrawal). They capture state transitions and optional comments.
Available Triggers
Supported trigger values:
- submit: Submit the request for review. (No special permissions required)
- accept: Approve the request. (Requires admin permissions on the node)
- reject: Deny the request. (Requires admin permissions)
- edit_comment: Add or update a moderator/admin comment without state change. (Requires admin permissions)
Permissions
- Accept/reject/edit_comment: Requires admin permissions on the associated node.
- Submit: Allowed by any user with write permissions on the node.
Returns
On success, returns 201 Created with the newly created action resource in the data key.
Errors
- 400 Bad Request: Malformed or incomplete payload.
- 403 Forbidden: Insufficient privileges to perform the trigger.
- 409 Conflict: Trigger is invalid in the current state.
See Errors and Error Codes for full reference.
post/actions/requests/nodes/
Request body
Example request
{
"data": {
"type": "node-request-actions",
"attributes": {
"trigger": "accept",
"comment": "Approving the node access request."
},
"relationships": {
"target": {
"data": {
"type": "node-requests",
"id": "nodeReq123"
}
}
}
}
}Response
Node Request Action successfully created.
Example response
{
"id": "abc123",
"type": "review-actions",
"attributes": {
"trigger": "accept",
"comment": "Approved after careful consideration.",
"from_state": "pending",
"to_state": "accepted",
"date_created": "2024-01-01T00:00:00Z",
"date_modified": "2024-01-01T01:00:00Z",
"visible": true
},
"relationships": {
"creator": {
"links": {
"related": {
"href": "https://api.osf.io/v2/users/user456/",
"meta": {}
}
},
"data": {
"id": "user456",
"type": "users"
}
},
"target": {
"links": {
"related": {
"href": "https://api.osf.io/v2/preprints/preprint789/",
"meta": {}
}
},
"data": {
"id": "preprint789",
"type": "preprints"
}
},
"provider": {
"links": {
"related": {
"href": "https://api.osf.io/v2/providers/preprints/osf/",
"meta": {}
}
},
"data": {
"id": "osf",
"type": "preprint-providers"
}
}
},
"links": {
"self": "https://api.osf.io/v2/actions/abc123/"
}
}