# Bringing it to the parties

A party has to do four things: open its invitation, have a ProperTrust account, read the wording, sign. This page says how the invitation reaches it and how you follow the round.

## The three ways an invitation travels

| Way | You pass | What ProperTrust does |
|---|---|---|
| **E-mail** | `email` of the party | Sends the invitation with the personal join link. |
| **Telegram, one to one** | `telegram` handle of the party | The bot writes to the party if it may, and gives you a start link if it may not. The party reads and signs in the private chat with the bot. See `telegram`. |
| **You pass the link on** | nothing more | The answer of `agreement_create` and `agreement_get` holds a `join_url` (website) and a `telegram_start_link` (bot) for every invited party. Send either through any channel your principal uses. |

A party may have both an e-mail and a handle; it is then contacted on both and uses whichever it likes. The links are personal: whoever opens a link first takes that seat. Send each link to its party only.

A fourth way exists for parties that sit together in a Telegram group the bot moderates: `telegram_moderate` runs the whole round in that group. See `telegram`.

## What the party goes through

1. **Open.** The join link leads to a page that names the sender and the title.
2. **Account.** Without an account the party registers there. An invited party needs no beta code. It must confirm its e-mail address, which gives identity level 1.
3. **Join.** The seat is bound to the account. Party status: `joined`.
4. **Read.** The party confirms every clause one by one ("read and understood"). It can ask for an explanation of a clause in its own language. When all clauses are confirmed, the read receipt is complete. Status: `read`. For a wording without clauses, the party opens the document and confirms that it read it.
5. **Sign.** The party accepts the agreement as a whole. Status: `signed`.

Signing before reading is refused. A party whose identity level is below `require_level` cannot sign.

## Following the round

`agreement_get` is the one call to poll. Per party it returns:

- `status`: `invited`, `joined`, `read` or `signed`
- `acknowledged_clauses`: how many clauses are confirmed so far
- `joined_at`, `read_at`, `signed_at`
- `signature`: the signature record once signed, see `signatures`
- `telegram`: handle and whether the bot has written or the party has opened the chat
- for the owner only: `email`, `join_url`, `telegram_start_link`

And for the agreement: `status`, `signed` (count), `anchored`, and after completion `bundle_sha256` and `editions`.

There are no webhooks yet. Poll at a calm pace: every few minutes while you wait for people, not every second. The rate limit is per key.

## Changing the round

| Call | Use it to |
|---|---|
| `agreement_add_party` | invite a further party while the agreement is `collecting`. Needs `name` and `email` or `telegram`. With `notify: false` no message is sent and you pass the link on yourself. |
| `agreement_remove_party` | remove a party that has not read or signed. A party that has read or signed stays on the record. |
| `agreement_remind` | send the invitation again to every party still `invited`: by mail, and through the bot for parties with a handle. The bot writes to the same party at most every six hours. |
| `agreement_set_pin` | set or remove the PIN of the public check page. |
| `agreement_close` | complete a round that was kept open with `open_for_parties`. Works when every current party has signed. |
| `agreement_cancel` | end a round that is still collecting. Final. |

Only the owner changes an agreement. A key of another party can read the agreement once that party has joined, and nothing more.

## When a party does not want to sign

On the website a party simply does not sign; you see it stay at `joined` or `read`. In Telegram a party can press "I do not sign": it is then removed from the round and appears under `declined` in `agreement_get` with its name and the time. The owner decides what follows: change the deal and start a new agreement, or go on with the remaining parties.

## Completion

When the last party signs (or on `agreement_close`):

- the signature bundle is written, hashed and queued for anchoring,
- every party gets its edition and an e-mail with the link; parties in Telegram get the link there too,
- `agreement_get` shows `status: completed`, `bundle_sha256`, `bundle_proof_url` and the `editions`.

Tell your principal at this point, with the `verify_url`. That link is what anybody can use later to check the document.
