# Quickstart

> Issue a key, provision a batch of accounts and read one account's performance, in four requests.

Source: https://www.propexecutor.com/docs/quickstart
Whole reference in one file: https://www.propexecutor.com/doc.md

Four requests: issue a key, find an account type, provision a batch, read one account’s performance. Ten minutes end to end.

> **What answers today**
> Step 1 and the analytics read in step 4 are live. Provisioning, traders and credentials are still marked [planned](https://www.propexecutor.com/docs/availability) — those paths answer 404 until their handlers ship, so do that part in the panel for now. The walkthrough is written against the finished shape on purpose, so nothing you build against it has to change when they land.

## 1 · Issue a key

In the admin panel, open [Developer](https://app.propexecutor.com/developer) and create a key. Give it `accounts:read` and `accounts:write` for this walkthrough — you can add [more scopes](https://www.propexecutor.com/docs/authentication) later, and you should not grant them until you need them.

Copy the token when it appears. It is shown once and we cannot recover it.

<!-- shell -->
```bash
export PFX_KEY=pfx_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

## 2 · Check what you have

An account type is the challenge you sell — a starting balance plus the rule set it is judged against. You need its id to provision anything.

<!-- curl -->
```bash
curl https://api.propexecutor.com/v1/account-types \
  -H "Authorization: Bearer $PFX_KEY"
```

<!-- 200 OK -->
```json
{
  "data": [
    {
      "id": "0f9c2e14-7b3d-4a86-9c11-2ab5d6e7f801",
      "name": "$10K Standard",
      "starting_balance": 10000,
      "price_cents": 9900,
      "rule_set_id": "7c4a…"
    }
  ],
  "next_cursor": null
}
```

No account types yet? Create them in the panel first — they are a configuration decision (which rules, what balance, what you charge) rather than something to script.

## 3 · Provision a batch

<!-- curl -->
```bash
curl -X POST https://api.propexecutor.com/v1/accounts \
  -H "Authorization: Bearer $PFX_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"account_type_id":"0f9c2e14-7b3d-4a86-9c11-2ab5d6e7f801","quantity":5}'
```

<!-- 201 Created -->
```json
{
  "accounts": [
    { "id": "6ab6…", "account": 10000042 },
    { "id": "7bc7…", "account": 10000043 }
  ],
  "credits": { "granted": 250, "used": 47, "remaining": 203 }
}
```

> **That spent five credits, for good**
> Each account costs one credit permanently — breaching or archiving it returns nothing. The `Idempotency-Key` above is what makes a network timeout safe to retry; without it a retry provisions a second batch. See [idempotency](https://www.propexecutor.com/docs/idempotency).

## 4 · Hand one over, then watch it

Create the trader, assign the account, read its credentials:

<!-- curl -->
```bash
# the trader record
curl -X POST https://api.propexecutor.com/v1/traders \
  -H "Authorization: Bearer $PFX_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Jordan Ellis","email":"jordan@example.com"}'

# assign the account to them
curl -X PUT https://api.propexecutor.com/v1/accounts/10000042/trader \
  -H "Authorization: Bearer $PFX_KEY" -H "Content-Type: application/json" \
  -d '{"trader_id":"3d21…"}'

# the login to hand over (needs credentials:read)
curl https://api.propexecutor.com/v1/accounts/10000042/credentials \
  -H "Authorization: Bearer $PFX_KEY"
```

Once they are trading, one request gives you the whole performance picture:

<!-- curl -->
```bash
curl https://api.propexecutor.com/v1/accounts/10000042/analytics \
  -H "Authorization: Bearer $PFX_KEY"
```

That is the [analytics object](https://www.propexecutor.com/docs/analytics) — gain, drawdown, profit factor, the balance and equity curve and the monthly tables, in one call.

## Next

- [Pagination](https://www.propexecutor.com/docs/pagination) — before you list more than 50 of anything.
- [Rate limits](https://www.propexecutor.com/docs/rate-limits) — before you put a poll on a timer.
- [Errors](https://www.propexecutor.com/docs/errors) — the codes worth retrying, and the ones that mean stop.
