blocks

Embed
Preview of the card
<a href="https://linkyhub.net/docs/ref-blocks"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/c4d9c896-6347-41cf-8564-289f30750408/social-card.svg?v=3e7ae33eec8b" alt="blocks" width="600" height="315"></a>
POSThttps://linkyhub.net/api/v3/pages/{pageId}/blocksScope pages:write

Add a block to a page, after another block or at the end. Visible as soon as the page is published.

Parameters

pageIdstringpathrequired

Request body

application/json
typestringrequired
A block type, e.g. LINK, TEXT, PRODUCT.
afterBlockIdstring
settingsobject
Checked against the block type’s schema.
{
  "type": "string",
  "afterBlockId": "string",
  "settings": {}
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/pages/{pageId}/blocks" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":"string","afterBlockId":"string","settings":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.
Example
{
  "error": "string",
  "message": "string"
}
Schema
errorstringrequired
A stable code to branch on, e.g. insufficient_scope.
messagestringrequired
A sentence to show a person.
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
DELETEhttps://linkyhub.net/api/v3/blocks/{blockId}Scope pages:write

Remove a block. A product block takes its product with it.

Parameters

blockIdstringpathrequired

Code samples

cURL
curl -X DELETE "https://linkyhub.net/api/v3/blocks/{blockId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
PATCHhttps://linkyhub.net/api/v3/blocks/{blockId}Scope pages:write

Change a block’s settings, hide or show it, or schedule when it is visible.

Parameters

blockIdstringpathrequired

Request body

application/json
settingsobject
The full settings; checked against the block type’s schema.
hiddenboolean
visibleFromstring
visibleUntilstring
{
  "settings": {},
  "hidden": true,
  "visibleFrom": "2024-01-01T00:00:00Z",
  "visibleUntil": "2024-01-01T00:00:00Z"
}

Code samples

cURL
curl -X PATCH "https://linkyhub.net/api/v3/blocks/{blockId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"settings":{},"hidden":true,"visibleFrom":"2024-01-01T00:00:00Z","visibleUntil":"2024-01-01T00:00:00Z"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
POSThttps://linkyhub.net/api/v3/blocks/{blockId}/moveScope pages:write

Move a block between two others. Positions are computed here; never send one.

Parameters

blockIdstringpathrequired

Request body

application/json
beforeIdstring
The block that should come before it (null: first).
afterIdstring
The block that should come after it (null: last).
{
  "beforeId": "string",
  "afterId": "string"
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/blocks/{blockId}/move" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"beforeId":"string","afterId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
POSThttps://linkyhub.net/api/v3/blocks/{blockId}/duplicateScope pages:write

Copy a block, placing the copy straight after it.

Parameters

blockIdstringpathrequired

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/blocks/{blockId}/duplicate" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
PUThttps://linkyhub.net/api/v3/blocks/{blockId}/audienceScope pages:write

Show a block only to some countries or devices. Empty lists show it to everyone.

Parameters

blockIdstringpathrequired

Request body

application/json
countriesstring[]required
ISO 3166 two-letter codes.
devicesstring[]required
{
  "countries": [
    "string"
  ],
  "devices": [
    "mobile"
  ]
}

Code samples

cURL
curl -X PUT "https://linkyhub.net/api/v3/blocks/{blockId}/audience" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"countries":["string"],"devices":["mobile"]}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
PUThttps://linkyhub.net/api/v3/blocks/{blockId}/passwordScope pages:write

Put a password on a link block, or null to remove it.

Parameters

blockIdstringpathrequired

Request body

application/json
passwordstringrequired
{
  "password": "string"
}

Code samples

cURL
curl -X PUT "https://linkyhub.net/api/v3/blocks/{blockId}/password" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"password":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
POSThttps://linkyhub.net/api/v3/blocks/{blockId}/chatScope pages:write

Turn on a CHAT block by setting up the creator’s live chat. Replies are read in the Linky Hub dashboard.

Parameters

blockIdstringpathrequired

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/blocks/{blockId}/chat" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /pages/{pageId}/blocks

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
Updated