Skip to main content
POST
/
v1
/
workspaces
/
{workspaceId}
/
pipelines
Create a reusable pipeline configuration
curl --request POST \
  --url https://api.erna.ai/v1/workspaces/{workspaceId}/pipelines \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "name": "<string>",
  "instructions": "<string>",
  "connectors": []
}
'
{
  "pipelineId": "<string>",
  "name": "<string>",
  "latestRevisionId": "<string>",
  "links": {
    "self": "<string>",
    "runs": "<string>",
    "revisions": "<string>"
  },
  "definition": {
    "instructions": "<string>",
    "connectors": [
      {
        "connector": "<string>",
        "connectionId": "<string>"
      }
    ]
  },
  "inputJsonSchema": {},
  "outputJsonSchema": {},
  "latestRun": {
    "runId": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "links": {
      "self": "<string>"
    }
  },
  "error": "<unknown>"
}

Authorizations

Authorization
string
header
required

OAuth2 access token or API key

Headers

Idempotency-Key
string
required
Minimum string length: 1
Example:

"unique-idempotency-key"

Path Parameters

workspaceId
string
required
Example:

"ws_123"

Body

application/json
name
string
required

Human-readable name for this reusable pipeline.

Minimum string length: 1
playbookId
enum<string>
required

Playbook that defines the reusable pipeline type and run input contract.

Available options:
scheduling,
reporting
instructions
string
required

Reusable business rules and configuration used for every run of this pipeline. For scheduling, include staff context, constraints, preferences, and recurring rules here, not the one-off dateRange.

Minimum string length: 1
connectors
object[]

Stored external connections available during pipeline builds and runs.

Response

Pipeline accepted

pipelineId
string
required

Reusable pipeline id.

name
string
required

Human-readable reusable pipeline name.

playbookId
enum<string>
required

Playbook that owns this pipeline and defines its run input contract.

Available options:
scheduling,
reporting
status
enum<string>
required

Current pipeline build status. Only ready pipelines can be run, but schemas may be visible before the build completes.

Available options:
building,
ready,
failed
latestRevisionId
string | null
required

Latest ready executable revision id, or null while the pipeline is building.

definition
object
required
inputJsonSchema
object
required

JSON Schema for the input object accepted by pipeline runs. Fetch pipeline detail before running and send matching data under the run request input property.

outputJsonSchema
object
required

JSON Schema for run output once a run completes.

latestRun
object
required

Latest pipeline run summary, if one exists. Fetch links.self to read full output or error details.

error
any

Public error details when status is failed.