Customer Task via Admin API
Allow Admins to perform customer-level tasks securely using their Admin API key and a customer ID header.
π Perform Customer Tasks via Admin API Key
Allow admins to perform any customer-level operation by reusing existing customer endpoints. This is done securely using X-ADMIN-API-KEY and X-CUSTOMER-ID headers.
πΉ How It Works
Admin can call any customer API endpoint like API-URL/lists, API-URL/contacts, etc., by sending:
X-ADMIN-API-KEYin the header (for admin authentication)X-CUSTOMER-IDin the header (to impersonate customer context)
The system detects these headers, validates them, and routes the request through existing customer workflows.
π₯ Example: Get Contact Lists as Admin
πΉ HTTP Request
GET API-URL/lists
π Authorization Header
X-ADMIN-API-KEY
string
Yes
Valid admin API key
X-CUSTOMER-ID
string
Yes
Customer UID to impersonate
π» PHP Example
π¦ Sample JSON Response
π Example: Create a List as Admin
πΉ HTTP Request
POST API-URL/lists
π Authorization Header
X-ADMIN-API-KEY
string
Yes
Valid admin API key
X-CUSTOMER-ID
string
Yes
Customer UID to impersonate
πΈ POST Parameters
name
string
Yes
Name of the list
description
string
No
Optional list note
π» PHP Example
π¦ Sample JSON Response
π Notes
Works for all HTTP verbs:
GET,POST,PUT,DELETEAdmin access is controlled strictly via headers
Always log admin impersonation actions
Last updated