Skip to main content
POST
/
pipelines
/
Create a pipeline
curl --request POST \
  --url https://api.goldsky.com/api/v1/pipelines/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "ethereum-blocks",
  "resource_size": "s",
  "use_dedicated_ip": false,
  "job": false,
  "description": "Streams Ethereum blocks",
  "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"
      }
    }
  }
}
'
import requests

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

payload = {
    "name": "ethereum-blocks",
    "resource_size": "s",
    "use_dedicated_ip": False,
    "job": False,
    "description": "Streams Ethereum blocks",
    "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"
            } }
    }
}
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({
    name: 'ethereum-blocks',
    resource_size: 's',
    use_dedicated_ip: false,
    job: false,
    description: 'Streams Ethereum blocks',
    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'}}
    }
  })
};

fetch('https://api.goldsky.com/api/v1/pipelines/', 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/",
  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([
    'name' => 'ethereum-blocks',
    'resource_size' => 's',
    'use_dedicated_ip' => false,
    'job' => false,
    'description' => 'Streams Ethereum blocks',
    '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'
                ]
        ]
    ]
  ]),
  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/"

	payload := strings.NewReader("{\n  \"name\": \"ethereum-blocks\",\n  \"resource_size\": \"s\",\n  \"use_dedicated_ip\": false,\n  \"job\": false,\n  \"description\": \"Streams Ethereum blocks\",\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  }\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/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"ethereum-blocks\",\n  \"resource_size\": \"s\",\n  \"use_dedicated_ip\": false,\n  \"job\": false,\n  \"description\": \"Streams Ethereum blocks\",\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  }\n}")
  .asString();
require 'uri'
require 'net/http'

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

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  \"name\": \"ethereum-blocks\",\n  \"resource_size\": \"s\",\n  \"use_dedicated_ip\": false,\n  \"job\": false,\n  \"description\": \"Streams Ethereum blocks\",\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  }\n}"

response = http.request(request)
puts response.read_body
{
  "name": "<string>",
  "type": "<string>",
  "status": "RUNNING",
  "definition": {
    "sources": {},
    "transforms": {},
    "sinks": {},
    "description": "<string>",
    "resource_size": "<string>",
    "use_dedicated_ip": true,
    "job": true
  },
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "resource_size": "<string>",
  "version": 123,
  "project_id": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

Pipeline name. Only lowercase letters, numbers, and hyphens are allowed.

Required string length: 1 - 50
Pattern: ^[a-z0-9-]{1,50}$
definition
object
required
resource_size
string
description
string
use_dedicated_ip
boolean

Response

200 - application/json

Default Response

name
string
required
type
string
required
status
required
Available options:
RUNNING
definition
object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
resource_size
string
version
number
project_id
string