experiments

Embed
Preview of the card
<a href="https://linkyhub.net/docs/ref-experiments"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/ad47827e-d4ba-4ebe-8a95-0a3fde0f02a4/social-card.svg?v=3e7ae33eec8b" alt="experiments" width="600" height="315"></a>
GEThttps://linkyhub.net/api/v3/experimentsScope pages:read

A/B tests on the main page, each variant with impressions, conversions and rate.

Code samples

cURL
curl -X GET "https://linkyhub.net/api/v3/experiments" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
Example
{
  "data": [
    {}
  ]
}
Schema
dataobject[]required
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.
POSThttps://linkyhub.net/api/v3/experimentsScope pages:write

Start an A/B test on a block (stopped until started). Both variants begin as the block’s current settings.

Request body

application/json
blockIdstringrequired
The block id.
namestringrequired
{
  "blockId": "string",
  "name": "string"
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/experiments" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"blockId":"string","name":"string"}'
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.

Same as default · GET /experiments

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/experiments/variants/{variantId}Scope pages:write

Change a variant’s block settings and its share of traffic.

Parameters

variantIdstringpathrequired

Request body

application/json
settingsobjectrequired
The full block settings; checked against the block type’s schema.
weightintegerrequired
{
  "settings": {},
  "weight": 0
}

Code samples

cURL
curl -X PATCH "https://linkyhub.net/api/v3/experiments/variants/{variantId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"settings":{},"weight":0}'
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 · GET /experiments

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/experiments/{experimentId}/startScope pages:write

Start (or resume) showing the variants to visitors.

Parameters

experimentIdstringpathrequired

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/experiments/{experimentId}/start" \
  -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 · GET /experiments

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/experiments/{experimentId}/stopScope pages:write

Stop the test; every visitor sees the block as it is.

Parameters

experimentIdstringpathrequired

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/experiments/{experimentId}/stop" \
  -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 · GET /experiments

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/experiments/{experimentId}/promoteScope pages:write

Make a variant the block’s real settings and stop the test.

Parameters

experimentIdstringpathrequired

Request body

application/json
variantIdstringrequired
The variant id.
{
  "variantId": "string"
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/experiments/{experimentId}/promote" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"variantId":"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 · GET /experiments

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/experiments/{experimentId}Scope pages:write

Delete a test and its numbers. The block keeps its current settings.

Parameters

experimentIdstringpathrequired

Code samples

cURL
curl -X DELETE "https://linkyhub.net/api/v3/experiments/{experimentId}" \
  -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 · GET /experiments

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