Connect your systems to Marcomm AI
Read news digests, critical news and pending approvals from your own systems, and approve or reject from your own approval tools. The API is available on the Team plan and above, after a short review.
Get started
- 1Apply for access
Describe your system and pick the data you need. We review every application.
- 2Create a key
After approval, create a key in Settings, API. The key is shown once, so store it in your system.
- 3Send a request
Send the key in the Authorization header and call any endpoint below.
Example request
curl https://app.marcomm.works/api/v1/news/digest?days=7 \
-H "Authorization: Bearer mc_live_..."Authentication
Send your key as a Bearer token with every request. A personal key acts as the person who created it, so it can read and decide approvals in that person's name. A workspace key is created by an admin and can only read. Keys can expire, can be limited to IP addresses, and can be rotated: the old key keeps working for 24 hours after a rotation.
Scopes
Each key carries only the scopes your application was approved for.
- news
- News digest, articles and outlets.
- crisis
- Critical news and crisis incidents.
- approvals
- Pending approvals, and approving or rejecting them with a personal key.
- content
- Reading press releases and blog posts.
Endpoints
Every path starts with /api/v1. Read endpoints use GET and take query parameters. A response is JSON in the form {"data": ...}.
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /api/v1/news/digest | news | Coverage volume, sentiment and top outlets for a period. |
| GET | /api/v1/news/articles | news | Search news coverage. |
| GET | /api/v1/news/outlets | news | Media outlets that cover your companies. |
| GET | /api/v1/crisis/incidents | crisis | Crisis incidents and critical articles. |
| GET | /api/v1/approvals | approvals | Press releases and blog posts waiting for the key owner, and the ones the key owner asked to have approved. |
| GET | /api/v1/press-releases | content | List press releases. |
| GET | /api/v1/press-releases/{id} | content | One press release with its lead paragraph and text. |
| GET | /api/v1/blog-posts | content | List blog posts. |
| GET | /api/v1/blog-posts/{id} | content | One blog post with its text. |
| POST | /api/v1/approvals/press-releases/{id} | approvals | Approve or reject a press release that is waiting for the key owner. |
| POST | /api/v1/approvals/blog-posts/{id} | approvals | Approve or reject a blog post that is waiting for the key owner. |
Approve and reject
Send {"decision": "approve"} or {"decision": "reject", "comment": "..."} to the item. Rejecting needs a comment. The decision follows the same rules as the app and Slack, and it is recorded under the key owner. When the text contains phrases that need confirmation, you receive 409 confirmation_required with the warnings, and you can send the request again with "force": true.
curl -X POST https://app.marcomm.works/api/v1/approvals/press-releases/<id> \
-H "Authorization: Bearer mc_live_..." \
-H "Content-Type: application/json" \
-d '{"decision":"reject","comment":"Please fix the headline."}'Rate limits
Limits are set per workspace, per minute and per day (UTC). Every response carries the headers below. Past a limit you receive 429 with Retry-After. To raise a limit, request an increase in Settings, API. Our team reviews it.
- X-RateLimit-Limit
- Requests allowed per minute.
- X-RateLimit-Remaining
- Requests left in the current minute.
- X-RateLimit-Reset
- Unix time when the minute window resets.
- X-RateLimit-Day-Limit
- Requests allowed per day.
- X-RateLimit-Day-Remaining
- Requests left today.
- Retry-After
- Seconds to wait before trying again. Only on 429.
Errors
Errors return JSON in the form {"error": {"code": ..., "message": ...}}.
| Code | Status | Meaning |
|---|---|---|
| invalid_key | 401 | The key is missing, malformed or revoked. |
| expired | 401 | The key has expired. Create or rotate a key. |
| ip_denied | 403 | The key is limited to other IP addresses. |
| plan_required | 403 | The workspace is not on the Team plan or above. |
| access_required | 403 | API access is not approved for this workspace. |
| suspended | 403 | API access for this workspace is suspended. |
| scope_denied | 403 | The key does not have the scope this endpoint needs. |
| personal_key_required | 403 | Only a personal key can approve or reject. |
| denied | 403 | The key owner's role does not allow this. |
| unknown_endpoint | 404 | There is no such endpoint. |
| comment_required | 400 | A reason is required to reject. |
| confirmation_required | 409 | Warnings need confirmation. Resend with force set to true. |
| rate_limited | 429 | The per-minute limit was exceeded. |
| daily_limit | 429 | The daily limit was reached. |
Webhooks
Alerts, approval requests and the morning briefing can also be pushed to your system. Add a destination in Settings, API, Webhooks. Each request is JSON with the fields event (alert, approval or briefing), workspace, title, text, url, data and sentAt. An approval request carries data.kind (press_release, blog or event) and data.id, which you can use to read and decide through the API.
Each request is signed. Compute the HMAC-SHA256 of the raw request body with your signing secret and compare it to the X-Marcomm-Signature header, which has the form sha256=<hex>. Reject requests that do not match.
Verifying a webhook in Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';
export function isFromMarcomm(rawBody: string, signature: string, secret: string) {
const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex');
const a = Buffer.from(expected);
const b = Buffer.from(signature);
return a.length === b.length && timingSafeEqual(a, b);
}Connection guides
Approve from your approval system
- Add a generic webhook destination and turn on approval requests.
- When an approval webhook arrives, verify the signature and read data.kind and data.id.
- Show the request in your approval system. Read the text with GET press-releases/{id} or blog-posts/{id} if you need it.
- Send the decision with a personal key of the person who decides. Events and email sends are decided in the app through the link in the message.
Feed the news digest into your dashboard
- Create a workspace key with the news and crisis scopes.
- Call news/digest on a schedule, for example every morning.
- Call crisis/incidents more often if you want your own alerting. Watch the X-RateLimit headers so you stay within your limits.
Alerts in your chat
- For Teams and Google Chat, create the room's webhook URL and add it as a destination in Settings, API, Webhooks.
- For JANDI, Dooray! and Chatwork, connect them from Settings, Integrations.
- Choose which of alerts, approval requests and the morning briefing each destination receives, then send a test message.
Ready to connect?
A workspace owner or admin applies in Settings, API. You are notified by email and in the app when the review is done.
Open API settings