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

# Connect and check the API

> The four checks every partner runs before writing integration code

Run these four checks from a server shell after you have made a partner API key in your partner's workspace (Settings → API keys: see [API keys](https://docs.widgetic.com/docs/api-keys.md)). They prove the network, the key, your contract and your account standing. The [integration guide](https://docs.superhuman.com/d/_do4kTYR8IRR/_sufIff3d) (section 4) has the full curl commands and sample answers; this page is the checklist the marketing site and go-live list refer to.

## Set your environment

Read the key without echoing it, set your partner id, and point at production:

```bash theme={"theme":"css-variables"}
read -rs WIDGETIC_API_KEY && export WIDGETIC_API_KEY
# The id of your partner: the one in the answer of check 4 (GET /partners/mine)
export WIDGETIC_PARTNER_ID="<your partner id>"
export WIDGETIC_API="https://api.widgetic.com/v1"
```

You do not have the partner id before your first call. Run check 4 first, copy the `id` of your partner from its answer, and then run the others.

## The four checks

| # | Call | Key needed? | Proves |
| - | - | - | - |
| 1 | `GET https://api.widgetic.com/health` | No | The service answers (`status: ok`) |
| 2 | `GET /tokens/validate` | Yes | Your key is valid; keep `data.userId` for credit calls |
| 3 | `GET /partners/{partnerId}/contract` then `GET /compositions?size=1` with headers | Yes | Your contract exists; read `ratelimit-*` headers (partner keys: 1,000,000 calls per 15 minutes) |
| 4 | `GET /partners/mine` | Yes | Standing (`active`, `inactive`, `suspended`, `payment_arrears`, `winding_down` or `closed`), `partnership` (where the partnership is on its way to its end) and `platformDomain` |

Check 3 fails with **404** when Widgetic has not recorded your contract yet, and with **403** when the key is not your partner's (the partner id belongs to another partner).

## Rules every call follows

* `Authorization: Bearer` on every `/v1` call.
* JSON in and out: `{ success, data }` or `{ success: false, error: { code, ... } }`.
* `Idempotency-Key` on writes (see [Idempotency](https://docs.widgetic.com/docs/reference/idempotency.md)).
* Call from your **server**, not a browser: production CORS blocks `/v1` from your site, and a key in the browser can be stolen. Browsers use public embed routes without a key ([Embedding](https://docs.widgetic.com/docs/api/embedding.md)).

## Next

> [card] [Storage](https://docs.widgetic.com/docs/partners/storage.md)
>
> Required before activation

> [card] [Go live](https://docs.widgetic.com/docs/partners/go-live.md)
>
> Checklist before customers use widgets


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.