Skip to content
MarcommAI
Developers

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

  1. 1
    Apply for access

    Describe your system and pick the data you need. We review every application.

  2. 2
    Create a key

    After approval, create a key in Settings, API. The key is shown once, so store it in your system.

  3. 3
    Send 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": ...}.

MethodPathScopeWhat it does
GET/api/v1/news/digestnewsCoverage volume, sentiment and top outlets for a period.
GET/api/v1/news/articlesnewsSearch news coverage.
GET/api/v1/news/outletsnewsMedia outlets that cover your companies.
GET/api/v1/crisis/incidentscrisisCrisis incidents and critical articles.
GET/api/v1/approvalsapprovalsPress releases and blog posts waiting for the key owner, and the ones the key owner asked to have approved.
GET/api/v1/press-releasescontentList press releases.
GET/api/v1/press-releases/{id}contentOne press release with its lead paragraph and text.
GET/api/v1/blog-postscontentList blog posts.
GET/api/v1/blog-posts/{id}contentOne blog post with its text.
POST/api/v1/approvals/press-releases/{id}approvalsApprove or reject a press release that is waiting for the key owner.
POST/api/v1/approvals/blog-posts/{id}approvalsApprove 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": ...}}.

CodeStatusMeaning
invalid_key401The key is missing, malformed or revoked.
expired401The key has expired. Create or rotate a key.
ip_denied403The key is limited to other IP addresses.
plan_required403The workspace is not on the Team plan or above.
access_required403API access is not approved for this workspace.
suspended403API access for this workspace is suspended.
scope_denied403The key does not have the scope this endpoint needs.
personal_key_required403Only a personal key can approve or reject.
denied403The key owner's role does not allow this.
unknown_endpoint404There is no such endpoint.
comment_required400A reason is required to reject.
confirmation_required409Warnings need confirmation. Resend with force set to true.
rate_limited429The per-minute limit was exceeded.
daily_limit429The 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

  1. Add a generic webhook destination and turn on approval requests.
  2. When an approval webhook arrives, verify the signature and read data.kind and data.id.
  3. Show the request in your approval system. Read the text with GET press-releases/{id} or blog-posts/{id} if you need it.
  4. 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

  1. Create a workspace key with the news and crisis scopes.
  2. Call news/digest on a schedule, for example every morning.
  3. 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

  1. For Teams and Google Chat, create the room's webhook URL and add it as a destination in Settings, API, Webhooks.
  2. For JANDI, Dooray! and Chatwork, connect them from Settings, Integrations.
  3. 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