POST /pipelines/{kind}/validate

kind is ocr or audio. JSON body. Authentication: X-API-Key: <key> or Authorization: Bearer <key> header.

POST /pipelines/{kind}/validate

Request body

The following parameters can be included in the request body:

Parameters

kind
string
Required

Path. ocr or audio.

pipeline
object
Required

Graph (see "Graph format"). Here, a JSON object.

pipeline_hash
string

SHA-256 fingerprint of the graph (see "Graph format"). If it does not match the submitted graph: 422 hash_mismatch.

Successful response

The following fields are returned in a successful response:

Response fields

valid
boolean
Required

The graph is valid.

pipeline_hash
string
Required

SHA-256 fingerprint of the graph.

warnings
array<object>
Required

Non-blocking warnings (for example unreachable_node).

Examples

Code examples for using this endpoint:

curl
curl -X POST https://api-endpoints.alphaedge-ai.com/pipelines/ocr/validate \
  -H "X-API-Key: $ALPHAEDGE_API_KEY" -H "Content-Type: application/json" \
  -d "{\"pipeline\": $(cat pipeline.json)}"

Response

Sample API response:

json
{
  "valid": true,
  "pipeline_hash": "96c6be3b…",
  "warnings": []
}

Invalid graph (422)

error.code is invalid_pipeline, or limit_exceeded if all errors are limit overruns. Details are in error.errors[]; each entry has a code, often a node_id and a port.

json
{
  "error": {
    "type": "invalid_pipeline",
    "code": "invalid_pipeline",
    "message": "Port "no" of n2 has no continuation.",
    "errors": [
      { "code": "dangling_port", "node_id": "n2", "port": "no", "message": "…" }
    ]
  },
  "request_id": "7f4bcd…"
}

The list of errors[] codes is on the "Graph format" page.