> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noetive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Bud quickstart

> Find your agent's address, add a contact, put an event on its calendar, draft a message and stream what happens.

This assumes [Getting started](/guides/quickstart): an account, an agent and `NOETIVE_KEY_SECRET` set. Bud is at `https://bud.noetive.io`; every operation is a JSON `POST`.

<Warning>
  Bud is in preview. Mail is not delivered in either direction: a send is accepted and billed but does not reach anyone, and mail from outside can't reach your agent. Events with attendees are refused. See [Bud](/bud/overview).
</Warning>

<Steps>
  <Step title="Find your agent">
    The first request also sets up the agent's mailbox, calendar and address book.

    ```bash theme={null}
    ME=$(curl -sS https://bud.noetive.io/v1/me.describe \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d '{}')

    MAILBOX=$(echo "$ME" | jq -r '.agent.mailbox')
    CALENDAR=$(echo "$ME" | jq -r '.agent.calendars[0]')
    BOOK=$(echo "$ME" | jq -r '.agent.book')
    ```

    The response also carries the agent's address and its sending limits.
  </Step>

  <Step title="Add a contact">
    ```bash theme={null}
    curl -sS https://bud.noetive.io/v1/contact.create \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d "{\"in\":\"$BOOK\",\"body\":{\"kind\":\"person\",\"fn\":\"Anna Larsson\",\"n\":{\"family\":\"Larsson\",\"given\":\"Anna\"},\"emails\":[{\"addr\":\"anna@example.net\",\"type\":\"work\",\"pref\":true}],\"org\":\"Example AB\",\"title\":\"CTO\"}}"
    ```

    The response carries `ref` and `version`.
  </Step>

  <Step title="Put an event on the calendar">
    ```bash theme={null}
    START=$(date -u -v+7d '+%Y-%m-%dT09:00:00Z' 2>/dev/null || date -u -d '+7 days' '+%Y-%m-%dT09:00:00Z')
    END=$(date -u -v+7d '+%Y-%m-%dT09:30:00Z' 2>/dev/null || date -u -d '+7 days' '+%Y-%m-%dT09:30:00Z')

    curl -sS https://bud.noetive.io/v1/event.create \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d "{\"in\":\"$CALENDAR\",\"body\":{\"summary\":\"Quarterly review\",\"location\":\"Room 1\",\"start\":\"$START\",\"end\":\"$END\",\"tz\":\"Europe/Stockholm\"}}"
    ```

    No attendees on this event: an event with attendees is refused.
  </Step>

  <Step title="Draft a message">
    ```bash theme={null}
    curl -sS https://bud.noetive.io/v1/draft.create \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d '{"body":{"to":["anna@example.net"],"subject":"Quarterly review","text":"Does next week work?"}}'

    curl -sS https://bud.noetive.io/v1/folder.list \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d "{\"in\":\"$MAILBOX\",\"folder\":\"inbox\"}"
    ```

    The draft sits in the mailbox. There is no send step here.
  </Step>

  <Step title="Stream what happens">
    ```bash theme={null}
    curl -sS -N https://bud.noetive.io/v1/watch \
      -H "Authorization: Bearer $NOETIVE_KEY_SECRET" \
      -H "Content-Type: application/json" \
      -d "{\"mailbox\":\"$MAILBOX\",\"timeout_s\":25}"
    ```

    This opens a Server-Sent Events stream of mail events for that mailbox. Calendar and contact changes are not on this stream.
  </Step>
</Steps>

## What you just used

| Operation        | Did                                                           |
| ---------------- | ------------------------------------------------------------- |
| `me.describe`    | Found the agent's address, mailbox, calendar and address book |
| `contact.create` | Added a contact to the address book                           |
| `event.create`   | Put an event on the calendar                                  |
| `draft.create`   | Drafted a message                                             |
| `folder.list`    | Listed messages in a folder                                   |
| `watch`          | Streamed mail events for the mailbox                          |

## Next

<CardGroup cols={2}>
  <Card title="Bud" icon="at" href="/bud/overview">
    What Bud is, and what the preview does today.
  </Card>

  <Card title="Agents and addresses" icon="id-badge" href="/bud/addressing">
    How an agent gets a mailbox, and what its address looks like.
  </Card>

  <Card title="FAQ" icon="circle-question" href="/bud/faq">
    Common questions about mail, calendar and contacts.
  </Card>

  <Card title="Billing" icon="credit-card" href="/platform/billing">
    What Bud requests and messages sent cost.
  </Card>
</CardGroup>
