REST API

Run Promarkia squads from your product or automation stack

Create a scoped API key in Promarkia, discover available squads and connected accounts, submit one authorized task, and retrieve its result. The same account permissions and credit controls apply everywhere.

Authentication
X-API-Key: pmk_your_key

Create and revoke keys in Settings > API & MCP. Secret values are shown only once.

Core endpoints

GET

/api/external/capabilities

Inspect the enforced contract version, task modes, authorization boundaries, and supported action matrix.

GET

/api/external/squads

List the squads available to external clients, including descriptions and required integrations.

GET

/api/external/connections

List caller-bound connected accounts that can be referenced by an authorization manifest.

POST

/api/external/tasks

Submit one idempotent, authorization-bound task. Draft-only and external-action modes use different server-enforced tool policies.

GET

/api/external/runs/{runId}

Read processing, completed, or error status, including result messages, billing settlement, and any external-action receipt.

Copyable v2 quickstart

  1. Create an API key in Settings.
  2. Use the request builder below to create a digest-bound draft-only request.
  3. Submit it once with the generated idempotency key.
  4. Poll the returned run ID until completed or error.
  5. Inspect the result, final credit settlement, and any external-action receipt.
import { buildDraftOnlyRequest } from 'https://www.promarkia.com/external-api/promarkia-request-builder.mjs';

const request = await buildDraftOnlyRequest({
  squadId: '12',
  userPrompt: 'Draft an evidence-backed WordPress outline. Do not publish it.'
});

const response = await fetch('https://www.promarkia.com/api/external/tasks', {
  method: 'POST', headers: request.headers, body: JSON.stringify(request.body)
});
const accepted = await response.json();
const result = await fetch(`https://www.promarkia.com/api/external/runs/${accepted.runId}`, {
  headers: { 'X-API-Key': request.headers['X-API-Key'] }
}).then((value) => value.json());

Complete request · Processing response · Completed response · Redacted action receipt · OpenAPI 3.1

Retries and errors

Reuse the same idempotency key only for the exact same body. A changed body requires a new UUID and digest. Never retry an ambiguous external write until its run receipt is checked.

StatusMeaningAction
401Invalid or revoked keyCreate or rotate the key.
402Insufficient capacityAdd capacity, then submit a new authorization.
409Idempotency conflictDo not widen the existing request; use a new UUID.
426Unsupported contractBuild a contract v2 request.
500Server failurePoll the run before deciding whether to retry.

Designed for bounded execution

Scoped identity

Every request resolves to the Promarkia account that created the API key. Runs and artifacts remain tenant-bound.

Idempotent submissions

Task submissions require an idempotency key and a digest-bound authorization manifest so retries cannot silently widen the request.

Explicit external actions

Publishing and messaging require an allowed squad, action, destination, audience, toolkit, and connected account binding.

Receipts and billing

Promarkia reserves credits before dispatch, settles the run once, and records receipts for approved external actions.

Manage API accessUse MCP instead