Actions API
Overview
Actions represent social interactions and activities in Cloudillo. This includes posts, comments, reactions, connections, and more.
The Actions API allows you to:
- Create posts, comments, and reactions
- Manage user connections and follows
- Share files and resources
- Send messages
- Track action statistics
Action Types
Content Actions
| Type | Description | Audience | Examples |
|---|---|---|---|
| POST | Create a post or content | Followers, Public, Custom | Blog posts, status updates |
| CMNT | Comment on an action | Parent action audience | Thread replies |
| REPOST | Share existing content | Followers | Retweets |
| SHRE | Share resource/link | Followers, Custom | Link sharing |
User Actions
| Type | Description | Audience | Examples |
|---|---|---|---|
| FLLW | Follow a user/community | Target user | Subscribe to updates |
| CONN | Connection request | Target user | Friend requests |
Communication Actions
| Type | Description | Audience | Examples |
|---|---|---|---|
| MSG | Private message | Specific user | Direct messages |
| FSHR | File sharing | Specific user(s) | Share documents |
Metadata Actions
| Type | Description | Audience | Examples |
|---|---|---|---|
| REACT | React to content | None (broadcast) | Likes, loves |
| ACK | Acknowledgment | Parent action issuer | Read receipts |
Endpoints
List Actions
Query all actions with optional filters. Uses cursor-based pagination for stable results.
Authentication: Optional (visibility-based access control)
Query Parameters:
Filtering:
type- Filter by action type(s), comma-separated (e.g.,POST,CMNT)status- Filter by status(es), comma-separated (P=Pending, A=Active, D=Deleted, C=Created, N=New)issuer- Filter by issuer identity (e.g.,alice@example.com)audience- Filter by audience identityparentId- Filter by parent action (for comments/reactions)rootId- Filter by root/thread ID (for nested comments)subject- Filter by subject identity (for CONN, FLLW actions)involved- Filter by actions involving a specific identity (issuer, audience, or subject)actionId- Filter by specific action IDtag- Filter by content tag
Time-based:
createdAfter- ISO 8601 timestamp or Unix seconds
Pagination:
limit- Max results (default: 20)cursor- Opaque cursor for next page (from previous response)
Sorting:
sort- Sort field:created(default)sortDir- Sort direction:ascordesc(default:desc)
Examples:
Get recent posts:
Get comments on a specific post:
Get all actions involving a specific user:
Get posts from a time range:
Get pending connection requests:
Get thread with all nested comments:
Cursor-based pagination:
Response:
Create Action
Create a new action (post, comment, reaction, etc.).
Authentication: Required
Request Body:
Examples:
Create a Post:
Create a Comment:
Create a Reaction:
Follow a User:
Connect with a User:
Share a File:
Response:
Get Action
Retrieve a specific action by ID.
Example:
Response:
Update Draft Action
Update a draft action before publishing. Only actions in draft status (R) can be updated.
Authentication: Required (must be issuer)
Request Body:
| Field | Type | Description |
|---|---|---|
content |
object | Updated content (action-type specific) |
attachments |
string[] | Updated file attachment IDs |
visibility |
string | Visibility level (P, V, F, C) |
flags |
string | Action flags |
x |
object | Extension data |
Response:
Info
Only draft actions (status R) can be updated. Published actions are signed JWTs and cannot be modified.
Delete Action
Delete an action. Only the issuer can delete their actions.
Authentication: Required (must be issuer)
Example:
Response:
Accept Action
Accept a pending action (e.g., connection request, follow request).
Authentication: Required (must be the subject/target)
DSL Hooks: When an action is accepted, the server triggers the on_accept hook defined in the action type’s DSL configuration. This can execute custom logic such as:
- Creating reciprocal connections (CONN actions)
- Adding the user to groups (INVT actions)
- Granting permissions (FSHR actions)
Example:
Response:
Reject Action
Reject a pending action.
Authentication: Required (must be the subject/target)
DSL Hooks: When an action is rejected, the server triggers the on_reject hook defined in the action type’s DSL configuration. This can execute cleanup logic such as:
- Removing pending permissions
- Notifying the issuer of the rejection
- Cleaning up temporary resources
Example:
Response:
Update Statistics
Update action statistics (typically called by the system).
Authentication: Required (admin)
Request Body:
Dismiss Notification
Dismiss a notification action. This acknowledges a notification without accepting or rejecting it.
Authentication: Required
Request Body: Empty
Response:
Publish Draft
Publish a draft action, making it visible to the intended audience. Optionally schedule for future publication.
Authentication: Required (must be issuer)
Request Body:
| Field | Type | Description |
|---|---|---|
publishAt |
string | Optional future publication timestamp (ISO 8601). If omitted, publishes immediately. |
Response:
Info
If publishAt is provided, the action moves to scheduled status (S) and will be published automatically at the specified time.
Cancel Scheduled Action
Cancel a scheduled action, reverting it back to draft status.
Authentication: Required (must be issuer)
Request Body: Empty
Response:
Federation Inbox
Receive federated actions from other Cloudillo instances. This is the primary endpoint for cross-instance action delivery. Processing is asynchronous.
Authentication: Not required (actions are verified via signatures)
Request Body: Action token (JWT)
Example:
Response:
Federation Inbox (Synchronous)
Receive federated actions with synchronous processing. Unlike the standard inbox, this endpoint processes the action immediately and returns the result.
Authentication: Not required (actions are verified via signatures)
Request Body: Action token (JWT)
Response:
Info
Both inbox endpoints verify the action signature against the issuer’s public key before accepting it.
Action Status Flow
Actions have a lifecycle represented by status:
- R (Draft): Unpublished draft, can be edited
- S (Scheduled): Scheduled for future publication
- A (Active): Published, visible, and finalized
- D (Deleted): Soft-deleted or rejected
- C (Created): Awaiting acceptance (e.g., connection requests)
- N (New): Notification awaiting acknowledgment
- P (Pending): Legacy pending status
Status transitions:
- Draft actions can be updated, published, scheduled, or deleted
- Scheduled actions can be cancelled (reverts to Draft) or auto-publish at scheduled time
- Created actions can be accepted (→ Active) or rejected (→ Deleted)
- New notifications can be dismissed
- Any action can be deleted by issuer (changes status to Deleted)
Content Schemas
Different action types have different content structures:
POST Content
CMNT Content
MSG Content
FSHR Content
CONN Content
Action Statistics
Actions can have aggregated statistics:
Accessing statistics:
Threading
Actions support threading via parentId and rootId:
Creating a thread:
Fetching a thread:
Federation
Actions are the core of Cloudillo’s federation model. Each action is cryptographically signed and can be verified across instances.
Action Token Structure:
This enables:
- Trust-free verification
- Cross-instance action delivery
- Tamper-proof audit trails
Best Practices
1. Use Cursor-Based Pagination
2. Optimistic UI Updates
3. Handle Visibility
Actions have visibility levels that control who can see them:
| Code | Level | Description |
|---|---|---|
P |
Public | Anyone can view |
V |
Verified | Authenticated users only |
F |
Follower | User’s followers only |
C |
Connected | Mutual connections only |
null |
Direct | Owner + explicit audience |
See Also
- Authentication - How to authenticate requests
- Files API - Attach files to actions
- Profiles API - User and community profiles
- WebSocket API - Real-time action updates