Create a personal or assigned goal

Prev Next
Post
/goals

Creates a goal from type. For personal, the assignee LMS reference must identify an active user and a single personal goal is created. For assigned, assigner and assignees are required LMS references of active users; one goal is created per assignee and the response includes the shared definition id plus per-assignee goal ids. Completed personal goals cannot be created through this path; use the completions API for history.

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.
Body parameters
Expand All
OneOf
CreatePersonalGoalRequest
object (CreatePersonalGoalRequest)
type
string Required
Valid values[ "personal" ]
Examplepersonal
assignee
string Required

LMS reference of the user who will own the goal

Min length1
Max length255
Exampleemployee-12345
title
string Required
Min length1
Max length100
ExampleComplete onboarding tasks
skill
string Required

Name of a skill that already exists in the organisation. A name that is not a skill is rejected with 422.

Min length1
Max length100
Examplecommunication
description
string | null
Max length500
ExampleFinish all onboarding activities
dueDate
string (date-time) | null
Example2027-12-31T00:00:00.000Z
tasks
Array of object (CreatePersonalGoalTaskRequest) Required
Min items1
Max items100
object
title
string Required
Min length1
Max length100
ExampleComplete onboarding module
description
string | null
Max length500
ExampleFinish the assigned onboarding content
type
string Required
Valid values[ "basic", "content" ]
Examplebasic
contentIds
Array of string

Empty or omitted for basic tasks; required and non-empty for content tasks. Each id must be a 24-character hex ObjectId of content that exists in the tenant. A missing id is rejected with 422.

Example[ "63f8c54a8cb9790c99de077a" ]
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer Required
Minimum1.0
Maximum2147483647.0
Example1
OneOf
object
object
type
string
Valid values[ "basic" ]
contentIds
Array of string
Max items0
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
title
string
Min length1
Max length100
ExampleComplete onboarding module
description
string | null
Max length500
ExampleFinish the assigned onboarding content
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer
Minimum1.0
Maximum2147483647.0
Example1
object
object
type
string
Valid values[ "content" ]
contentIds
Array of string Required
Min items1
Max items100
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
title
string
Min length1
Max length100
ExampleComplete onboarding module
description
string | null
Max length500
ExampleFinish the assigned onboarding content
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer
Minimum1.0
Maximum2147483647.0
Example1
CreateAssignedGoalRequest
object (CreateAssignedGoalRequest)
type
string Required
Valid values[ "assigned" ]
Exampleassigned
assigner
string Required

LMS reference of the assigner (createdBy). Required. That user must exist and be active on the tenant.

Min length1
Pattern\S+
Examplemanager-12345
assignees
Array of string Required

LMS references of users who will receive the goal

Min items1
Max items1000
Unique itemstrue
Example[ "employee-1", "employee-2" ]
string
Min length1
Pattern\S+
title
string Required
Min length1
Max length100
ExampleComplete compliance training
skill
string Required

Name of a skill that already exists in the organisation. A name that is not a skill is rejected with 422.

Min length1
Max length100
Examplecompliance
description
string | null
Max length500
ExampleMandatory annual compliance modules
dueDate
string (date-time) | null
Example2027-12-31T00:00:00.000Z
canLearnerAdd
boolean Required
Examplefalse
willBoostLevel
boolean Required
Examplefalse
boostToLevel
integer | null

Required when willBoostLevel is true. Must be an enabled skill level value for the tenant. The 422 lists the accepted values. A tenant with no skill levels configured accepts the defaults: Beginner (1024), Intermediate (2048) and Advanced (3072). A tenant can define different ones.

Minimum1.0
Maximum2147483647.0
Example1024
tasks
Array of object (CreateAssignedGoalTaskRequest) Required
Min items1
Max items100
object
title
string Required
Min length1
Max length100
ExampleComplete compliance module
description
string | null
Max length500
ExampleFinish the assigned compliance content
type
string Required
Valid values[ "basic", "content" ]
Examplecontent
contentIds
Array of string

Empty or omitted for basic tasks; required and non-empty for content tasks. Each id must be a 24-character hex ObjectId of content that exists in the tenant. A missing id is rejected with 422.

Example[ "63f8c54a8cb9790c99de077a" ]
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer Required
Minimum1.0
Maximum2147483647.0
Example1
OneOf
object
object
type
string
Valid values[ "basic" ]
contentIds
Array of string
Max items0
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
title
string
Min length1
Max length100
ExampleComplete compliance module
description
string | null
Max length500
ExampleFinish the assigned compliance content
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer
Minimum1.0
Maximum2147483647.0
Example1
object
object
type
string
Valid values[ "content" ]
contentIds
Array of string Required
Min items1
Max items100
string
Min length24
Max length24
Pattern^[a-fA-F0-9]{24}$
title
string
Min length1
Max length100
ExampleComplete compliance module
description
string | null
Max length500
ExampleFinish the assigned compliance content
evidenceRequired
boolean
Defaultfalse
approvalRequired
boolean
Defaultfalse
rank
integer
Minimum1.0
Maximum2147483647.0
Example1
Responses
201

Created goal payload (shape depends on type)

Expand All
OneOf
Goal
object (Goal)
id
string

The goal ID

Example63f57d805d8ecbf46f5b5278
userId
string

The goal owner's user ID

Example507f1f77bcf86cd799439011
title
string
ExampleComplete onboarding tasks
description
string | null
ExampleFinish all onboarding activities
skill
string
Examplecommunication
dueDate
string (date-time) | null
Example2027-12-31T00:00:00.000Z
status
string
ExampleNew
isPersonal
boolean
Exampletrue
completedAt
string (date-time) | null
source
object | null
ref
string | null
type
string
author
object | null
id
string
fullName
string
hasPicture
boolean
canLearnerAdd
boolean | null
willBoostLevel
boolean | null
boostToLevel
integer | null
usersSummary
object | null
count
integer
users
Array of object
object
id
string
fullName
string
tasks
Array of object
object
id
string
source
string
type
string
title
string
description
string | null
contentIds
Array of string
string
evidenceRequired
boolean
approvalRequired
boolean
status
string
rank
integer
CreateAssignedGoalResponse
object (CreateAssignedGoalResponse)
definitionId
string

Id of the shared goal definition

Example63f57d805d8ecbf46f5b5278
goals
Array of object
object
assignee
string

LMS ref from the request

Exampleemployee-1
userId
string

Resolved MongoDB user id

Example507f1f77bcf86cd799439011
goalId
string

Created goal document id for this assignee

Example63f57d805d8ecbf46f5b5299
401

Unauthorized

object

Unauthorized

status
number
Example401
error
string
ExampleUnauthorized
message
string
403

Forbidden — the OAuth2 token does not carry the api/write or api/all scope

Expand All
object

The error envelope of the V2 endpoints.

error
object
status
integer
Example422
error
string
ExampleUnprocessable Entity
message
string
ExampleValidation failed
violations
Array of object (V2Violation)

Present on field validation failures. One entry per failed rule.

object

One failed validation rule.

reference
string

The dotted path of the field that failed, for example items.0.meta.body. Empty for a body-level rule.

Exampletitle
message
string

Why the field failed.

Example"title" length must be at least 3 characters long
415

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

Expand All
object

The error envelope of the V2 endpoints.

error
object
status
integer
Example422
error
string
ExampleUnprocessable Entity
message
string
ExampleValidation failed
violations
Array of object (V2Violation)

Present on field validation failures. One entry per failed rule.

object

One failed validation rule.

reference
string

The dotted path of the field that failed, for example items.0.meta.body. Empty for a body-level rule.

Exampletitle
message
string

Why the field failed.

Example"title" length must be at least 3 characters long
422

Unprocessable Content

object

Unprocessable Content

status
number
Example422
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
error
string
ExampleBad Gateway
message
string
ExampleThe request could not be completed because a service it depends on is unavailable. Please retry shortly.
default

Internal Server Error

object

Internal Server Error

status
number
Example500
error
string
ExampleInternal Server Error
message
string