Skip to main content

Header links

Header links are the items in the course header. These routes stay at /players/{id}/header-links.

Overview​

Creates, updates, deletes, and reorders are draft writes. On a published course they are pending edits, and the live course changes when you publish. On a draft course they change the course itself. Lists and gets include pending edits when there are any, and they have no preview_url. See Draft, preview, and publish.

Each link has a label, text, a presentation (type), and a side. They use one order sequence. Rows that share an order come back in the order they were created. Changing side leaves order as it is.

List Header Links is paginated. include=header_links on Get Course returns every link.

Create places the new link after the highest order, or at 0 when the course has no links. Reorder Header Links is how you change order.

Delete Header Link on a draft course removes the link for good. On a published course it removes the link from the pending edits, and visitors still see it until you publish.

A course id or a header link id that is missing, that is not on that course, or that is not a UUID returns 404. See Identifiers.

Endpoints​

MethodEndpointDescription
GET/players/{id}/header-linksList header links
POST/players/{id}/header-linksCreate a header link
GET/players/{playerId}/header-links/{id}Get a header link
PATCH/players/{playerId}/header-links/{id}Update a header link
DELETE/players/{playerId}/header-links/{id}Delete a header link
POST/players/{id}/header-links/reorderReorder header links

Every field is present. None of them is null. name and link_url are "" when empty.

FieldTypeDescription
idstringImmutable identifier (UUID)
namestringLabel. Maximum 255 characters. Empty is "".
link_urlstringAddress the link opens. Maximum 255 characters. Empty is "".
typestringbutton, link, or text
sidestringleft or right
orderintegerPosition in the collection, starting at 0

Reorder​

Reorder Header Links takes the links you want to move. A link you leave out keeps its order.

items is required and must contain at least one entry. Each id is a header link on this course. Each order is an integer 0 or greater.

A duplicate id, a duplicate order, or an order that matches a link you left out returns 422 and changes nothing. An id that is missing or not a UUID returns 404 and changes nothing. The response is every header link in the new order, inside data, with no pagination. preview_url, draft_version, and draft_updated_at sit beside data.