Skip to main content
Widgetic has two kinds of API key. You send both the same way, as Authorization: Bearer <key>, but they open different parts of the API. The workspace decides which kind you get: a key made in a partner’s workspace is a partner key, and a key made in any other workspace is an organisation key. There is nothing to choose when you make one.

Organisation key

Works for the content of one workspace: widgets, compositions, uploads, credits and everything else an account does for itself. It starts with wdg_org_ and you make it in the dashboard. It is also called a workspace key.

Partner key

Does all of that, and also the calls a platform needs to run Widgetic for its own customers: managed users, editor sessions, your contract, storage and notifications. It starts with wgt_prt_ and you make it in your partner’s home workspace. For partners only.

Which key do I need?

What makes a key a partner key

A key is a partner key when it was made in your partner’s home workspace, the workspace of your partner account. It starts with wgt_prt_ and it acts as your partner. That workspace is made for you when Widgetic invites you, and it is the only workspace your partner account has: you do not add others, and nobody can be invited into it. You do not choose the kind of a key. You make every key the same way, under Settings → API keys (see Make a key), and the workspace decides: your partner’s home workspace makes partner keys, and every other workspace makes organisation keys (wdg_org_). You make each partner key yourself, one for each integration, with only the access that integration needs. Widgetic does not make or send you a key: you sign in with the shared mailbox Widgetic invited. An organisation key acts as a customer, so the partner endpoints refuse it.

The two keys side by side

What each key can call

Every endpoint in the API reference has an access level. These are the calls of each group that take an organisation key, and the ones that need a partner key: In all, 10 calls take no key, 123 take an organisation key or a partner key, and 70 need a partner key. An endpoint that needs a partner key carries a Partner key label in the sidebar of the API reference, and an endpoint that takes no key carries No key. Every other endpoint takes either key. The table follows the access level of each endpoint. Other rules still apply on top of it: how much the key may do (see Choose how much a key may do), the plan, and the few calls that need a person signed in on widgetic.com, such as making a key.

Choose how much a key may do

Whichever kind it is, a key also has an access, which you choose when you make it. Give a key only what its application needs: a leaked key can then do no more than that. The dialog Create API key in the dashboard offers four choices:
  • The access is fixed when the key is made. To give a key more or less, make a new one and delete the old one: see Make a key.
  • A call outside the access is refused with 403 and the code API_KEY_SCOPE_MISSING. error.details.missingScopes lists what a new key needs.
  • Access only narrows. A limited key still needs what its kind needs: the role of a partner key, the plan of the workspace.
  • The list of keys shows the access of each key, as a tag between its name and the date it was made: Full access, Content, Read only or Custom. Hover over the tag to see what a key may do.
The scopes behind each choice, and what each one lets a key do, are in Limit what a key can do.

Check which key you hold

Two calls tell you. GET /tokens/validate says what the key is, and data.workspace names the workspace it works in. GET /partners/mine answers only a key that acts as a partner: an organisation key is refused with 403.

When a call is refused

Branch on error.code (see Errors). These are the refusals that come from the key itself:
  • 401 AUTH_TOKEN_INVALID: There is no key, or it is not one of ours: mistyped, deleted or switched off. Check the key, or make a new one.
  • 403 AUTHZ_INSUFFICIENT_PERMISSIONS: The endpoint needs a partner key and the key is an organisation key. Use a partner key: the owner of your partner’s workspace makes one under Settings → API keys.
  • 403 API_KEY_SCOPE_MISSING: The key was limited when it was made, and this call is outside the limit. Make a new key that includes the scope (error.details.missingScopes lists what it needs).
  • 403 AUTHZ_PLAN_RESTRICTION or WORKSPACE_LOCKED: An organisation key’s workspace is in its free trial, has no plan, or is overdue. Choose a plan or update billing, and the same key works again (see Keys and your workspace plan).
  • 403 PARTNER_INACTIVE, PARTNER_SUSPENDED or PARTNER_PAYMENT_ARREARS: A partner key whose account is not in force, on a call that makes something or starts work. See Account Status.
  • 403 PARTNER_WINDING_DOWN or PARTNER_CLOSED: The partnership has ended. During the 60-day wind-down a partner key can read and export but not make or change anything (PARTNER_WINDING_DOWN); after it every call is refused (PARTNER_CLOSED). See Ending a Partnership.
  • 503 SERVICE_UNAVAILABLE: Widgetic could not check just now whether the key’s workspace is a partner’s home workspace. Try the same call again in a moment.

Make a key

1

Sign in and open the workspace

Sign in on widgetic.com and open the workspace the key is for. For a partner key, sign in with the owner login of your partner (the shared mailbox Widgetic sent the invitation to) and open your partner’s workspace, the only one it has.
2

Make the key

Open Settings → API keys (the owner of a workspace opens that page; the link opens the workspace you used last, or your first) and select Create key. Name the key after the integration it serves, such as “Checkout server” or “Support tool”, so that you know which one to rotate or delete later, and choose what it may do: Full access, Content, Read only or Custom (see Choose how much a key may do). There is no kind to choose: in your partner’s home workspace the key is a partner key, and anywhere else it is an organisation key. A key made here works for ten years.
3

Store the secret

The secret is shown once. Keep it in an environment variable or a secrets manager, never in client code or in git.
To rotate a key, make the new one, switch your servers over, then delete the old one. A key that is deleted or switched off is refused at once by the server that took the request, and within a minute by the others. The limit of a key cannot change once it is made, so widening or narrowing it is a rotation too.
Only a person signed in on widgetic.com can make a key. A request made with an API key is refused, so a leaked key cannot make a second one that outlives its revocation. If a key leaks, delete it in the dashboard and make a new one there.

Next steps

Authentication

Scopes, plans and how to limit a key

Security

Keep keys safe, and rotate or delete them

Partner overview

What a partner can build, and how to get started

Partner integration guide

The step-by-step guide for partners, with a test plan and go-live checklist