Skip to main content

Create Header Link

Add a header link to a course. type and side are required. name and link_url may be omitted — an omitted value is stored as "". The new link is placed after the highest order, or at 0 when the course has no links. Visitors see the link after you publish. See Header Links.

Request​

POST /players/{id}/header-links

Path Parameters​

ParameterTypeRequiredDescription
idstringYesCourse UUID. See Identifiers.

Request Body​

ParameterTypeRequiredDescription
draft_versionintegerYesCurrent counter from Get Course. Minimum 1. Missing, not an integer, or below 1 is 422. A value that is not current is 409.
typestringYesbutton, link, or text
sidestringYesleft or right
namestringNoLabel, maximum 255 characters. Omit for "".
link_urlstringNoLink text, maximum 255 characters. Omit for "".

Example Request​

curl -X POST "https://app.easy.tools/api/v1/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/header-links" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"draft_version": 1,
"type": "link",
"side": "left",
"name": "Syllabus",
"link_url": "https://mysite.com/syllabus"
}'

Response​

Success Response (201)​

{
"data": {
"id": "4b8e1c70-5d29-4a16-8f33-0c7a2e9d4b51",
"name": "Syllabus",
"link_url": "https://mysite.com/syllabus",
"type": "link",
"side": "left",
"order": 0,
"preview_url": "https://app.easy.tools/players/8f3c1a62-d047-4e89-9b25-1c6a4d8e0f71/preview?expires=1768478400&signature=7d2e9c41a6b85f03e1c7d94a2b6f80e35c1a9d7b4e2f60c8a3d5b1e9f7c2a046",
"draft_version": 2,
"draft_updated_at": "2026-01-15T11:05:00.000Z"
}
}

Response Fields​

See Header Link Object. preview_url on data is minted for this response. draft_version and draft_updated_at are on data as well.

Error Responses​

Not Found Error (404)​

See Identifiers.

{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found"
}
}

Conflict Error (409)​

draft_version is not the current counter. Read the course and retry with that value.

{
"error": {
"code": "CONFLICT",
"message": "The draft was edited elsewhere. GET the draft and retry with the current draft_version."
}
}

Validation Error (422 Unprocessable Entity)​

{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid",
"details": {
"type": ["type must be one of the following values: button, link, text"]
}
}
}

Authentication, permission, and rate-limit errors are described in Authorization.