Publishers API Documentation
Overview
The Publishers API lets you create publishers, view publishers, and update the publisher you are authorized to access.
All authenticated users can read publisher records. Admin users can create publishers.
Publisher account admins can update
basic publisher settings (name, domain) and network API keys and credentials.
Admin users can additionally update admin-only publisher settings such as account_manager_id,
application_requests_enabled, hide_deals, link_generator_enabled,
slack_channel, description, agent_prompt, and last_paid_at.
Authorization
- Create: admin users can create publishers.
- Show: any authenticated user can view a publisher.
- Update: you can only update the publisher associated with your account, or any publisher if you are an admin. The special HiEnergy publisher cannot be updated by non-admins.
MCP Server
Prefer calling these workflows from an MCP-compatible client? The MCP server exposes the named create_publisher tool and the generic api_request bridge for the wider API surface.
Endpoints
Create publisher
POST/api/v1/publishers
Admin-only. Send a publisher object with at least a name.
Show publisher
GET/api/v1/publishers/:id
:id can be numeric ID or slug.
Update publisher
PATCH/api/v1/publishers/:id
Send publisher object with profile or credential attributes to update.
Authentication
X-Api-Key: YOUR_API_KEY
Sign in to get your API key.
API Playground
Use the table below to see how to perform common actions. Click Test to run a GET request and preview the JSON response, or Open to open the URL in a new tab. PATCH requests must be sent with a JSON body (e.g. via curl or your app). Sign in to enable live testing with your API key.
| Action | Method | Endpoint | Description |
|---|---|---|---|
| Create publisher | POST |
/api/v1/publishers |
Admin-only. Send a JSON body with a publisher object containing at least a name. |
| Show publisher | GET |
/api/v1/publishers/:id |
Get publisher by numeric ID or slug. :id required. |
| Update publisher | PATCH |
/api/v1/publishers/:id |
Send JSON body with the publisher fields your role can edit (publisher admins: basic fields and network keys; admins: all publisher settings). |
GET /api/v1/publishers/:id
v1
Show publisher (use your publisher ID when signed in).
Create/Update Parameters
Pass a publisher object. name is required for create requests. All other fields are optional, but your role determines which attributes may be updated.
| Parameter | Type | Description |
|---|---|---|
name | string | Publisher display name. Publisher account admins and admin users can update this. |
domain | string | Primary domain. Publisher account admins and admin users can update this. |
description | string | Admin only. Publisher description text. |
agent_prompt | string | Admin only. Prompt text exposed for agent workflows. |
account_manager_id | integer | Admin only. Assigned account manager user id. |
application_requests_enabled | boolean | Admin only. Whether application requests are enabled. |
hide_deals | boolean | Admin only. Hide this publisher's deals from public/API deal surfaces. |
link_generator_enabled | boolean | Admin only. Show the Link Builder tab for publisher users. |
slack_channel | string | Admin only. Slack routing channel for the publisher. |
last_paid_at | datetime | Admin only. Most recent publisher payment timestamp. |
Network credentials are editable by publisher account admins and admin users. These include fields such as flexoffers_api_key, cj_pid, cj_access_token, partnerize_api_key, partnerize_publisher_id, pepperjam_api_key, pepperjam_version, rakuten_client_id, rakuten_client_secret, rakuten_id, awin_account_id, awin_oauth_token, levanta_api_key, tradetracker_customer_id, hubspot_account_id, and the other supported credential fields accepted by PATCH. These values are write-only through the API and are not returned in responses. | ||
Response Format
JSON:API-style data with publisher attributes. Responses include name, domain, account_manager_id, description, agent_prompt, slug, application_requests_enabled, hide_deals, link_generator_enabled, slack_channel, last_paid_at, and updated_at. Network credential values are intentionally omitted from GET and PATCH responses. Example GET response:
{
"data": {
"id": "42",
"type": "publisher",
"attributes": {
"name": "My Affiliate Site",
"domain": "mysite.com",
"account_manager_id": 7,
"description": "Creator commerce publisher",
"agent_prompt": "Prioritize creator-first programs.",
"slug": "my-affiliate-site",
"application_requests_enabled": true,
"hide_deals": false,
"link_generator_enabled": true,
"slack_channel": "#publisher-team",
"last_paid_at": "2026-02-07T00:00:00.000Z",
"updated_at": "2024-06-15T14:30:00.000Z"
}
}
}
HTTP Examples
Copy-paste examples for common operations. Replace YOUR_API_KEY and :id with your values.
By numeric ID
curl -X GET "https://app.hienergy.ai/api/v1/publishers/42" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
By slug
curl -X GET "https://app.hienergy.ai/api/v1/publishers/my-affiliate-site" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
API key as query parameter
curl -X GET "https://app.hienergy.ai/api/v1/publishers/42?api_key=YOUR_API_KEY" \
-H "Content-Type: application/json"
Update name only
curl -X PATCH "https://app.hienergy.ai/api/v1/publishers/42" \
-H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"publisher": {"name": "Updated Site Name"}}'
Publisher account admin update: domain and network keys
curl -X PATCH "https://app.hienergy.ai/api/v1/publishers/42" \
-H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"publisher": {"domain": "newsite.com", "flexoffers_api_key": "fo_xxx", "partnerize_api_key": "pr_xxx"}}'
Admin-only update: publisher settings
curl -X PATCH "https://app.hienergy.ai/api/v1/publishers/42" \
-H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"publisher": {"application_requests_enabled": true, "hide_deals": false, "link_generator_enabled": true, "slack_channel": "#publisher-team", "description": "Creator commerce publisher", "agent_prompt": "Prioritize creator-first programs.", "last_paid_at": "2026-02-07", "account_manager_id": 7}}'
GET
const response = await fetch('https://app.hienergy.ai/api/v1/publishers/42', {
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' }
});
const data = await response.json();
PATCH
const response = await fetch('https://app.hienergy.ai/api/v1/publishers/42', {
method: 'PATCH',
headers: { 'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ publisher: { name: 'New Name', flexoffers_api_key: 'your_key' } })
});
const data = await response.json();
GET
import requests
response = requests.get('https://app.hienergy.ai/api/v1/publishers/42', headers={'X-Api-Key': 'YOUR_API_KEY'})
data = response.json()
PATCH
import requests
response = requests.patch('https://app.hienergy.ai/api/v1/publishers/42',
headers={'X-Api-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json'},
json={'publisher': {'name': 'New Name', 'domain': 'example.com'}})
data = response.json()
401 Unauthorized
{"error": "Unauthorized", "message": "Invalid or missing API credentials"}
403 Forbidden
{"error": "Forbidden", "message": "You are not authorized to update this publisher"}
404 Not Found
{"error": "Not Found", "message": "Publisher not found"}
Network Credentials
The API accepts all supported network API key fields (e.g. cj_pid, cj_access_token, rakuten_client_id, impact_account_sid, partnerize_api_key, flexoffers_api_key, pepperjam_api_key, sas_*, avantlink_*, skimlinks_*, webgains_*, tradedoubler_*, tradetracker_*, levanta_*, linkconnector_api_key, optimise_*, loyalize_*, digidip_*, hubspot_access_token, hubspot_account_id). Use PATCH to update them. GET responses never include the credential values.
Error Handling
- 401 Unauthorized: missing or invalid API key.
- 403 Forbidden: not allowed to update this publisher.
- 404 Not Found: publisher id or slug does not exist.
- 422 Unprocessable Entity: validation errors; response includes errors array.
Frequently Asked Questions
GET /api/v1/publishers/:id where :id is the publisher numeric ID or slug. Include your API key in the X-Api-Key header. The response includes profile fields such as name, domain, account_manager_id, description, agent_prompt, slug, application_requests_enabled, hide_deals, link_generator_enabled, slack_channel, last_paid_at, and updated_at. Network credential values are not returned.PATCH /api/v1/publishers/:id with a JSON body containing a publisher object. You can include any network credential fields such as flexoffers_api_key, cj_pid, cj_access_token, partnerize_api_key, pepperjam_api_key, pepperjam_version, and all other supported network key attributes. Only send the fields you want to change.