# Quick Start

## 1. Get a key

API accounts and keys are issued by GoSmarter. Ask for a **mock** account first: it is free to experiment with and never runs real extraction (see [Mock Mode](/mock-mode)). You receive the key once; store it as a secret.

```bash
export GOSMARTER_API_KEY=zpka_your_key_here
```

## 2. Check the service

```bash
curl https://<gateway-host>/v1-preview/health
```

## 3. Read your account

```bash
curl https://<gateway-host>/v1-preview/account \
  -H "Authorization: Bearer $GOSMARTER_API_KEY"
```

The response says whether the account is `live` or `mock`. A `401` means the key is missing or wrong; a `403` means the account is suspended or closed, or the key is not correctly configured (see [Errors](/errors)).

:::note

`<gateway-host>` is the host GoSmarter gives you with your account. Do not put your key in browser code: call the API from your server.

:::

## 4. Send a certificate

```bash
# create (use a mock key first; add "scenario" to pick a sandbox result)
curl -X POST https://<gateway-host>/v1-preview/jobs \
  -H "Authorization: Bearer $GOSMARTER_API_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-first-job" -d '{"mode":"single"}'

# upload the PDF straight to the URL in the response (it never passes through the gateway)
curl -X PUT "<upload.url>" -H "x-ms-blob-type: BlockBlob" --data-binary @certificate.pdf

# submit, then poll until the status is completed, completedWithErrors, infected or failed
curl -X POST https://<gateway-host>/v1-preview/jobs/<jobId>/submit -H "Authorization: Bearer $GOSMARTER_API_KEY"
curl https://<gateway-host>/v1-preview/jobs/<jobId> -H "Authorization: Bearer $GOSMARTER_API_KEY"
curl https://<gateway-host>/v1-preview/jobs/<jobId>/result -H "Authorization: Bearer $GOSMARTER_API_KEY"
```

Use `mode: pack` for one PDF holding certificates from several suppliers. The result has the same shape for both: one entry per certificate. Once a job has finished you can also get its PDFs regrouped per certificate, supplier or heat: see [PDF exports](/pdf-exports). To be told when a job finishes instead of polling, register a [webhook](/webhooks) and fetch the PDFs from your handler.
