Returns active goals for a user

Prev Next
Get
/goals

Returns paginated new and in-progress goals for the user identified by the user-id or user-ref header. There is no human session on this path; the caller must supply the owner id or external reference so the read can be scoped downstream.

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
Header parameters
user-id
string

MongoDB id of the user whose goals are requested. Required unless user-ref is supplied.

Pattern^[0-9a-fA-F]{24}$
user-ref
string

External reference of the user whose goals are requested. Required unless user-id is supplied.

Min length1
Query parameters
page
integer (int64)

Set the current page of results

Minimum1.0
Default1
perPage
integer (int64)

Used in combination with the page parameter to page through the data, will be prioritised over limit.

Allowed values: 1–1000

Minimum1.0
Maximum1000.0
Default100
limit
integer (int64)

Set the number of items to retrieve per page

Minimum1.0
Maximum1000.0
Default100
Responses
200

Goals for the user

Expand All
object
pagination
object (Pagination)

Details of the pagination

totalResults
integer

Total number of results matching the query

Example48
totalPages
integer

Total number of pages available

Example3
page
integer

Current page number

Minimum1.0
Default1
Example1
perPage
integer

Number of results per page

Minimum1.0
Maximum1000.0
Default100
Example20
results
Array of object (Goal)
object

A user goal (personal or assigned).

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
401

Unauthorized

object

Unauthorized

status
number
Example401
error
string
ExampleUnauthorized
message
string
403

Forbidden

object

Forbidden

status
number
Example403
error
string
ExampleForbidden
message
string #deprecatedtemplate# #additional-property-template#
OneOf
string
string
object
object
422

Unprocessable Content

object

Unprocessable Content

status
number
Example422
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
error
string
ExampleInternal Server Error
message
string