Quickstart

This walks you through sending your first approval request: your agent proposes an action, a human reviews it in the Pump Up workspace, and your agent acts on their decision.

Prerequisites

  • A Pump Up account and an API key from the dashboard
  • Python 3.9+ (or Node 18+ for TypeScript)

1. Install the SDK

$pip install pumpup-sdk

2. Set your API key

The SDK reads your key from the PUMPUP_API_KEY environment variable.

$export PUMPUP_API_KEY="..."

3. Request an approval and read the decision

1import time
2import uuid
3
4from pumpup import PumpUp
5
6client = PumpUp() # reads PUMPUP_API_KEY
7
8# Open a task. Every account starts with a "general" project; create dedicated
9# projects in the dashboard for real routing.
10task = client.tasks.create(
11 idempotency_key=str(uuid.uuid4()),
12 project_name="general",
13 name="Refund — claim C-1029",
14)
15
16# Ask a human to approve a sensitive action.
17request = client.approvals.create(
18 idempotency_key=str(uuid.uuid4()),
19 project_name="general",
20 task_id=task.id,
21 summary="Refund $240 on claim C-1029",
22 key_value_context={
23 "Claim": "C-1029",
24 "Amount": "$240",
25 "Reason": "Lost package — tracking and photos provided",
26 },
27)
28
29# Poll for the decision. get_result returns None while the request is pending.
30while True:
31 result = client.approvals.get_result(id=request.event_id)
32 if result is not None:
33 break
34 time.sleep(2)
35
36if result.outcome.type in ("APPROVE", "EDIT_AND_APPROVE"):
37 print(f"Approved by {result.decided_by}: {result.outcome.note or ''}")
38else:
39 print(f"Not approved — {result.outcome.type}: {result.outcome.note or ''}")

Run it, then open the Pump Up workspace — the request is waiting on the task with the summary and context you sent. Approve it, and your script prints the decision.

What just happened

  • Tasks and projects. Every request lives on a task (the case) inside a project (which routes it). The general project exists in every account; create dedicated ones in the dashboard for real routing.
  • The poll model. approvals.create returns immediately with an event id. get_result returns the decision once a human acts, or nothing (None / undefined) while it’s still pending — so you poll.
  • Idempotency. Every write takes an idempotency key; a retry with the same key returns the original event instead of recording a duplicate.
  • The outcome. result.outcome.type is one of APPROVE, REJECT, EDIT_AND_APPROVE, ESCALATE, or REQUEST_MORE_INFO. When a reviewer edits before approving, their change is described in outcome.note.

Next steps