Skip to main content
POST
/
pipelines
/
validate
Validate a pipeline definition
curl --request POST \
  --url https://api.goldsky.com/api/v1/pipelines/validate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "definition": {
    "sources": {
      "my_source": {
        "dataset_name": "ethereum.raw_blocks",
        "start_at": "latest",
        "type": "dataset",
        "version": "1.0.0"
      }
    },
    "transforms": {
      "my_transform": {
        "from": "my_source",
        "primary_key": "id",
        "type": "handler",
        "url": "https://handler.com"
      }
    },
    "sinks": {
      "my_sink": {
        "from": "my_transform",
        "type": "blackhole"
      }
    },
    "name": "ethereum-blocks",
    "resource_size": "s",
    "use_dedicated_ip": false,
    "job": false,
    "description": "Streams Ethereum blocks"
  }
}
'
import requests

url = "https://api.goldsky.com/api/v1/pipelines/validate"

payload = { "definition": {
"sources": { "my_source": {
"dataset_name": "ethereum.raw_blocks",
"start_at": "latest",
"type": "dataset",
"version": "1.0.0"
} },
"transforms": { "my_transform": {
"from": "my_source",
"primary_key": "id",
"type": "handler",
"url": "https://handler.com"
} },
"sinks": { "my_sink": {
"from": "my_transform",
"type": "blackhole"
} },
"name": "ethereum-blocks",
"resource_size": "s",
"use_dedicated_ip": False,
"job": False,
"description": "Streams Ethereum blocks"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
definition: {
sources: {
my_source: {
dataset_name: 'ethereum.raw_blocks',
start_at: 'latest',
type: 'dataset',
version: '1.0.0'
}
},
transforms: {
my_transform: {
from: 'my_source',
primary_key: 'id',
type: 'handler',
url: 'https://handler.com'
}
},
sinks: {my_sink: {from: 'my_transform', type: 'blackhole'}},
name: 'ethereum-blocks',
resource_size: 's',
use_dedicated_ip: false,
job: false,
description: 'Streams Ethereum blocks'
}
})
};

fetch('https://api.goldsky.com/api/v1/pipelines/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goldsky.com/api/v1/pipelines/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'definition' => [
'sources' => [
'my_source' => [
'dataset_name' => 'ethereum.raw_blocks',
'start_at' => 'latest',
'type' => 'dataset',
'version' => '1.0.0'
]
],
'transforms' => [
'my_transform' => [
'from' => 'my_source',
'primary_key' => 'id',
'type' => 'handler',
'url' => 'https://handler.com'
]
],
'sinks' => [
'my_sink' => [
'from' => 'my_transform',
'type' => 'blackhole'
]
],
'name' => 'ethereum-blocks',
'resource_size' => 's',
'use_dedicated_ip' => false,
'job' => false,
'description' => 'Streams Ethereum blocks'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.goldsky.com/api/v1/pipelines/validate"

payload := strings.NewReader("{\n \"definition\": {\n \"sources\": {\n \"my_source\": {\n \"dataset_name\": \"ethereum.raw_blocks\",\n \"start_at\": \"latest\",\n \"type\": \"dataset\",\n \"version\": \"1.0.0\"\n }\n },\n \"transforms\": {\n \"my_transform\": {\n \"from\": \"my_source\",\n \"primary_key\": \"id\",\n \"type\": \"handler\",\n \"url\": \"https://handler.com\"\n }\n },\n \"sinks\": {\n \"my_sink\": {\n \"from\": \"my_transform\",\n \"type\": \"blackhole\"\n }\n },\n \"name\": \"ethereum-blocks\",\n \"resource_size\": \"s\",\n \"use_dedicated_ip\": false,\n \"job\": false,\n \"description\": \"Streams Ethereum blocks\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.goldsky.com/api/v1/pipelines/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {\n \"sources\": {\n \"my_source\": {\n \"dataset_name\": \"ethereum.raw_blocks\",\n \"start_at\": \"latest\",\n \"type\": \"dataset\",\n \"version\": \"1.0.0\"\n }\n },\n \"transforms\": {\n \"my_transform\": {\n \"from\": \"my_source\",\n \"primary_key\": \"id\",\n \"type\": \"handler\",\n \"url\": \"https://handler.com\"\n }\n },\n \"sinks\": {\n \"my_sink\": {\n \"from\": \"my_transform\",\n \"type\": \"blackhole\"\n }\n },\n \"name\": \"ethereum-blocks\",\n \"resource_size\": \"s\",\n \"use_dedicated_ip\": false,\n \"job\": false,\n \"description\": \"Streams Ethereum blocks\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.goldsky.com/api/v1/pipelines/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {\n \"sources\": {\n \"my_source\": {\n \"dataset_name\": \"ethereum.raw_blocks\",\n \"start_at\": \"latest\",\n \"type\": \"dataset\",\n \"version\": \"1.0.0\"\n }\n },\n \"transforms\": {\n \"my_transform\": {\n \"from\": \"my_source\",\n \"primary_key\": \"id\",\n \"type\": \"handler\",\n \"url\": \"https://handler.com\"\n }\n },\n \"sinks\": {\n \"my_sink\": {\n \"from\": \"my_transform\",\n \"type\": \"blackhole\"\n }\n },\n \"name\": \"ethereum-blocks\",\n \"resource_size\": \"s\",\n \"use_dedicated_ip\": false,\n \"job\": false,\n \"description\": \"Streams Ethereum blocks\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "valid": true,
  "errors": [
    {
      "message": "<string>",
      "field": "<string>"
    }
  ],
  "warnings": [
    {
      "message": "<string>",
      "field": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

API token generated from the Goldsky Dashboard. Pass as: Authorization: Bearer

Body

application/json
definition
object
required

Response

200 - application/json

Default Response

valid
boolean
required
errors
object[]
required
warnings
object[]
required