Actions API

Actions are structured work items that follow a lifecycle state machine and support tier-based escalation. They are the backbone of ProBeya’s visual management system — used for corrective actions, CAPAs, improvement tasks, and escalations across AIC/TIER meetings in pharma environments.

Quick Start: Creating a CAPA from a LIMS Deviation

# Create a critical quality action from a LIMS OOS event
curl -X POST https://acme.probeya.com/api/v1/actions \
  -H "Authorization: Bearer probeya_sk_live_7f3a..." \
  -H "Content-Type: application/json" \
  -d '{
    "boardId": "clx9bd001",
    "title": "CAPA-2026-0194: Investigate root cause of Batch BX-4471 OOS",
    "description": "pH reading 7.8 — upper spec limit 7.4. LIMS ref OOS-2026-0194. Batch held pending investigation.",
    "type": "action",
    "priority": "critical",
    "category": "quality",
    "tierLevel": 1,
    "source": "meeting",
    "responsibleId": "clx9us003",
    "dueDate": "2026-04-20"
  }'

Lifecycle State Machine

Actions follow a controlled lifecycle with validated transitions. The verified state is terminal — once verified, the action is permanently closed.

open ──> assigned ──> in_progress ──> done ──> verified (terminal)
  |          |              |                     ^
  v          v              v                     |
blocked <───+──── blocked  blocked         pending_approval
FromValid Transitions
openassigned, in_progress, blocked, done, pending_approval
assignedin_progress, blocked, done, open, pending_approval
in_progressblocked, done, assigned, pending_approval
blockedin_progress, assigned, open
doneverified, open, pending_approval
pending_approvalopen, assigned, in_progress, done, verified
verified(terminal — no further transitions allowed)

Invalid transitions return a 400 BAD_REQUEST error with the list of valid target statuses.


Endpoints

GET /api/v1/actions

List actions with filtering, search, and pagination. Supports cross-board listing when boardId is omitted (returns all actions in the organization).

tRPC: actions.list | Scope: read:actions | Org context: Required

Parameters:

NameTypeRequiredDescription
boardIdstring (query)NoFilter by board (omit for org-wide)
statusstring (query)NoFilter by lifecycle status
tierLevelnumber (query)NoFilter by escalation tier (1-4)
categorystring (query)NoFilter by SQCDP category
overdueboolean (query)NoIf true, only return actions past due date that are not done/verified
limitnumber (query)NoResults per page (default: 50, max: 200)
offsetnumber (query)NoPagination offset (default: 0)
# Get all overdue Tier 1 quality actions
curl -H "Authorization: Bearer probeya_sk_live_7f3a..." \
     "https://acme.probeya.com/api/v1/actions?boardId=clx9bd001&category=quality&tierLevel=1&overdue=true"

Response:

{
  "data": [
    {
      "id": "clx9ac001",
      "title": "CAPA-2026-0187: Replace worn conveyor belt section 3",
      "description": "Belt showing visible wear at 40m mark. Risk of particle contamination.",
      "status": "in_progress",
      "priority": "high",
      "type": "action",
      "category": "safety",
      "tierLevel": 1,
      "source": "gemba",
      "boardId": "clx9bd001",
      "responsibleId": "clx9us003",
      "responsibleName": "Dr. Marie Chen",
      "createdById": "clx9us001",
      "dueDate": "2026-04-05T00:00:00.000Z",
      "createdAt": "2026-03-28T09:00:00.000Z",
      "updatedAt": "2026-04-02T16:30:00.000Z"
    },
    {
      "id": "clx9ac002",
      "title": "CAPA-2026-0194: Investigate Batch BX-4471 OOS",
      "description": "pH reading 7.8 — upper spec limit 7.4",
      "status": "assigned",
      "priority": "critical",
      "type": "action",
      "category": "quality",
      "tierLevel": 1,
      "source": "meeting",
      "boardId": "clx9bd001",
      "responsibleId": "clx9us003",
      "responsibleName": "Dr. Marie Chen",
      "createdById": "clx9us001",
      "dueDate": "2026-04-20T00:00:00.000Z",
      "createdAt": "2026-04-13T14:30:00.000Z",
      "updatedAt": "2026-04-13T14:30:00.000Z"
    }
  ],
  "meta": {
    "total": 2,
    "hasMore": false
  }
}

Errors:

CodeDescriptionCauseFix
401UNAUTHORIZEDMissing or invalid authenticationCheck your Bearer token
403FORBIDDENInsufficient scopeAPI key needs read:actions scope

POST /api/v1/actions

Create a new action item. If responsibleId is provided, the status is automatically set to assigned instead of open.

tRPC: actions.create | Scope: write:actions | Org context: Required

Parameters:

NameTypeRequiredDescription
boardIdstringYesThe board to create the action on
titlestringYesAction title
descriptionstringNoDetailed description
typestringNoaction, decision, issue, risk (default: action)
prioritystringNocritical, high, medium, low (default: medium)
categorystringNoSQCDP category: safety, quality, cost, delivery, people, or custom
tierLevelnumberNoEscalation tier 1-4 (default: 1)
sourcestringNoOrigin: gemba, kaizen, meeting, other
responsibleIdstringNoUser ID for the responsible person
dueDatestringNoISO 8601 date string

Response:

{
  "data": {
    "id": "clx9ac003",
    "title": "CAPA-2026-0194: Investigate root cause of Batch BX-4471 OOS",
    "status": "assigned",
    "priority": "critical",
    "type": "action",
    "category": "quality",
    "tierLevel": 1,
    "boardId": "clx9bd001",
    "responsibleId": "clx9us003",
    "createdById": "clx9us001",
    "dueDate": "2026-04-20T00:00:00.000Z",
    "createdAt": "2026-04-13T14:30:00.000Z"
  }
}

Side effects:

  • Logs activity event for audit trail
  • Sends action_assigned notification to the responsible person
  • Fires action.created webhook
  • Triggers board automations
  • Checks approval workflow trigger conditions (may set status to pending_approval)
  • Dispatches integration events to connected systems

Errors:

CodeDescriptionCauseFix
400BAD_REQUESTInvalid type, priority, or category valueUse one of the allowed enum values
401UNAUTHORIZEDMissing or invalid authenticationCheck your Bearer token
403FORBIDDENInsufficient scopeAPI key needs write:actions scope
404NOT_FOUNDBoard not found in this organizationVerify the boardId and org context

Tier-Based Escalation

Actions support a 4-tier escalation model aligned with AIC/TIER meeting structures. Escalation moves the action to a higher tier; de-escalation returns it to a lower tier.

TierScopeMeeting CadenceExample
1Team (shop floor)Daily standup“Calibrate pH meter #7”
2DepartmentWeekly review“Recurring temperature excursions on Line 2”
3SiteBi-weekly“Capital request for new filling line”
4EnterpriseMonthly“Cross-site API supply chain risk”
# Escalate an action from Tier 1 to Tier 2
curl -X POST https://acme.probeya.com/api/v1/actions/clx9ac001/escalate \
  -H "Authorization: Bearer probeya_sk_live_7f3a..." \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Root cause spans multiple areas. Needs department-level coordination."
  }'

Response:

{
  "data": {
    "id": "clx9ac001",
    "tierLevel": 2,
    "previousTierLevel": 1,
    "escalationReason": "Root cause spans multiple areas. Needs department-level coordination.",
    "escalatedAt": "2026-04-13T15:00:00.000Z"
  }
}

Approval Workflows

When approval workflows are configured on a board, certain status transitions trigger an approval process. The action enters pending_approval status and requires designated approvers to accept or reject the change before it takes effect.

Trigger conditions include: critical priority actions, tier escalations, and status transitions to done or verified.


Pharma Integration Scenarios


tRPC-Only Action Procedures

ProcedureDescription
actions.updatePartial update with lifecycle state validation
actions.deleteDelete an action item
actions.getByIdGet a single action with full details
actions.escalateMove an action to a higher tier (with reason for audit trail)
actions.deescalateReturn an action to a lower tier
actions.getEscalatedGet actions escalated to a given tier
actions.verifyMark an action as verified by a reviewer (terminal state)
actions.getOverdueGet actions past due date that are not done/verified
actions.getStatsAggregate statistics (counts by status, tier, category)

Rate Limiting

PlanRequests/minMax results per page
Free6050
Starter120100
Pro300200
Enterprise600200