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.

Delete content records in bulk permanently

Prev Next
Post
/contents/bulk/delete

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

Submits an asynchronous job that permanently deletes up to 100 content records by id. This cannot be undone.

Each deletion behaves exactly as DELETE /contents/{id} does: the content, its uploaded files and everything derived from them are removed, with no recoverable state. Deletion is not atomic, so a record whose removal fails part-way is reported FAILED in results[] and is left partly deleted; resubmitting that id completes it.

Consider POST /contents/bulk/archive instead if what you want is a reversible take-down.

Published content must be archived first

An id that is still published is reported as a MUST_ARCHIVE_FIRST failure and is not deleted. Removing a set of published content is therefore a two-step: bulk archive, then bulk delete.

The endpoint responds immediately with 202 Accepted and a jobId; poll GET /contents/bulk/{jobId} for progress and per-item results. The Idempotency-Key requirement and the 207/422 batch validation behaviour are identical to bulk create — see POST /contents/bulk.

Authorisation caveat. The api/write scope gates this route for OAuth callers only. Basic auth (apiToken) carries no scope concept, so an API key with access to the tenant can call this endpoint.

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.
Header parameters
Idempotency-Key
stringRequired

Caller-generated idempotency key for the submission. Generate it once per logical submission and reuse it on retries — replaying the same key returns the existing job instead of creating a duplicate. Requests without the header are rejected with 422.

Body parameters
bulkDeleteContent

Act on three records by id

Used by both bulk archive and bulk delete. For delete, any id that is still published comes back as a MUST_ARCHIVE_FIRST failure.

{
  "authorRef": "UID30084022",
  "ids": [
    "5f9d88d6e1b2a34c56d78902",
    "5f9d88d6e1b2a34c56d78903",
    "5f9d88d6e1b2a34c56d78904"
  ]
}
object

The content records to act on, identified by id.

ids
Array of string Required

The ids of the content records, at most 100 per submission

Min items1
Max items100
string
Pattern^[0-9a-fA-F]{24}$
Example5f9d88d6e1b2a34c56d78902
AnyOf
Responses
202

Accepted — a bulk delete job was created (or an existing job was matched by idempotency key). Poll pollUrl for progress and per-item results.

accepted

Job accepted

The batch was accepted. Poll pollUrl for progress and per-entry results.

{
  "jobId": "6863f9a2c1d2e3f4a5b6c7d8",
  "status": "pending",
  "pollUrl": "/rest/v2/contents/bulk/6863f9a2c1d2e3f4a5b6c7d8"
}
object

Returned when a bulk content job has been accepted for processing.

jobId
string

The id of the job processing the batch

Example6863f9a2c1d2e3f4a5b6c7d8
status
string

The processing status of a bulk job

Valid values[ "pending", "processing", "completed", "failed" ]
Exampleprocessing
pollUrl
string

The path to poll for progress and per-item results

Example/rest/v2/contents/bulk/6863f9a2c1d2e3f4a5b6c7d8
207

Multi-Status — some ids failed validation, so no job was created. The envelope lists the ids that passed and the ones that were rejected, so the batch can be corrected and resubmitted.

partiallyRejected

Some entries rejected, no job created

Entry 2 failed validation, so nothing was submitted. Correct it and resubmit the whole batch.

{
  "success": {
    "count": "2",
    "entities": [
      {
        "reference": "contents[0]"
      },
      {
        "reference": "contents[1]"
      }
    ]
  },
  "failure": {
    "count": "1",
    "entities": [
      {
        "reference": "contents[2]",
        "message": "title is required"
      }
    ]
  }
}
Expand All
object

A multi-status envelope returned when some entries in the batch failed validation. No job is created — correct the failed entries and resubmit the whole batch.

success
object

The entries that passed validation

count
number

The number of entries that passed validation

Example2.0
entities
Array of object
object
reference
string

The entry's position in the submitted array

Examplecontents[0]
failure
object

The entries that failed validation

count
number

The number of entries that failed validation

Example1.0
entities
Array of object
object
reference
string

The entry's position in the submitted array

Examplecontents[2]
message
string

The reason the entry was rejected

ExamplelanguageCode is required
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
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 — the submission was rejected before any job was created. This happens when the batch array is missing or empty, contains more than 100 entries, or no entry in it passed validation; and when the Idempotency-Key header is absent.

A batch in which only some entries fail validation returns 207 instead, so that you can see which ones to correct.

object

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
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