Skip to main content

Authentication

Learn how the API authentication works with generating and using your API key

Bryce DeCora avatar
Written by Bryce DeCora
Updated over a week ago

CloseBot has a near 100% functional API, this means that almost anything you can do within the application interface can be done programmatically (some things, like adding a CRM specific source, do require OAuth flows that are not API compatible).

While this document will not explore all API endpoints, it will show how to generate an API key, how to structure your API call headers, and an example call to get you started!

To see all endpoints, check out the full API documentation HERE.

Getting a CloseBot API Key

All API keys are user account specific, this means that team members can also create their own API keys without getting access to owner related end points. To get your key, navigate to https://app.closebot.com/settings?tab=keys

Press the blue plus button on the top of the table. This will open a modal that allows you to name the key

After naming we will give you the key! Remember: we only give this key one time, if you ever lose the value, you will need to generate a new key.

Setting up your key in API call headers

CloseBot has a standard but unique header structure. For all API calls, the Key is used this way:

Authorization: Key {YOUR KEY HERE}

For PUT and POST API calls, the header also requires:

Content-Type: application/json

Making your first API call

Using curl, here are two basic API calls.

Listing the current sources your account has access to (GET):

curl https://api.closebot.com/agency/source -H "Authorization: Key {YOUR KEY}"

Updating a source to disable image summarizing (PUT):

curl -X PUT https://api.closebot.com/agency/source/{SOURCE_ID} -H "Authorization: Key {YOUR KEY}" -H "Content-Type: application/json" -d '{"summarizeAttachments": false}'

Remember, the full list of endpoints can be found HERE. These above are just examples.

Summary

Almost everything that can be done or viewed from CloseBot's user interface can also be done through the API. Have fun automating! Using the API, you'll start to see the full capabilities CloseBot offers!

Did this answer your question?