PermuteDocs
Go to Permute

Versioning · resourcesPublish

Publish the current tested resource

Pass the version token from the latest history read. Publishes the current operation draft after a successful run, or a completed Data Flow through its existing graph checks. Enables delivery and its configured schedule without starting a run. Publish Data Flow children through their parent. Dashboard source has no separate publication step.

POST/v1/resources/{resourceId}/publish
betaapiKeyworkspace

When to use

Publish a successfully tested operation or Data Flow.

For agents

Run and inspect the current draft first, then read its version token and publish. Publication enables the configured schedule and delivery without starting a run. Publish children through their parent Data Flow. Dashboard source has no separate publish action.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);

const history = await client.revisions.list('oper_revenue123');
const result = await client.revisions.publish('oper_revenue123', { expectedVersion: history.version });

Request body

json
{
  "expectedVersion": "opaque-version-token"
}

Response

json
{
  "data": {
    "resourceId": "oper_revenue123",
    "version": "opaque-version-token",
    "draft": {
      "revisionId": "rvsn_code123",
      "sequence": 1
    },
    "published": {
      "revisionId": "rvsn_code123",
      "sequence": 1
    },
    "capabilities": {
      "history": true,
      "restore": true,
      "publish": true
    }
  }
}