Customer Management

Programmatically create and manage customers with the MCP API

Customer Management Overview

The Customer Management API allows you to programmatically create customers, enable portal access, and manage their credentials. This is perfect for automated onboarding workflows triggered by ad campaigns, lead forms, or AI agents.

Automated customer creation
Auto-generated credentials
Secure portal access

Typical Workflow

1

Create Customer

Use the create customer endpoint to add a new customer to your partner account. The system automatically generates a unique customer ID.

2

Enable Portal Access

Enable portal access for the customer using their customer ID. This generates secure login credentials and provides the portal URL.

3

Share Credentials

Share the portal URL and credentials with your customer. You can optionally have the system send an email automatically.

POST
https://analytics.knotie-ai.pro/mcp/customers

Create Customer

Create a new customer account with automatic ID generation

Request Body

{
  "email": "[email protected]",
  "first_name": "John",
  "last_name": "Doe",
  "company_name": "Acme Corp"
}

Response

{
  "success": true,
  "customer_id": "uuid-generated-id",
  "email": "[email protected]",
  "message": "Customer created successfully"
}

cURL Example

curl -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Partner-Email: [email protected]" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","first_name":"John","last_name":"Doe","company_name":"Acme Corp"}' \
  https://analytics.knotie-ai.pro/mcp/customers
POST
https://analytics.knotie-ai.pro/mcp/customers/portal-access

Enable Portal Access

Enable customer portal access with auto-generated secure credentials

Request Body

{
  "customer_id": "uuid-from-create-customer",
  "send_email": false
}

Response

{
  "success": true,
  "email": "[email protected]",
  "portal_url": "https://subdomain.knotie-ai.pro",
  "password": "auto-generated-secure-password",
  "message": "Portal access enabled successfully"
}

cURL Example

curl -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Partner-Email: [email protected]" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"uuid-from-create-customer","send_email":false}' \
  https://analytics.knotie-ai.pro/mcp/customers/portal-access
POST
https://analytics.knotie-ai.pro/mcp/customers/reset-password

Reset Password

Reset customer portal password with new auto-generated credentials

Request Body

{
  "customer_id": "uuid-from-create-customer",
  "send_email": false
}

Response

{
  "success": true,
  "new_password": "new-auto-generated-password",
  "message": "Password reset successfully"
}

cURL Example

curl -X POST \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Partner-Email: [email protected]" \
  -H "Content-Type: application/json" \
  -d '{"customer_id":"uuid-from-create-customer","send_email":false}' \
  https://analytics.knotie-ai.pro/mcp/customers/reset-password

Best Practices

Security

  • • Always validate email addresses before creating customers
  • • Store customer IDs securely for future API calls
  • • Use HTTPS for all API communications
  • • Never expose API keys in client-side code

Email Handling

  • • Set send_email: false to handle credentials manually
  • • Use your own email templates for better branding
  • • Include portal URL and credentials in welcome emails
  • • Consider password reset workflows for customers