Documentation Index

Fetch the complete documentation index at: https://docs.thrivelearning.com/llms.txt

Use this file to discover all available pages before exploring further.

Publish a content record

Prev Next
Post
/contents/{id}/publish

Coming soon. This endpoint is not available yet, and the details below may change before release.

Publishes a content record, making it visible in the catalogue.

The content must already be ready. Publishing anything else returns 409. For content with an upload item the sequence is: create, upload the artefact, then poll GET /rest/v1/contents/{id} until the status it returns for the record is ready, and publish. Remember that readiness also requires a processed thumbnail.

This is the only place skills and topics can be set on content that was not created with publishWhenReady. Send the full set you want the content to carry — the values in this request replace whatever was staged earlier, they are not merged with it.

publishedAt lets you record an original publish date, which is what you want when importing content that was first published elsewhere. Omit it and the content is stamped with the current time.

Security
HTTP
Type basic

HTTP Basic authentication using your Tenant ID and API secret.

  • Username is the Tenant ID (i.e. eu-west-2_AbcdEfghI)
  • Password is the API secret you would have received.

You can also authenticate using OAuth 2.0 client credentials (oauth2 security scheme) instead of Basic auth.

OAuth

OAuth 2.0 client credentials authentication.

Use the following token endpoints (replace :tenantId with your Tenant ID):

  • Public API access tokens

    • Staging: https://public.api.learnstaging.link/oauth2/token/:tenantId
    • Production: https://public.api.learn.link/oauth2/token/:tenantId
    • Staging MEA: https://public.api.meastaging.learn.tech/oauth2/token/:tenantId
    • Production MEA: https://public.api.mea.learn.tech/oauth2/token/:tenantId
  • Webhooks access tokens

    • Staging: https://user.api.learnstaging.link/oauth2/token/:tenantId
    • Production: https://user.api.learn.link/oauth2/token/:tenantId
    • Staging MEA: https://user.api.meastaging.learn.tech/oauth2/token/:tenantId
    • Production MEA: https://user.api.mea.learn.tech/oauth2/token/:tenantId

All access tokens must be sent using the Authorization: Bearer <access_token> header.

Scopes

For API access (non-webhooks), the following scopes are available:

  • api/all – Full read and write access to the API.
  • api/read – Read-only access to the API.
  • api/write – Write access to the API.

For webhooks, the following scopes are available:

  • api/webhooks – Access to webhook functionality.
  • api/all – Full read and write access to the API, including webhooks.

Tokens must include appropriate scopes for the endpoints you wish to call.

FlowClient Credentials
Token URLhttps://public.api.learn.link/oauth2/token/:tenantId
Scopes:
api/writeWrite access to the API.
Path parameters
id
stringRequired

Unique identifier of the content item

Pattern^[0-9a-fA-F]{24}$
Example5f9d88d6e1b2a34c56d78902
Body parameters
publishContent

Publish with a backdated publish date

Publishes content that has reached ready, applying the skills and topics it should carry and recording the date it was originally published elsewhere.

{
  "authorRef": "UID30084022",
  "skills": [
    "leadership"
  ],
  "topics": [
    "onboarding"
  ],
  "publishedAt": "2024-03-01T00:00:00.000Z"
}
object

The skills, topics and publish date to apply as the content is published.

skills
Array of string

The complete set of skills the published content should carry. Sending this field replaces any skills supplied when the content was created; omitting it keeps them.

string
Max length255
Exampleleadership
topics
Array of string

The complete set of topics the published content should carry. Sending this field replaces any topics supplied when the content was created; omitting it keeps them.

string
Max length255
Exampleonboarding
publishedAt
string (date-time)

The publish date to record. Use this when importing content that was originally published elsewhere. Defaults to the current time.

Example2024-03-01T00:00:00Z
AnyOf
Responses
200

The published content

published

Published

Every item has reached ok and the content is now live in the catalogue.

{
  "id": "5f9d88d6e1b2a34c56d78902",
  "status": "published",
  "items": [
    {
      "id": "5c8936159ec2d00010cdd334",
      "type": "elearning",
      "rank": "0",
      "summary": "Onboarding course",
      "status": "ok"
    }
  ]
}
Expand All
object

What the publish, archive and restore endpoints return: the record's identifier, its lifecycle status, and the state of its items. This is not the same shape as the GET /contents/{id} read, which returns the catalogue view of a record.

id
string

Unique identifier for the content

Pattern^[0-9a-fA-F]{24}$
Example5f9d88d6e1b2a34c56d78902
status
string

Lifecycle status of a content record. Note this is a different vocabulary from the statuses filter on GET /contents, which uses the legacy values created, published, archived and deleted.

Valid values[ "draft", "ready", "published", "archived" ]
Exampledraft
items
Array of object (ContentItemState)

The items that make up the content, with per-item processing state

object

One item within a content record, with its processing state.

id
string

Unique identifier for the item

Example5c8936159ec2d00010cdd334
type
string

The item type

Exampleelearning
rank
integer

The item's position within the content, lowest first

Example0
summary
string

A short label for the item, shown to learners

ExampleWelcome
status
string

The item's processing state. An item must reach ok before the content can become ready.

Valid values[ "processing", "ok", "error" ]
Exampleprocessing
error
string | null

Why processing failed, when status is error

Example
401

Unauthorized

object

Unauthorized

status
number
Example401.0
error
string
ExampleUnauthorized
message
string
403

Forbidden

object

Forbidden

status
number
Example403.0
error
string
ExampleForbidden
message
string #deprecatedtemplate# #additional-property-template#
OneOf
string
string
object
object
404

Not Found

object

Not found

status
number
Example404.0
error
string
ExampleNot Found
message
string #deprecatedtemplate# #additional-property-template#
OneOf
string
string
object
object
409

Conflict — the content is not ready, so it cannot be published yet. Check per-item status and the thumbnail on GET /rest/v1/contents/{id}.

object

There was a conflict with the request and the resource

status
number
Example409.0
error
string
ExampleConflict
message
string
ExampleThe resource already exists
415

Unsupported Media Type — Content-Type must be application/json

Expand All
object
id
string
ExampleUNIQUEREFERENCE111000
timestamp
string
Example2020-03-09T22:18:26.625Z
eventType
string
Valid values[ "user_joined", "user_updated", "user_suspended" ]
message
object (UnprocessableEntityError)

The request could not be processed due to a validation error

status
number
Example422.0
error
string
ExampleUnprocessable Entity
message
string
ExampleThe startDate must be in a valid ISO 8601 format
422

Unprocessable Content

object

Unprocessable Content

status
number
Example422.0
error
string
ExampleUnprocessable Content
message
string #deprecatedtemplate# #additional-property-template#
OneOf
string
string
object
object
502

Bad Gateway

object

The request could not be completed because a service it depends on failed. For write operations the content was not modified.

status
number
Example502.0
error
string
ExampleBad Gateway
message
string
ExampleThe request could not be completed because a service it depends on is unavailable. Please retry shortly.
default

An unexpected error has occurred

When any default error occurs it may be a system failure and persistent errors may require support.

Expand All
object
id
string
ExampleUNIQUEREFERENCE111000
timestamp
string
Example2020-03-09T22:18:26.625Z
eventType
string
Valid values[ "user_joined", "user_updated", "user_suspended" ]
message
object (InternalServerError)

The server is unable to process the request

status
number
Example500.0
error
string
ExampleInternal Server Error