API

Use the API Channel to connect MagicBlocks with your external apps or systems.

The API section allows you to generate and manage API tokens that give authorized access to MagicBlocks’ REST API. These tokens act like secure keys, letting your external tools (such as CRMs, analytics systems, or custom apps) send or fetch data from MagicBlocks.

You can use them to:

  • Retrieve conversation data and leads.
  • Send goal completions to your analytics dashboard.
  • Integrate with automation platforms (like Zapier or Make).
  • Power internal dashboards or backend workflows.

When to Use

Use the API when you want to:

  • Connect MagicBlocks with other business tools or databases.
  • Automate manual data collection or tracking.
  • Build custom analytics or performance dashboards.
  • Securely control how external systems communicate with MagicBlocks.

How It Works

Access the API Section

From the left-hand menu in your workspace:
Go to Channels › API.

You’ll land on the API management page, where you can:

  • Create new API tokens.
  • View active or expired tokens.
  • Manage or revoke access at any time.

Creating a New API Token

Click Create New.

Enter a Token Name (e.g., Zapier Connection, CRM Sync).

(Optional) Add Tags to organize tokens by project or client.

Choose the Expiration setting:

Never (default)

Or select a fixed duration (for temporary integrations).

Click Create.

Copy Your Token

Once created, MagicBlocks will generate your API Token Key:

⚠️ You’ll only see this token once.
Copy and store it securely — MagicBlocks won’t show it again for security reasons.

You can:

Click the copy icon to save it to your clipboard.

Paste it into your integration or environment variable.

Click Got it once you’ve stored it safely.

Managing Your API Tokens

On the main API page, you’ll see a list of all tokens with key details:

Field

Description

Token Name

The name you assigned to the token.

Tags

Any tags you’ve used for grouping tokens.

Last Access

Shows the last time the token was used.

Expired Date

Displays “Never” or the set expiration date.

At the top, use filters to view:

  • All Tokens
  • Active Tokens
  • Expired Tokens

Other available actions:

  • Delete: Revoke a token immediately.
  • Refresh: Update the list to view recent usage.
  • Filter / Search: Find tokens by name or tag.

💡 Tip: Create separate tokens for each integration — this helps track and manage access more securely.

Using Your API Token

You can use your API token to authenticate requests in any tool or code that supports REST APIs.

Base URL

https://api.magicblocks.com/v1/

Authentication Header

Every request must include your token in the header:

Authorization: Bearer YOUR_API_TOKEN

Example: Fetch all leads

curl -X GET "https://api.magicblocks.com/v1/leads" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example: Send a goal completion

curl -X POST "https://api.magicblocks.com/v1/goals" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"goal_name": "Demo Booked",
"value": 1
}'

View the full endpoint list and parameter guides at:
👉 MagicBlocks API Documentation

Common Use Cases

Scenario

Example

CRM Integration

Automatically send new leads to HubSpot, Salesforce, or HighLevel.

Analytics Tracking

Record conversions or goal completions in Google Analytics or custom dashboards.

Workflow Automation

Connect with Zapier or Make to trigger follow-ups or emails.

Custom Apps

Build internal dashboards that visualize your AI performance metrics.

Best Practices

  • Keep your tokens private. Never expose them in public repositories or front-end code.
  • Use one token per integration — helps isolate access and troubleshoot faster.
  • Rotate tokens periodically to maintain data security.
  • Tag tokens clearly for easy management (e.g., Analytics, CRM Sync, Zapier).
  • Delete unused tokens immediately to revoke access.

MagicBlocks API Documentation

Adding Leads via API

Was this article helpful?