Skip to main content

Operations Endpoints

Manage operation queue, approvals, and execution history.

GET /api/core/operations/queue

Get pending and in-progress operations. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Response:
{
  "success": true,
  "data": {
    "intents": [
      {
        "id": 789,
        "type": "SUPPLY",
        "status": "PENDING_APPROVAL",
        "managedWalletId": 456,
        "amount": "10000.00",
        "token": "USDC",
        "createdAt": "2025-10-23T14:00:00Z",
        "estimatedAPY": "6.5%"
      }
    ],
    "count": 1
  }
}
Operations in PENDING_APPROVAL status require manual approval before execution.

POST /api/core/operations/:id/approve

Approve a pending operation. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Response:
{
  "success": true,
  "data": {
    "id": 789,
    "status": "EXECUTING",
    "approvedAt": "2025-10-23T14:30:00Z"
  }
}
Once approved, the operation will be picked up by your custody agent for execution.

POST /api/core/operations/:id/reject

Reject a pending operation. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Response:
{
  "success": true,
  "data": {
    "id": 789,
    "status": "REJECTED",
    "rejectedAt": "2025-10-23T14:30:00Z"
  }
}
Rejecting an operation will release any reserved funds. This action cannot be undone.

GET /api/core/operations/history

Get operation history with filtering. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Query Parameters:
  • limit (optional) - Number of results (default: 50, max: 100)
  • offset (optional) - Pagination offset (default: 0)
  • status (optional) - Filter by status: COMPLETED, FAILED, etc.
Response:
{
  "success": true,
  "data": {
    "items": [
      {
        "id": 788,
        "type": "SUPPLY",
        "status": "COMPLETED",
        "managedWalletId": 456,
        "amount": "5000.00",
        "token": "USDC",
        "createdAt": "2025-10-22T10:00:00Z",
        "completedAt": "2025-10-22T10:02:15Z",
        "txHash": "5aApzp1XxiNzFotAiZt6z7BaTTYCS7964ycpxwYp4eVy...",
        "actualAPY": "6.3%"
      }
    ],
    "total": 45,
    "limit": 50,
    "offset": 0,
    "hasMore": false
  }
}

GET /api/core/operations/stats

Get operation statistics for your organization. Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Response:
{
  "success": true,
  "data": {
    "totalOperations": 127,
    "completedOperations": 120,
    "failedOperations": 2,
    "pendingOperations": 5,
    "totalDeployed": "175000.00",
    "averageCompletionTime": "142",
    "successRate": "98.4%"
  }
}

Operation Lifecycle

Operations progress through the following states:
1

PLANNING

Operation created, funds reserved from available balance
2

PENDING_APPROVAL

Awaiting manual approval (if required by policy)
3

EXECUTING

Transaction being signed by custody agent
4

CONFIRMING

Transaction submitted to blockchain, awaiting confirmation
5

COMPLETED

Transaction confirmed, allocation active and earning yield
Terminal States:
  • COMPLETED - Successfully executed
  • FAILED - Execution failed (funds released)
  • REJECTED - Manually rejected (funds released)
  • ABORTED - System aborted (funds released)

Example Usage

// Get pending operations
const queueResponse = await fetch('https://api.rebelfi.io/api/core/operations/queue', {
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

const { data } = await queueResponse.json();
console.log('Pending operations:', data.intents);

// Approve an operation
const approveResponse = await fetch('https://api.rebelfi.io/api/core/operations/789/approve', {
  method: 'POST',
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

// Get operation history with filtering
const historyResponse = await fetch('https://api.rebelfi.io/api/core/operations/history?status=COMPLETED&limit=20', {
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

// Get statistics
const statsResponse = await fetch('https://api.rebelfi.io/api/core/operations/stats', {
  headers: { 'Authorization': `Bearer ${accessToken}` }
});

Approval Workflows

Configure approval requirements based on your operational needs:

Automatic Approval

Operations execute automatically without manual intervention. Best for:
  • Trusted yield deployments
  • Small amounts
  • Low-risk operations

Manual Approval

All operations require explicit approval. Best for:
  • Large deployments
  • New integrations
  • High-security requirements
  • Compliance workflows

Conditional Approval

Approval required based on rules:
  • Amount thresholds
  • Wallet types
  • Time of day
  • Counterparty addresses
Configure approval policies in the dashboard under Settings → Operations → Approval Rules.

Monitoring Operations

Best practices for monitoring operation execution:
  1. Poll the queue regularly - Check for pending approvals
  2. Monitor history for failures - Investigate failed operations
  3. Track completion times - Identify performance issues
  4. Review success rates - Ensure high reliability

Webhook Notifications

Subscribe to operation events:
  • operation.approved
  • operation.executing
  • operation.completed
  • operation.failed
Contact us to enable webhook notifications for your organization.