curl --request PUT \
--url https://api.datalinks.com/api/v1/build-specs/{buildSpecId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"codeSource": "ScriptBlob",
"name": "<string>"
}
'import requests
url = "https://api.datalinks.com/api/v1/build-specs/{buildSpecId}"
payload = {
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"codeSource": "ScriptBlob",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sources: [{owner: '<string>', namespace: '<string>', datasetName: '<string>'}],
destinations: [{owner: '<string>', namespace: '<string>', datasetName: '<string>'}],
codeSource: 'ScriptBlob',
name: '<string>'
})
};
fetch('https://api.datalinks.com/api/v1/build-specs/{buildSpecId}', 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.datalinks.com/api/v1/build-specs/{buildSpecId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sources' => [
[
'owner' => '<string>',
'namespace' => '<string>',
'datasetName' => '<string>'
]
],
'destinations' => [
[
'owner' => '<string>',
'namespace' => '<string>',
'datasetName' => '<string>'
]
],
'codeSource' => 'ScriptBlob',
'name' => '<string>'
]),
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.datalinks.com/api/v1/build-specs/{buildSpecId}"
payload := strings.NewReader("{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.datalinks.com/api/v1/build-specs/{buildSpecId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalinks.com/api/v1/build-specs/{buildSpecId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"version": 123,
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"code": {
"payload": "cGFzcwo="
},
"codeSource": "ScriptBlob",
"createdAt": "2005-04-02T19:37:00.000Z",
"updatedAt": "2005-04-02T19:37:00.000Z",
"git": {
"cloneUrl": "https://git.prod.datalinks.com/git/buildspec-0b1c2d3e-4f50-6172-8394-a5b6c7d8e9f0.git",
"defaultBranch": "main"
},
"name": "<string>"
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}Edit a BuildSpec
Replace the declared sources and destinations and bump the version. Datasets are addressed by name. code is optional: when omitted, a ScriptBlob keeps its current code. A GitPipeline must omit code because its transform lives in the repo. Editing never rewrites a GitPipeline’s repo manifest; call files/sync-manifest to do that. codeSource is ignored: it is the spec’s type, fixed at creation.
curl --request PUT \
--url https://api.datalinks.com/api/v1/build-specs/{buildSpecId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"codeSource": "ScriptBlob",
"name": "<string>"
}
'import requests
url = "https://api.datalinks.com/api/v1/build-specs/{buildSpecId}"
payload = {
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"codeSource": "ScriptBlob",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sources: [{owner: '<string>', namespace: '<string>', datasetName: '<string>'}],
destinations: [{owner: '<string>', namespace: '<string>', datasetName: '<string>'}],
codeSource: 'ScriptBlob',
name: '<string>'
})
};
fetch('https://api.datalinks.com/api/v1/build-specs/{buildSpecId}', 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.datalinks.com/api/v1/build-specs/{buildSpecId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'sources' => [
[
'owner' => '<string>',
'namespace' => '<string>',
'datasetName' => '<string>'
]
],
'destinations' => [
[
'owner' => '<string>',
'namespace' => '<string>',
'datasetName' => '<string>'
]
],
'codeSource' => 'ScriptBlob',
'name' => '<string>'
]),
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.datalinks.com/api/v1/build-specs/{buildSpecId}"
payload := strings.NewReader("{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.datalinks.com/api/v1/build-specs/{buildSpecId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalinks.com/api/v1/build-specs/{buildSpecId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sources\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"destinations\": [\n {\n \"owner\": \"<string>\",\n \"namespace\": \"<string>\",\n \"datasetName\": \"<string>\"\n }\n ],\n \"codeSource\": \"ScriptBlob\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"version": 123,
"sources": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"destinations": [
{
"owner": "<string>",
"namespace": "<string>",
"datasetName": "<string>"
}
],
"code": {
"payload": "cGFzcwo="
},
"codeSource": "ScriptBlob",
"createdAt": "2005-04-02T19:37:00.000Z",
"updatedAt": "2005-04-02T19:37:00.000Z",
"git": {
"cloneUrl": "https://git.prod.datalinks.com/git/buildspec-0b1c2d3e-4f50-6172-8394-a5b6c7d8e9f0.git",
"defaultBranch": "main"
},
"name": "<string>"
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}{
"error_code": "UNAUTHORIZED",
"message": "Missing authentication token",
"error_message": "",
"sub_errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
Body
The transform source. ScriptBlob (the default) runs the inline code, which is then required. CodeBlob is a deprecated alias of ScriptBlob, accepted until clients have migrated. GitPipeline provisions a platform-hosted Git repo scaffolded from the declared sources and destinations, and the transform lives in that repo; code is ignored. A spec's code source is its type, fixed at creation; it is ignored on update.
ScriptBlob, GitPipeline, CodeBlob Response
The updated BuildSpec.
The spec's transform source. A GitPipeline spec's code is empty; edit its transform through the pipeline files API rather than this field. Inline-script specs report ScriptBlob; CodeBlob is its deprecated name, no longer returned, and stays in the enum only until clients built against it have migrated.
ScriptBlob, GitPipeline, CodeBlob