API keys, webhooks and callback URLs
API keys let your website, app and backend talk to Contlo: to track what shoppers do, keep contacts up to date and trigger messages at the right moment. Contlo has two kinds of key, one that is safe to expose and one that must stay secret. This article shows where to find them, how to manage them, and where to set up webhooks and callback URLs.
الأدلة متوفرة باللغة الإنجليزية.
Public and private keys
Used when your account is accessed from JavaScript, such as the tracking script on your store. It identifies your account. It is safe to share and to appear in your site's code.
Used when you want to grant access to, and edit, sensitive data on your Contlo account. Use them only from your own servers and trusted tools.
| Public API Key | Private API Keys | |
|---|---|---|
| How many | One per account | As many as you need, each with its own name |
| Shown on screen | In full | Masked. Use the copy button to get the value |
| Can you create or delete it | No | Yes |
| Where it belongs | Website and app code | Server-side code and secure integrations only |
Open API Keys
- Open the account menu in the top bar and choose Settings.
- Choose Marketing Settings in the left menu.
- Open the API Keys tab.
If you see "Settings are managed by the account owner", your role doesn't include these settings. Ask the account owner for the key you need, or see Team and roles.
Copy your public key
The Public API Key card at the top of the tab shows your key. Click Copy to put it on your clipboard. You see "API Key Successfully Copied!".
You need this key when you add Contlo tracking to your website. See Install web tracking and Track events and identify. For apps, see Mobile SDKs.
Create a private key
The Private API Keys table lists every private key with its Name, masked API Key, Created At date and actions. Your account starts with one private key already in the list.
- Click Create API Key.
- In Key name, give the key a name that says what it is for, for example
Order syncorData warehouse. - Click Create. The new key appears in the table.
- Click the copy button beside the masked key and paste it into the tool or code that needs it.
Use a different name for each key. If you create a key with a name that is already in the list, no new key is added.
Rename or revoke a private key
Rename
Click the key's name or Edit, change the name in Edit API Key Name and click Update. Only the name changes. The key value stays the same, so nothing that uses it needs updating.
Revoke
- Open More actions on the key's row and choose Delete.
- Check the name in the Delete API Key confirmation.
- Click Yes, Delete.
Keep private keys secret
- Never put a private key in website code, a mobile app, or anything else a visitor can download. Use the public key there.
- Don't paste private keys into email, chat or support tickets. Contlo will not ask you for one.
- Store keys in your server's secret storage or environment settings, not in source code.
- If a key may have been exposed, create a new one, update your integration, then delete the exposed key.
- Delete keys that are no longer used.
For what you can do with a private key, including authentication and the available endpoints, see the REST API article.
Webhooks and callback URLs
There is no separate webhook page in Settings. Contlo sends and receives data through URLs in three places, depending on what you want to do.
| What you want | Where to set it up | How it works |
|---|---|---|
| Send data from Contlo to your own system when something happens | The Webhook action in an automation | Contlo sends customized data to an external URL with a POST request. You set the Destination URL, any Request Headers and the Request Body on the action. See Automation triggers and actions. |
| Let another app send data into Contlo | The app's page in the App Market | Some integrations show a Webhook URL to copy and paste into the other app's dashboard. See Integrations catalog. |
| Get SMS delivery and click data back from your SMS vendor | Callback URL in SMS settings | For TrustSignal accounts, you copy the Callback URL from Contlo and paste it in your vendor dashboard. Open it again from the account's menu under Connected accounts. See SMS setup and settings. |
Common questions
| Question | Answer |
|---|---|
| Can I see a private key in full on screen? | No. Private keys are always masked in the table. The copy button copies the full value. |
| "Please enter a key name" | The name is required when you create or rename a key. |
| Can I change my public key? | Not from Settings. If you believe you need a new one, write to hello@contlo.com. |
| My integration stopped working after I cleaned up keys | The key it used was probably deleted. Create a new private key and update the integration with it. |
أدلة ذات صلة
- REST APISend contacts and events to Contlo from your server: authentication, the identify and track endpoints, request and response examples, limits and errors.
- Install web trackingAdd the Contlo tracking snippet to a custom site, see what it records automatically, verify the install and review the cookies it sets.
- Track events and identify visitorsUse the Contlo browser methods to tell Contlo who a visitor is and what they did, then use those events in segments, automations and analytics.
- Automation triggers and actions referenceEvery trigger, filter, condition, message block and flow action in the automation builder, with what each one does and its options.