B Buffy Agent
Buffy Agent Blog · Engineering

First Week With the Buffy API: A Step-by-Step Integration Guide

A practical 7-day walkthrough for integrating Buffy: auth, POST /v1/message, activities CRUD, and next steps for webhooks and adapters.

First Week With the Buffy API: A Step-by-Step Integration Guide

You don’t need to “read the whole API spec” before you ship something useful with Buffy.

For most teams, the fastest path is to integrate in small, testable steps:

  1. authenticate
  2. send one message into the behavior core
  3. inspect activities and event outcomes
  4. wire in a loop for updates, reminders, and (later) webhooks

This guide is the “week 1” plan. You’ll do one meaningful thing per day, so you can validate assumptions early and reduce integration risk.

What you’ll learn

  • How to authenticate and make your first POST /v1/message call
  • How to list and update activities (habits, tasks, routines)
  • How to build a feedback loop with webhooks and reminders (next steps)

If you want the contract-first entry point, start with:

Day 1: Set up auth and your first POST /v1/message

Buffy uses Bearer auth:

Authorization: Bearer <YOUR_API_KEY>

Make your first call to send a natural language instruction into the behavior core:

curl -X POST https://api.buffyai.org/v1/message \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Set up a morning startup: water + 10-minute planning between 7:30 and 9:00."}'

What you should do today:

  • verify the response returns a structured reply (not an error)
  • confirm that the routine/activities exist by asking for “today’s state” next

Why this matters: /v1/message is the easiest way to validate that your behavior core wiring works end-to-end.

Day 2: Inspect activities (habits, tasks, routines)

Once you’ve created something, list it:

curl https://api.buffyai.org/v1/activities/today \
  -H "Authorization: Bearer YOUR_API_KEY"

What you should do today:

  • check that the activities reflect your intent (type + schedule window)
  • verify that the activity identifiers are stable for updates

You’re building the “read side” of your integration.

Day 3: Update an activity without rewriting behavior rules

Integration failures often happen when teams “re-implement” behavior rules client-side.

Instead, update the activity state using the activities endpoints. The exact payload shapes are in OpenAPI; the key pattern is:

  • send an update
  • let Buffy apply the behavior rules consistently

Example (conceptual):

curl -X PUT https://api.buffyai.org/v1/activities/<activityId> \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"note":"Shift this window for this week based on what happened.","window":"07:45-09:15"}'

What you should do today:

  • perform one update that changes “what happens next”
  • immediately re-query activities or ask for today’s summary

Day 4: Wire reminders in your UX loop

Integrations become valuable when your UX reacts to reminders and outcomes.

Today’s task:

  • decide how your app represents “done / snooze / skip” in a UI
  • ensure those choices become the next message/update into Buffy

If you want to tie it to how developers typically operate, mirror the integration thinking here:

Day 5: Add a simple feedback loop (events you can trust)

Buffy’s reminder UX depends on event history. You don’t need to build analytics first.

Instead, log outcomes in your system:

  • when a reminder event happens
  • which choices the user made
  • what changed in the activity state afterward

This lets you build “debuggability” into your product.

Once your core loop is stable, webhooks help you react without polling.

If you want the clean “what’s next” from here:

What you should do today:

  • pick one webhook event type
  • route it to a background job that updates your app UI
  • keep the behavior core as the source of truth

Day 7: Scale to multi-channel adapters

If you’re using OpenClaw or coordinating multiple surfaces, design your integration as adapters:

  • ChatGPT-style interfaces: define intent and planning
  • Telegram/Slack-style interfaces: confirmations and nudges

For the product-level adapter story:

Next step

When you’re ready to take the next integration leap, use the full integration guide:

Further reading