Creates an assignment.

Prev Next
Post
/assignments

Creates an assignment for a specific audience.

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
Body parameters
object

Request body for creating an assignment

audienceId
string Required

The audience ID

Pattern^[0-9a-fA-F]{24}$
Example63f8c546a05716c51210ac81
contentId
string Required

The content ID for the primary content

Pattern^[0-9a-fA-F]{24}$
Example63f8c54a8cb9790c99de077a
alternativeContentIds
Array of string

The content IDs which can cause the assigned content to be completed

Example[ "63f8c54f6f68ab3a2d60e5de" ]
string
Pattern^[0-9a-fA-F]{24}$
hideAlternativeContent
boolean

Whether to show or hide the alternative content

Defaultfalse
Examplefalse
completionPeriod
integer

The number of days required to complete the assignment

Minimum1.0
Default30
Example30
recurrence
integer | null

The number of days until the assignment will reoccur

Minimum0.0
Example365
Responses
201

The assignment

object

A content item assigned to a specific audience

id
string

The assignment ID

Example63f8c5361b9c80d3274be7ca
audienceId
string

The audience ID

Example63f8c546a05716c51210ac81
primaryContentId
string

The content ID for the primary content

Example63f8c54a8cb9790c99de077a
alternativeContentIds
Array of string

The content IDs which can cause the assigned content to be completed

string
Example63f8c54f6f68ab3a2d60e5de
hideAlternativeContent
boolean

Whether to show or hide the alternative content

Examplefalse
completionPeriod
integer

The number of days required to complete the assignment

Example30
recurrence
integer | null

The number of days until the assignment will reoccur

Example365
isActive
boolean

Defines whether the assignment is active

Exampletrue
isDeleted
boolean

Defines whether the assignment is deleted

Examplefalse
createdAt
string (date-time) | null

An ISO8601 for the timestamp when the assignment was created

Example2021-01-01T09:00:00Z
deletedAt
string (date-time) | null

An ISO8601 for the timestamp when the assignment was deleted

Example2021-01-01T09:00:00Z
updatedAt
string (date-time) | null

An ISO8601 for the timestamp when the assignment was last modified

Example2021-01-01T09:00:00Z
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
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
default

Internal Server Error

object

Internal Server Error

status
number
Example500.0
error
string
ExampleInternal Server Error
message
string