The CanIPhish Public API (v3) lets you drive your tenant programmatically. You can read reporting and intelligence data — campaign results, human-risk scores, dark-web breaches, domain supply-chain posture and the tenants you can access — and manage configuration by creating, updating, deleting and duplicating campaigns, employee lists, content-library items (phishing emails, sender IDs, phishing websites, voice-phishing templates and training modules) and platform settings.
This article is a practical overview. For the complete, always-current reference — every endpoint, its parameters, request/response schemas and a “try it” console — see the interactive API reference at api-docs.caniphish.com.
Base URL
All endpoints live under:
https://api.caniphish.com/api/v3
Authentication
Every request must include two headers:
| Header | Value |
|---|---|
X-API-Key |
Your tenant API key (this is the same key used by the AI Assistant Connector — find it in your CanIPhish console settings). |
X-Email-Address |
The email address of the user the API key belongs to. |
The user identified by X-Email-Address must have access to the tenantID supplied in the request body. Each successful call consumes one unit of your tenant’s API quota.
Keep your API key secret. It grants the same access the associated user has. Store it in a secrets manager or environment variable — never commit it to source control or expose it in client-side code.
Access & authorization
Access depends on the endpoint type:
- Read & reporting endpoints (tenant lookups, campaign/training reporting, employee information, dark-web data, the domain supply-chain scan) are available to any authenticated user with access to the tenant. Some depend on the relevant feature being enabled (for example, dark-web monitoring).
-
Management / write endpoints are gated. A request is rejected with
403unless both of the following hold:-
Role — the requesting user is a Platform Admin (
AD) or Platform Super Admin (SA) on the tenant. - Entitlement — the tenant has an active Professional or Enterprise subscription, an active Enterprise trial, or is a partner-managed tenant billed under a master subscription whose master tenant holds an Enterprise subscription.
-
Role — the requesting user is a Platform Admin (
You can check both conditions up front by calling get-entitlements, which reports whether the caller is an admin and whether the tenant is write- and Enterprise-entitled — useful for a client that wants to preflight before attempting a gated call.
Request & response conventions
-
All endpoints are
POST. - Most requests take a JSON body that includes a
tenantID. A couple of read endpoints (the tenant-ID lookups) need only the authentication headers. -
Success responses are
200with a JSON object. -
Authentication / validation errors return
400with{ "Error": "message" }. -
Authorization (role / subscription) failures return
403with{ "Error": "message" }. - Errors also include a machine-readable
ErrorCode— one ofAUTH_ERROR,QUOTA_EXCEEDED,TENANT_ACCESS_DENIED,PERMISSION_DENIED,ENTITLEMENT_REQUIRED, orMISSING_REQUIRED_FIELD— so you can branch on it in code rather than parsing messages.
Quota & rate tracking
Each successful call uses one API-quota unit. Every response carries three headers so you can track consumption in real time:
X-API-Quota-Limit your tenant's quota X-API-Quota-Used units consumed so far X-API-Quota-Remaining units left
Call get-entitlements at any time to read your current plan and quota.
Working with tenants
Most actions target a specific tenant, passed as tenantID in the request body. If your API key can reach more than one tenant (for example, an MSP or partner account), first call the tenant-lookup endpoint (get-tenant-access) — which needs only the auth headers — to retrieve the tenant IDs you can access, then supply the appropriate tenantID on each subsequent call.
Quickstart
1. Find the tenants you can access (headers only):
curl -X POST https://api.caniphish.com/api/v3/account/get-tenant-access \ -H "X-API-Key: YOUR_API_KEY" \ -H "X-Email-Address: you@example.com"
2. Check your entitlements and quota:
curl -X POST https://api.caniphish.com/api/v3/account/get-entitlements \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Email-Address: you@example.com" \
-H "Content-Type: application/json" \
-d '{ "tenantID": "YOUR_TENANT_ID" }'3. List your campaigns:
curl -X POST https://api.caniphish.com/api/v3/campaigns/list-campaigns \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Email-Address: you@example.com" \
-H "Content-Type: application/json" \
-d '{ "tenantID": "YOUR_TENANT_ID" }'What you can manage
The API is organised into these areas (see the interactive reference for the full endpoint list in each):
| Area | Capabilities |
|---|---|
| Campaigns | Create, update, delete and duplicate phishing, training and combined phishing-training campaigns; send test emails; resend to campaigns or individual targets; rename/delete historic campaigns. |
| Content library | Manage phishing emails, sender IDs, phishing websites, voice-phishing templates and training modules (create, update, delete, duplicate, list, get). |
| Employee lists | Build and maintain manual, directory-synced and dynamic (risk-based) employee lists; erase employee data; set business-impact classification. |
| Reporting & intelligence | Campaign and training results, human-risk scores, leaderboards, dark-web breaches, domain supply-chain posture, audit and SMTP logs, on-demand and scheduled PDF reports. |
| Reported phishing | List and retrieve employee-reported emails, triage them, mark false positives, and clone a reported email into a template. |
| Settings & configuration | Phishing education, phish-reporting, training, leaderboard, appearance/white-label, language, MFA and SSO, email delivery, sending domains, directory integrations, and quarantine credentials. |
| Webhooks | Configure an HTTPS endpoint to receive phishing and training events. |
| Account | Entitlements and quota, user profile, and the tenants your key can access. |
Common workflows
Chain endpoints in order to complete an end-to-end task:
-
Run a phishing simulation —
create-employee-list→create-sender-id→create-phishing-email→create-phishing-website→create-phishing-campaign; later pull results withget-campaign-results. -
Assign training —
create-employee-list→ (optional)create-training-module→create-training-campaign; track withget-training-resultsandget-training-certificate. -
Combined phishing + training — as above, but with
create-phishing-training-campaign. -
Onboard employees from a directory —
list-directory-integrations→get-directory-groups→create-employee-list(withlistSource: "directory"). -
Authorise a sending domain —
request-domain-verification→verify-domain→lock-domain; the domain can then back sender IDs and phish reporting. -
Compliance reporting —
generate-reportfor an on-demand PDF, orupdate-scheduled-reportsfor recurring delivery (recipients must be on verified domains). -
Event-driven integration —
update-webhookwith an HTTPS endpoint to receive phishing/training events. -
Preflight what you can do —
get-entitlementsbefore attempting gated calls.
Error handling
Handle failures by status code and ErrorCode:
| Status | Meaning | Typical ErrorCode
|
What to do |
|---|---|---|---|
400 |
Authentication or validation problem |
AUTH_ERROR, MISSING_REQUIRED_FIELD
|
Check your headers, tenantID, and required fields. |
403 |
Role or subscription not sufficient |
PERMISSION_DENIED, ENTITLEMENT_REQUIRED, TENANT_ACCESS_DENIED
|
Confirm the user is an admin, the plan is entitled, and the user has access to the tenant (get-entitlements). |
| quota | Quota exhausted | QUOTA_EXCEEDED |
Slow down and check the X-API-Quota-Remaining header; quota resets per your plan. |
Best practices
-
Preflight with
get-entitlementsbefore write operations to avoid predictable403s. - Watch the quota headers on every response and back off before you hit the limit.
- Use returned names in follow-up calls. Some resources (for example campaign names) are sanitised on save — use the value returned in the response, not the string you sent, for later get/update/delete calls.
- Verify domains before using them for sender IDs, phish reporting, or scheduled-report recipients.
- Secure your key and rotate it if it may have been exposed.
Need help?
The full, interactive reference — with every endpoint, schema and a live “try it” console — is at api-docs.caniphish.com. If you get stuck, contact CanIPhish support with the endpoint, request body (with your API key removed) and the Error/ErrorCode you received, and we’ll help you resolve it.
Comments
0 comments
Please sign in to leave a comment.