Partner API

Run a Morphic workflow from your own systems over HTTPS.

The Partner API starts a Morphic workflow from your own software. You read a workflow's input contract, start a run with your inputs, then follow the run, by polling it or by receiving a webhook, until it hands back its finished assets.

Early access. v1 is live. Field names and limits can still change. Build against it and tell us what does not fit.

What a workflow is

A workflow is a recipe your team authors in Morphic: a sequence of generation steps that takes named inputs and produces finished assets. This API starts one from your systems and collects its output. It does not author workflows; that stays in Morphic, where the people who own the creative decisions work.

The shape of an integration

sequenceDiagram
  participant You as Your system
  participant M as Morphic API
  You->>M: GET workflow inputs
  M-->>You: the inputs to collect
  You->>M: POST workflow run
  M-->>You: 202 + run id
  loop until terminal
    You->>M: GET workflow run
    M-->>You: status, then assets
  end

What you need before you start

ValueWhere it comes from
API keyan admin of your Morphic organization creates it under Settings > API keys; the key is shown once
Base URLhttps://api.morphic.com/v1/partner, also shown on the API keys page in Morphic. See Environments for staging
org_idyour Morphic organization, shown with a Copy button on the API keys page
project_idthe canvas the runs land in: open it in Morphic and copy the id from its URL, …/editor/<project_id>/canvas (the id in a /projects/… URL is a different one)
workflow_idthe workflow you were asked to run

There is no file upload

You never upload bytes to us. Every file input is a public HTTPS link that we fetch and verify. See Passing files by URL. That keeps one contract for images, video, audio and documents, and it means your CDN stays the origin of your own content.

Quick start

A whole integration in three calls:

BASE_URL="https://api.morphic.com/v1/partner"  # a mor_test_ key uses https://api.morphic.today/v1/partner

# 1. what this workflow needs
curl -s "$BASE_URL/workflows/$WORKFLOW_ID/inputs" \
  -H "Authorization: Bearer $MORPHIC_API_KEY"

# 2. start the run
curl -s -X POST "$BASE_URL/workflow-runs" \
  -H "Authorization: Bearer $MORPHIC_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "org_id": "'"$ORG_ID"'",
    "project_id": "'"$PROJECT_ID"'",
    "workflow_id": "'"$WORKFLOW_ID"'",
    "idempotency_key": "story-48213-v2",
    "inputs": {
      "story_document": "https://cdn.example.com/stories/48213.pdf",
      "tone": "thriller"
    }
  }'

# 3. follow it to a terminal status
curl -s "$BASE_URL/workflow-runs/$RUN_ID?wait=45" \
  -H "Authorization: Bearer $MORPHIC_API_KEY"

A production integration adds:

  • An idempotency_key per unit of work, stored with your own record, so a retry after a timeout cannot start a second run.
  • The run id saved against that record before you do anything else. It is the only handle on work you are already being billed for.
  • A webhook, with polling kept as the fallback for runs you have not heard about.
  • Assets downloaded to your own storage on arrival, because url expires.
  • x-morphic-trace-id logged on every response.

If you have any trouble or have any questions, feel free to reach out. We're happy to help. Write to us at support@morphic.com.

On this page