Client CraftClient Craft HubStart free

Create workspace API keys and webhooks

On this page
Updated 24 Nov 20264 min read

Create scoped API keys, call the CRM API with them, add signed webhooks, and test, pause, rotate or revoke them in Settings › Integrations.

Plan: All plans. You need to be an administrator or have the Integrations settings area

API keys let your own software read and write the workspace's CRM data. Webhooks send a signed POST to your URL when something changes, such as a new lead or a deal moving stage. Both belong to one workspace only, and only a person can create or revoke them: a key can never manage other keys.

Before you start #

  • You are a tenant administrator of the workspace, or the Integrations settings area is delegated to you. Otherwise you see "Only people who manage Integrations can see API keys." Ask a workspace admin for access.

Step by step #

  1. 1
    Open IntegrationsIn the Client Craft section, open Settings › Integrations. Below Connected apps you find the API keys and Webhooks cards.
  2. 2
    Create a keySelect Create API key. Enter a Name (up to 80 characters, such as the app that uses it), tick only the Scopes the app needs, choose Expires (Never, In 30 days, In 90 days or In 1 year) and select Create key. A workspace can hold up to 25 keys.
    ScopeAllows
    contacts:readRead contacts
    companies:readRead companies
    leads:readRead leads
    leads:writeCreate leads (POST to the leads collection only)
    deals:readRead deals

    Access is denied by default. Bulk, export, import, merge, attachment, file and settings routes are refused for every key, whatever its scopes.

  3. 3
    Copy the key onceThe dialog says Shown once. Only a fingerprint is stored, so the value can't be shown again. Select Copy, store the key in your secret manager, then I've copied it. Keys start with cc_live_; the list shows only a masked key.
  4. 4
    Call the APISend the workspace id in X-Tenant and the key in X-Integration-Key. A workspace key is a machine credential: it never acts as a person, so don't send X-User.
    bash
    1# List the first page of leads (needs leads:read). Keep the key on the server.
    2curl "https://api.client-craft.com/api/v1/crm/leads?page=1&pageSize=20" \
    3 -H "X-Tenant: <workspace-id>" \
    4 -H "X-Integration-Key: $CLIENTCRAFT_API_KEY"

    Refusals are explicit: api_key_scope_denied (missing scope, or the route isn't open to keys), api_key_workspace_mismatch (X-Tenant names another workspace) and api_key_cannot_act_as_user (a person header was sent). An expired key returns 401.

  5. 5
    Confirm the key worksAfter the first call, reload Settings › Integrations. Last used is updated at most every five minutes per key. Creating and revoking keys is written to the Audit log.
  6. 6
    Rotate or revoke a keyKeys are never edited in place. To rotate, create a new key with the same scopes, deploy it, check that its Last used moves, then select Revoke on the old row and confirm with Revoke key. Apps using the revoked key stop working at once; this can't be undone.
  7. 7
    Add a webhookIn Webhooks, select Add webhook. Enter a Name and an Endpoint URL that starts with https:// and accepts POST requests. Under Events, tick the events you want, or leave all unticked to receive every event. Select Add webhook.

    The Signing secret (it starts with ucrm_whsec_) is shown once. Copy it now; you need it to verify the X-uCRM-Signature header. See Receive and verify CRM webhook events.

  8. 8
    Test and manage the endpointSelect Details on the webhook row:
    • Send test event posts a signed test event and reports the status code and time. No records change.
    • Pause and Resume stop or restart new deliveries.
    • Roll secret issues a new signing secret.
    • Delete stops all deliveries; past deliveries stay in the history.

    The Delivery log lists recent events with the response and the number of attempts. The status is Active, Failing or Paused.

NoteIf saving a webhook shows "Event delivery isn't switched on for this workspace yet", choose Save paused and use test events until delivery is enabled.
TipWhen a call is refused, read the code in the response body before you create a broader key. A 401 with Missing integration key. means the header never reached the API, often because a proxy removed it.

What happens next #

Receive and verify CRM webhook events.

Was this article helpful?