Add a block
curl --request POST \
--url https://{domain}/api/v1/biolinks/pages/{page}/blocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '
{
"type": "link",
"enabled": true,
"content": {
"title": "Shop the sale",
"url": "https://example.com/sale"
}
}
'import requests
url = "https://{domain}/api/v1/biolinks/pages/{page}/blocks"
payload = {
"type": "link",
"enabled": True,
"content": {
"title": "Shop the sale",
"url": "https://example.com/sale"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'link',
enabled: true,
content: {title: 'Shop the sale', url: 'https://example.com/sale'}
})
};
fetch('https://{domain}/api/v1/biolinks/pages/{page}/blocks', 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://{domain}/api/v1/biolinks/pages/{page}/blocks",
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([
'type' => 'link',
'enabled' => true,
'content' => [
'title' => 'Shop the sale',
'url' => 'https://example.com/sale'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"If-Match: <if-match>"
],
]);
$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://{domain}/api/v1/biolinks/pages/{page}/blocks"
payload := strings.NewReader("{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("If-Match", "<if-match>")
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://{domain}/api/v1/biolinks/pages/{page}/blocks")
.header("Idempotency-Key", "<idempotency-key>")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v1/biolinks/pages/{page}/blocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "link",
"position": 123,
"enabled": true,
"content_supported": true,
"content": {}
},
"page_revision": "<string>"
}Blocks
Add a block
Adds a block at the end of the page. A page can have up to 200 blocks. Commerce and embed blocks cannot be created through the API.
Required permission: biolinks:pages:write
Changing an active page also needs biolinks:pages:publish.
POST
/
pages
/
{page}
/
blocks
Add a block
curl --request POST \
--url https://{domain}/api/v1/biolinks/pages/{page}/blocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'If-Match: <if-match>' \
--data '
{
"type": "link",
"enabled": true,
"content": {
"title": "Shop the sale",
"url": "https://example.com/sale"
}
}
'import requests
url = "https://{domain}/api/v1/biolinks/pages/{page}/blocks"
payload = {
"type": "link",
"enabled": True,
"content": {
"title": "Shop the sale",
"url": "https://example.com/sale"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"If-Match": "<if-match>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'If-Match': '<if-match>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: 'link',
enabled: true,
content: {title: 'Shop the sale', url: 'https://example.com/sale'}
})
};
fetch('https://{domain}/api/v1/biolinks/pages/{page}/blocks', 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://{domain}/api/v1/biolinks/pages/{page}/blocks",
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([
'type' => 'link',
'enabled' => true,
'content' => [
'title' => 'Shop the sale',
'url' => 'https://example.com/sale'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"If-Match: <if-match>"
],
]);
$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://{domain}/api/v1/biolinks/pages/{page}/blocks"
payload := strings.NewReader("{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("If-Match", "<if-match>")
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://{domain}/api/v1/biolinks/pages/{page}/blocks")
.header("Idempotency-Key", "<idempotency-key>")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v1/biolinks/pages/{page}/blocks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["If-Match"] = '<if-match>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"link\",\n \"enabled\": true,\n \"content\": {\n \"title\": \"Shop the sale\",\n \"url\": \"https://example.com/sale\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "link",
"position": 123,
"enabled": true,
"content_supported": true,
"content": {}
},
"page_revision": "<string>"
}Authorizations
bearerAuthapiKeyHeader
A workspace API key: Authorization: Bearer osk_...
Headers
8–200 letters, digits, ., _, : or -. Retry with the same key and exact same body to get the original response.
Required string length:
8 - 200The current revision in quotes, from the resource's ETag. Missing returns 428; out of date returns 412.
Example:
"\"a1b2c3\""
Path Parameters
Page ID.
Body
application/json