Overview

The Learn API currently enables users to hide/show lessons, checkpoints, and units. This doc describes the methods that do this.

Future work might add the ability to publish curriculum and manage cohort creation and setup.

Authentication

Each Learn admin and instructor account will have a token that can be used to access the API. The token can be found in the UI under the account dropdown, or by going directly to https://learn-2.galvanize.com/api_token. The token must be passed in the header of API requests as Authorization: Bearer <token>

The authorization scope for each token will match the user’s permissions. For example, if a user is allowed to update a cohort’s visibility in the UI, that user’s token will be allowed to make API requests to do the same.

When using the Learn API for developing other applications, CORS will prevent using the API token from the client. Prefer instead to make requests to the Learn API from the server.

Rate Limiting

Rate limiting is applied per IP address. The current rate limit is set to 5 requests per second, but may change without advanced warning if necessary. Please let us know if you have a use case that doesn’t work with this limit. If your application exceeds the rate limit, the API will return a HTTP 429 “Too Many Requests” response code and the following error in the response body:

{"errors": {

"status":"429",

"title":"Too many requests",

"Message":"Rate limit exceeded. Wait 1s before making additional requests." }}

When this happens, your application should wait at least 1s and then try again. Thanks!

Blocks

Show details for a block of curriculum content. A block is a git repository which contains Learn curriculum, and has a Release for each branch and commit of the repository that has been published.

View block details

Endpoint

GET api/v1/blocks/:id

Parameters

Name Description Example
:id required [Path Parameter]
The id of the block. Can be discovered via the URL or the cohort curriculum endpoint /api/v1/cohorts/:cohort_id/curriculum
42

Request

Route

GET api/v1/blocks/477

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"98408e2f07682bb0909f63671015b532"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2971f086-bde8-4dd8-9d7f-6fac8c68da86
X-Runtime: 0.320250
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 740

Body

{
  "id": 477,
  "origin": "gitlab.galvanize.com",
  "org": "gSchool",
  "repo_name": "nice-repo",
  "sync_errors": [

  ],
  "title": "Example Block",
  "cohorts_using": [
    805
  ],
  "releases": [
    {
      "id": 508,
      "notes": "Note: notes",
      "created_at": "2025-03-10T18:33:46.689Z",
      "commit_sha": "c02ce003fc4845bdfbe4500236e17475",
      "branch_name": "main",
      "sync_errors": [

      ],
      "state": "success",
      "readme_text": "Example Readme",
      "user_id": null,
      "sync_warnings": [

      ],
      "git_tags": [

      ],
      "thumbs_up": 2,
      "thumbs_down": -1
    },
    {
      "id": 509,
      "notes": "Note: notes",
      "created_at": "2025-03-09T18:33:46.713Z",
      "commit_sha": "c29323be4bdc82874e72fdf6923215e1",
      "branch_name": "spring-course",
      "sync_errors": [

      ],
      "state": "success",
      "readme_text": "Example Readme",
      "user_id": null,
      "sync_warnings": [

      ],
      "git_tags": [

      ],
      "thumbs_up": 0,
      "thumbs_down": 0
    }
  ]
}

Visibility

Hide or show an individual Lesson or Checkpoint. This is equivalent to clicking the “eye” icon on the cohort visibility page. If you set the content to visible but the parent unit is hidden, the Lesson or Checkpoint will not be shown.

Update Content Visibility

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/content_files/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
1500
:block_id required [Path Parameter]
The block ID. The id that the content is attached to.
1500
:id required [Path Parameter]
The UID of the content, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
d092d0ebf9d991629c75f3dde79aab1e
visible required [Body Parameter]
The boolean that sets the visibility of the content.
true = visible
false = hidden

Request

Route

PATCH /api/v1/cohorts/849/blocks/500/content_files/b9000629ee19ad65fd3cff3f7c9771d4

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "visible": false
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b4ca19ce-ca3b-45f7-9084-95c1a4e8fc4e
X-Runtime: 0.321509
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Users

Create an Individual Due Date for a student

If a due date is included in the body the API will find or create a new individual due date for the student, block, and unit given. This provides a visual indicator to the student of when their work is due. Individual past due units with checkpoints will not automatically be marked as a zero.

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:unit_uid/users/:user_id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
2021
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
19
:unit_id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
23LR11-S267-4da6-912c-e342db43dc08
:id required [Path Parameter]
The student's user ID.
11
due_at required [Body Parameter]
The individual due date to be applied.
'2022-11-19 08:40:01'

Request

Route

PATCH /api/v1/cohorts/851/blocks/502/units/%3Aunit_uid/users/9963

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "due_at": "2022-11-19 12:00:00"
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"2d0d8dc9468087b1a5dabf3033eb0017"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 36c2e9e3-c6e3-433a-a856-6b419537abd7
X-Runtime: 0.317877
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 37

Body

{
  "due_at": "2022-11-19T12:00:00.000Z"
}

Remove an Individual Due Date for a student

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:unit_uid/users/:user_id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
2021
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
19
:unit_id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
233ab305-1267-4da6-912c-e342db43dc08
:id required [Path Parameter]
The student's user ID.
11
due_at required [Body Parameter]
The individual due date to be applied.
'2022-11-19 08:40:01'

Request

Route

PATCH /api/v1/cohorts/853/blocks/504/units/%3Aunit_uid/users/9967

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "due_at": ""
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"da0af6d40205b7775173eb8ce0cd8253"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: aaabbd6d-180b-46f1-881b-20b5dde1521f
X-Runtime: 0.313438
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "due_at": null
}

Regenerate User Token

Endpoint

GET /api/v1/users/regenerate_token

Request

Route

GET /api/v1/users/regenerate_token

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"ee55702ca81509a5b110fabae41c3885"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 6835e2e4-af8c-4770-a124-e6ef6e5fe544
X-Runtime: 0.632030
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 163

Body

{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6MTAwNTYsInRva2VuIjoiUEp2WTV0RlRVck5MOUdGSHdLUDg5MUZXIiwiZXhwIjoxNzczMjc1NjcyfQ.45iZS74GfTFn4-GmN6YCXO1qqu5zK305Xu_Lxs09pRM"
}

Units

Fetch cohort details for a unit, as well as hide or show an entire unit. This is equivalent to clicking the “eye” icon on the cohort settings visibility page. If you set a Unit to visible, any children content that are also visible will be shown.

Update Unit Visibility

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
1500
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
1500
:id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
d092d0ebf9d991629c75f3dde79aab1e
visible required [Body Parameter]
The boolean that sets the visibility of the unit.
true = visible
false = hidden

Request

Route

PATCH /api/v1/cohorts/854/blocks/505/units/236a1e25241c5de9c4be17badb2d5c56

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "visible": false
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: fb4de0e8-25e9-413c-b8ad-d8d45e2ec851
X-Runtime: 0.321165
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Show Unit details and latest submissions

Endpoint

GET /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:id

Request

Route

GET /api/v1/cohorts/855/blocks/506/units/51718d19e7136256a43a8ea8695c106d

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"fdbb808047d2b7a8fed9246d1cea690a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: c1416f70-b005-43e3-8fc6-d21456ca96b2
X-Runtime: 0.326865
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 1857

Body

{
  "id": 550,
  "uid": "51718d19e7136256a43a8ea8695c106d",
  "title": "Some Standard",
  "description": "This is a sample standard.",
  "position": 0,
  "success_criteria": [
    "Success 1",
    "Success 2"
  ],
  "standard_tags": "tags, more tags",
  "delivery_date": "Day 19",
  "content_files": [
    {
      "id": 989,
      "title": "f9506c5707ef52e96a0676ffe9d3cd9e",
      "uid": "86d7170b57458777f1afa195f1c10e0e",
      "content_file_tags": "content tags",
      "content_file_type": "lesson",
      "hidden": false,
      "content_file_path": "/cohorts/855/blocks/506/content_files/7fa3b83d97f502cacaa8b8acc320e017.md",
      "challenges": [
        {
          "id": 857,
          "uid": "e6858c41a12c5171d50e4650b1cea4f9",
          "title": "Lesson Challenge",
          "student_submissions": [
            {
              "user_id": 9971,
              "user_uid": "efd17e54fccf590e81fdcaf6bb0a14b3",
              "email": "jamie@example.com",
              "first_name": "Jamie",
              "last_name": "Wittman",
              "status": "correct",
              "total_points": 1,
              "correct_points": 1,
              "created_at": "2025-03-11T18:34:00.056Z"
            }
          ]
        }
      ]
    },
    {
      "id": 990,
      "title": "Checkpoint",
      "uid": "7ff333820013a584c607fb0d6110748b",
      "content_file_tags": "",
      "content_file_type": "checkpoint",
      "hidden": false,
      "content_file_path": "/cohorts/855/blocks/506/content_files/f7b90a391c9a449ec06c6204bba0851e.md",
      "challenges": [
        {
          "id": 858,
          "uid": "d212096a3340417abea019a43051951a",
          "title": "Test Question",
          "student_submissions": [
            {
              "user_id": 9971,
              "user_uid": "efd17e54fccf590e81fdcaf6bb0a14b3",
              "email": "jamie@example.com",
              "first_name": "Jamie",
              "last_name": "Wittman",
              "status": "incorrect",
              "total_points": 2,
              "correct_points": 1,
              "created_at": "2025-03-11T18:34:00.067Z"
            }
          ]
        }
      ],
      "checkpoint_submissions": [
        {
          "user_id": 9971,
          "user_uid": "efd17e54fccf590e81fdcaf6bb0a14b3",
          "email": "jamie@example.com",
          "first_name": "Jamie",
          "last_name": "Wittman",
          "checkpoint_id": 251,
          "state": "done",
          "created_at": "2025-03-11T16:34:00.057Z",
          "submitted_at": "2025-03-11T17:34:00.057Z",
          "last_performance_percent": 50,
          "total_possible_points": 2,
          "points_earned": 1,
          "path": "/cohorts/855/checkpoint_submissions/251"
        }
      ]
    }
  ]
}

Unit can be retrieved via the uid

Endpoint

GET /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:uid

Request

Route

GET /api/v1/cohorts/856/blocks/507/units/170cde467381864c2b149f23bd21853b

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"c5e0d72b0e6feb6fdba08c09a1f961e5"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2030ec47-1ad8-47cb-b744-f998262051ed
X-Runtime: 0.327134
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 1857

Body

{
  "id": 551,
  "uid": "170cde467381864c2b149f23bd21853b",
  "title": "Some Standard",
  "description": "This is a sample standard.",
  "position": 0,
  "success_criteria": [
    "Success 1",
    "Success 2"
  ],
  "standard_tags": "tags, more tags",
  "delivery_date": "Day 19",
  "content_files": [
    {
      "id": 991,
      "title": "88db05d910bf165a9d174b1250363255",
      "uid": "b6eb9075d58164265083fb336556d68a",
      "content_file_tags": "content tags",
      "content_file_type": "lesson",
      "hidden": false,
      "content_file_path": "/cohorts/856/blocks/507/content_files/b55b88673441ad6f35b306cef5632c2b.md",
      "challenges": [
        {
          "id": 859,
          "uid": "fef90053bc7eee4f6691d9ae686e443b",
          "title": "Lesson Challenge",
          "student_submissions": [
            {
              "user_id": 9973,
              "user_uid": "af37015ba32b278a269e0d24775e2ecd",
              "email": "jamie@example.com",
              "first_name": "Jamie",
              "last_name": "Wittman",
              "status": "correct",
              "total_points": 1,
              "correct_points": 1,
              "created_at": "2025-03-11T18:34:00.740Z"
            }
          ]
        }
      ]
    },
    {
      "id": 992,
      "title": "Checkpoint",
      "uid": "acca8aef134daa2b714950340b965506",
      "content_file_tags": "",
      "content_file_type": "checkpoint",
      "hidden": false,
      "content_file_path": "/cohorts/856/blocks/507/content_files/b355881b9a0fb9941661b1820c16f97f.md",
      "challenges": [
        {
          "id": 860,
          "uid": "046a46c483ee3dc0e372f1c6a2a2cb29",
          "title": "Test Question",
          "student_submissions": [
            {
              "user_id": 9973,
              "user_uid": "af37015ba32b278a269e0d24775e2ecd",
              "email": "jamie@example.com",
              "first_name": "Jamie",
              "last_name": "Wittman",
              "status": "incorrect",
              "total_points": 2,
              "correct_points": 1,
              "created_at": "2025-03-11T18:34:00.746Z"
            }
          ]
        }
      ],
      "checkpoint_submissions": [
        {
          "user_id": 9973,
          "user_uid": "af37015ba32b278a269e0d24775e2ecd",
          "email": "jamie@example.com",
          "first_name": "Jamie",
          "last_name": "Wittman",
          "checkpoint_id": 252,
          "state": "done",
          "created_at": "2025-03-11T16:34:00.741Z",
          "submitted_at": "2025-03-11T17:34:00.741Z",
          "last_performance_percent": 50,
          "total_possible_points": 2,
          "points_earned": 1,
          "path": "/cohorts/856/checkpoint_submissions/252"
        }
      ]
    }
  ]
}

Create a Due Date

If a due date is included in the body, the API will find or create a new cohort wide due date. This provides a visual indicator to the student of when their work is due. Cohort wide past due units with checkpoints will automatically be marked as a zero.

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
1500
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
1500
:id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
d092d0ebf9d991629c75f3dde79aab1e
due_at required [Body Parameter]
The due date.
'2200-11-01 12:00:01'

Request

Route

PATCH /api/v1/cohorts/860/blocks/513/units/4819c524e2dbbe5a7a6d1be53e6d1381

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "due_at": "2200-01-01 12:00:01"
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: ba03a15d-6661-4e99-8ffe-5f43634769be
X-Runtime: 0.320179
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Update a Due Date

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
1500
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
1500
:id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
d092d0ebf9d991629c75f3dde79aab1e
due_at required [Body Parameter]
The due date.
'2200-11-01 12:00:01'

Request

Route

PATCH /api/v1/cohorts/861/blocks/514/units/06040be6665fed51f975050be5ae4049

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "due_at": "2200-01-01 12:00:01"
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 26aaef68-a966-4801-8043-f9da81946229
X-Runtime: 0.316739
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Create a Due Date in the past

Endpoint

PATCH /api/v1/cohorts/:cohort_id/blocks/:block_id/units/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The cohort ID. Matches the ID from the URL when viewing any cohort in Learn.
1500
:block_id required [Path Parameter]
The block ID. The id that the unit is attached to.
1500
:id required [Path Parameter]
The UID of the unit, as returned from GET /api/v1/cohorts/:cohort_id/curriculum.
d092d0ebf9d991629c75f3dde79aab1e
due_at required [Body Parameter]
The due date.
'2200-11-01 12:00:01'

Request

Route

PATCH /api/v1/cohorts/864/blocks/517/units/ff9d326e9eb4dc33b589ee4bb854f04a

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "due_at": "2000-01-01 12:00:01"
}

Response

Simulated Response

Status

422

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
X-Request-Id: 38384ed5-081e-4c97-9949-a75080f12160
X-Runtime: 0.313802
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 33

Body

{
  "status": "unprocessable_entity"
}

Cohorts

Creating a new cohort

Allow users to easily create a cohort.

Endpoint

POST /api/v1/cohorts

Parameters

Name Description Example
name required [Body Parameter]
The name of the Cohort.
Web Development with scripting language ArnoldC
product_type required [Body Parameter]
The type or structure of the cohort.
Workshop
label [Body Parameter]
The label of this cohort.
17-01-WD-GT
campus_name [Body Parameter]
The campus of this cohort.
Seattle-Pioneer Square
opt_out_for_marketing [Body Parameter]
The boolean submitted for marketing preference.
false
starts_on required [Body Parameter]
The start date of the cohort.
2020-10-10
ends_on [Body Parameter]
The end date of the cohort.
2021-01-10
program required [Body Parameter]
Set to one of: ["Enterprise", "Consumer", "Military", "3rd-party", "Internal", "Other"]
Consumer
subject required [Body Parameter]
Set to one of: ["Data Science", "Software Engineering", "Other"]
Software Engineering
category required [Body Parameter]
Set to one of: ["Immersive", "Prep", "Assessment", "Workshop", "Other"]
Immersive
cohort_code [Body Parameter]
The internal code used to reference the cohort.
hr-rpp11, hr-bld8, g103
cohort_format required [Body Parameter]
Set to one of: ["Full time", "Part Time", "Other"]
Full time
cohort_client [Body Parameter]
The client this cohort is intended for.
Acme, LLC

Request

Route

POST /api/v1/cohorts

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "name": "Web Development with scripting language ArnoldC",
  "product_type": "Workshop",
  "label": "17-01-WD-GT",
  "campus_name": "Seattle-Pioneer Square",
  "opt_out_for_marketing": true,
  "starts_on": "2020-10-10",
  "ends_on": "2021-01-10",
  "program": "Consumer",
  "subject": "Software Engineering",
  "category": "Immersive",
  "cohort_format": "Full time",
  "cohort_client": "Acme"
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"2e6e182e867816fc65f8b7c7ce1de755"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 11a77613-1277-4edd-bc74-ecf6ffe53ba0
X-Runtime: 0.313159
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 42

Body

{
  "status": "ok",
  "uid": "4b58555dbbc93c9016"
}

Viewing Single Cohort Details

Endpoint

GET /api/v1/cohorts/:cohort_id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500

Request

Route

GET /api/v1/cohorts/867

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"f078f9a20c007f2f3ad600b0658909b9"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: f7db7f44-b349-4d1a-aa5a-1bea82bde40a
X-Runtime: 0.312709
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 757

Body

{
  "id": 867,
  "uid": "c24f88d6ceed884e9eabc90a45a3f617",
  "name": "Some Really Long Unwieldy Title",
  "product_type": "Some Product Type",
  "label": "00-105-WD-DP",
  "starts_on": "2025-03-09T18:34:09.372Z",
  "ends_on": null,
  "created_at": "2025-03-11T18:34:09.373Z",
  "updated_at": "2025-03-11T18:34:09.373Z",
  "settings": {
    "progress_thresholds": [
      0,
      25,
      50,
      70,
      90,
      100
    ]
  },
  "allow_paired_submissions": false,
  "whitelabeled": false,
  "logo_url": null,
  "student_import_state": null,
  "student_import_completed_at": null,
  "program": "Enterprise",
  "subject": "Data Science",
  "format": "Full time",
  "category": "Some Really Long Unwieldy Title",
  "client": null,
  "cohort_code": null,
  "copy_of": null,
  "allow_due_dates": false,
  "show_checkpoint_points": false,
  "is_single_student_repository_model": false,
  "resource_markdown": null
}

Viewing Curriculum Details

Endpoint

GET /api/v1/cohorts/:cohort_id/curriculum

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500

Request

Route

GET /api/v1/cohorts/869/curriculum

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"8b862724668dbcb164c55ce32b8685c6"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 1bb85275-2325-4fdd-8d37-be2f365472bd
X-Runtime: 0.322127
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 1074

Body

{
  "cohort_title": "Some Really Long Unwieldy Title",
  "cohort_id": 869,
  "course_yaml_url": "https://github.com/gSchool/learn-course-files/blob/master/test/test.yaml",
  "sections": [
    {
      "title": "Week 3",
      "id": 30,
      "units": [
        {
          "uid": "xyz789",
          "title": "Mocking in Java",
          "description": "Mocking in Java",
          "visible": true,
          "block_id": 520,
          "api_endpoint": "http://example.org/api/v1/cohorts/869/blocks/520/units/xyz789",
          "content_files": [
            {
              "uid": "abc123",
              "title": "LESSON PLAN: Introduction to Mocking in Java",
              "path": "/cohorts/869/blocks/520/content_files/01-instructor.md",
              "visible": true,
              "git_url": "https://github.com/gSchool/demo-mocking-java/blob/master/01-instructor.md",
              "type": "lesson",
              "api_endpoint": "http://example.org/api/v1/cohorts/869/blocks/520/content_files/abc123"
            },
            {
              "uid": "bcd456",
              "title": "Java Mocking Exit Ticket",
              "path": "/cohorts/869/blocks/520/content_files/03-exit-ticket.md",
              "visible": false,
              "git_url": "https://github.com/gSchool/demo-mocking-java/blob/master/03-exit-ticket.md",
              "type": "lesson",
              "api_endpoint": "http://example.org/api/v1/cohorts/869/blocks/520/content_files/bcd456"
            }
          ]
        }
      ]
    }
  ]
}

Resyncing Curriculum

Endpoint

POST /api/v1/cohorts/:cohort_id/resync

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
course_config_url required [Body Parameter]
The url of the course yaml that you would like to resync with your cohort.
https://github.com/gSchool/learn-course-files/blob/master/test/test.yml

Request

Route

POST /api/v1/cohorts/871/resync

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"44136fa355b3678a1146ad16f7e8649e"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 10d82cf0-6027-472b-8f07-1c076dd1f650
X-Runtime: 0.312338
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 2

Body

{
}

Getting Status Of Latest Resync Of Curriculum

Endpoint

GET /api/v1/cohorts/:cohort_id/resync/status

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500

Request

Route

GET /api/v1/cohorts/873/resync/status

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"673b28e6cb94b30ca3b4b617fc1a9c34"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0d8ea205-37a4-45bb-abc4-305ddf0f679b
X-Runtime: 0.312707
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 178

Body

{
  "id": 29,
  "cohort_id": 873,
  "status": "success",
  "course_config_url": "https://github.com/gSchool/learn-course-files/blob/master/test/test.yaml",
  "synced_at": "2025-03-11T18:34:11.367Z"
}

Control Cohort Features

Endpoint

PATCH /api/v1/cohorts/:cohort_id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
allow_due_dates [Body Parameter]
The boolean that sets the visibility of the content.
true = due dates available
false = due dates not available
show_checkpoint_points [Body Parameter]
A boolean which turns on the display of checkpoint averages in a section.
WARNING: Only turn this setting on if all checkpoints are worth the same number of points in your cohort.
true = displays checkpoint average for a section on the curriculum overview page
false = no average is displayed
is_single_student_repository_model [Body Parameter]
Testable projects must use a student's exercise repository url to find their sub-folder containing the work to test.
true = Testable projects submit with a button
false = students must submit a project url
allow_paired_submissions [Body Parameter]
Checkpoints can optionally be submitted as a group. Students will see all other students in their cohort when this is active, allowing them to select members of the group when starting a checkpoint.
true = checkpoints allow selecting group members whens tarting
false = students can only submit for themselves
resource_markdown [Body Parameter]
A string which is displayed to students for cohort resources. Accepts markdown formatting. Set with an empty string to remove from student view.
'## Contact Info...

Request

Route

PATCH /api/v1/cohorts/875

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "allow_due_dates": true,
  "show_checkpoint_points": true,
  "is_single_student_repository_model": true,
  "allow_paired_submissions": true,
  "resource_markdown": "## Ant\non me"
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"88acec3aeed66c9dbc6ee46d2189cabc"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 16bc1f50-052e-49c0-8eb4-b1c70fb9af7a
X-Runtime: 0.314124
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 197

Body

{
  "resource_markdown": "## Ant\non me",
  "allow_due_dates": true,
  "show_checkpoint_points": true,
  "is_single_student_repository_model": true,
  "allow_paired_submissions": true,
  "show_progress_percentage": false
}

Search Learn Content

Endpoint

GET /api/v1/cohorts/:cohort_id/search

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1918
q required [Path Parameter]
A string containing desired search terms.
node server

Request

Route

GET /api/v1/cohorts/877/search?q=node

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Query Parameters

q=node

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"4130f42c2f8d490a3a8e88de2f79bb5b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: db535fde-ddc8-43e1-a173-5d33d8af897d
X-Runtime: 0.316889
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 218

Body

[
  {
    "section_title": "Week 1",
    "standard_title": "Fun with Node!",
    "content_file_title": "LESSON PLAN: Introduction to Node Servers",
    "url": "/cohorts/877/blocks/525/content_files/01-instructor.md",
    "matches": [
      " this is some"
    ]
  }
]

Tags

Viewing Cohort Tags

Lists tags currently attached to a cohort.

Endpoint

GET /api/v1/cohorts/:cohort_id/tags

Parameters

Name Description Example
cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500

Request

Route

GET /api/v1/cohorts/882/tags

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a455fb56498a03c4f698778a9faded48"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: e5fb6a3f-15b9-417d-bcde-17238b796316
X-Runtime: 0.313855
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 275

Body

[
  {
    "id": 86,
    "color": "#CCE0F0",
    "name": "aaa",
    "cohort_id": 882,
    "created_at": "2025-03-11T18:34:13.984Z",
    "updated_at": "2025-03-11T18:34:13.984Z"
  },
  {
    "id": 87,
    "color": "#CCE0F0",
    "name": "zzz",
    "cohort_id": 882,
    "created_at": "2025-03-11T18:34:13.987Z",
    "updated_at": "2025-03-11T18:34:13.987Z"
  }
]

Viewing Users Tags

Lists tags currently attached to a user.

Endpoint

GET /api/v1/cohorts/:cohort_id/users/:user_id/tags

Parameters

Name Description Example
cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
user_id required [Path Parameter]
The ID of the user.
456

Request

Route

GET /api/v1/cohorts/886/users/10006/tags

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"8d45450b1a8098732afd554eb6543162"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 4c5385da-2014-49d6-a572-d33f68df864d
X-Runtime: 0.316889
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 161

Body

[
  {
    "id": 71,
    "created_at": "2025-03-11 18:34:14 UTC",
    "name": "aaa",
    "color": "#CCE0F0"
  },
  {
    "id": 72,
    "created_at": "2025-03-11 18:34:14 UTC",
    "name": "zzz",
    "color": "#CCE0F0"
  }
]

Creating Users Tags

Create tags for a user that belongs to a cohort.

Endpoint

POST /api/v1/cohorts/:cohort_id/users/:user_id/tags

Parameters

Name Description Example
cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
user_id required [Path Parameter]
The ID of the user.
456
tags [Body Parameter]
Tags applied to a user in this cohort. Available colors: 'red', 'orange', 'green', 'blue', 'purple', and 'gray'. If a tag already exists, the color will not be updated.
[{'name': 'Super', 'color': 'red'}, {'name': 'Awesome', 'color': 'blue'}]

Request

Route

POST /api/v1/cohorts/887/users/10007/tags

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "tags": [
    {
      "name": "Super",
      "color": "red"
    },
    {
      "name": "Awesome",
      "color": "blue"
    }
  ]
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"d4b48cd879551081bf26abaf1ad48ec4"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 2aea0c54-5a84-43db-b92f-88d59605ee8e
X-Runtime: 0.360029
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 167

Body

[
  {
    "id": 73,
    "created_at": "2025-03-11 18:34:16 UTC",
    "name": "Super",
    "color": "#F7CFC6"
  },
  {
    "id": 74,
    "created_at": "2025-03-11 18:34:16 UTC",
    "name": "Awesome",
    "color": "#CCE0F0"
  }
]

Removing Users Tags

Remove a tag for a user that belongs to a cohort.

Endpoint

DELETE /api/v1/cohorts/:cohort_id/users/:user_id/tags/:id

Parameters

Name Description Example
cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
user_id required [Path Parameter]
The ID of the user.
456
id required [Path Parameter]
The ID of the tag.
123

Request

Route

DELETE /api/v1/cohorts/888/users/10008/tags/75

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"4f53cda18c2baa0c0354bb5f9a3ecbe5"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7ec317e1-2e65-4589-8180-95769cc026f7
X-Runtime: 0.315563
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 2

Body

[

]

Enrollments

Viewing Cohort Enrollments

Lists users currently enrolled in the cohort, including instructors and onboarders. Roles are specific to that cohort, and do not include any global user roles.

Endpoint

GET /api/v1/cohorts/:cohort_id/users

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500

Request

Route

GET /api/v1/cohorts/889/users

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"b0aea1d6fc8986c27f041f377853bc1c"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 0c4b30a7-27b9-4d9d-96b1-6cde0fab93b9
X-Runtime: 0.325625
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 1686

Body

[
  {
    "id": 10012,
    "uid": "95b7086943815d9c24856933dc019cf5",
    "first_name": "Cindy",
    "last_name": "Louwho",
    "email": "cindy@example.com",
    "enrolled_at": "2025-03-10T 6:34:16+0000",
    "login_exists": false,
    "roles": [

    ],
    "tags": [
      {
        "id": 77,
        "created_at": "2025-03-10 18:34:16 UTC",
        "name": "needs guidence",
        "color": "#CCE0F0"
      }
    ],
    "notes": [
      {
        "note": "a note",
        "created_by_full_name": "Secret Spy",
        "created_by_email": "secret.spy2100@gmail.com",
        "created_at": "2025-03-11T18:34:16.686Z",
        "created_on": "https://learn-2.galvanize.com/cohorts/889/unit_progress"
      }
    ],
    "cohort_repo_url": "https://gitlab.com/org/cohort/cindy-louwho",
    "unit_completions": [

    ]
  },
  {
    "id": 10011,
    "uid": "7e0aa851d9ec101c1e1fa4403689a16e",
    "first_name": "Bob",
    "last_name": "Bobberson",
    "email": "bob@example.com",
    "enrolled_at": "2025-03-09T 6:34:16+0000",
    "login_exists": false,
    "roles": [
      "forge.instructor"
    ],
    "tags": [

    ],
    "notes": [

    ],
    "cohort_repo_url": null,
    "unit_completions": [

    ]
  },
  {
    "id": 10009,
    "uid": "eb814d10ee8ae5cdbc50b1eeeda76aaf",
    "first_name": "Eric",
    "last_name": "Ericson",
    "email": "eric@example.com",
    "enrolled_at": "2025-03-08T 6:34:16+0000",
    "login_exists": false,
    "roles": [

    ],
    "tags": [
      {
        "id": 76,
        "created_at": "2025-03-08 18:34:16 UTC",
        "name": "killing it!",
        "color": "#CCE0F0"
      }
    ],
    "notes": [
      {
        "note": "a note",
        "created_by_full_name": "Secret Spy",
        "created_by_email": "secret.spy2100@gmail.com",
        "created_at": "2025-03-11T18:34:16.673Z",
        "created_on": "https://learn-2.galvanize.com/cohorts/889/unit_progress"
      }
    ],
    "cohort_repo_url": null,
    "unit_completions": [
      {
        "block_id": 19,
        "standard_uid": "lrsknov21",
        "completed_at": "2022-04-12T00:00:00.000Z",
        "due_at": "2023-10-12T12:00:00.000Z"
      },
      {
        "block_id": 21,
        "standard_uid": "lrsknov2021",
        "completed_at": "2022-04-12T00:00:00.000Z",
        "due_at": "2023-10-12T12:00:00.000Z"
      }
    ]
  }
]

Creating a user and their enrollment

Invite new users or enroll existing users in a cohort. If the user is a student and does not exist in the system an invitation will be sent. If the instructor parameter is true and a Learn user is not found, a 404 is returned.

Enrolling a user who is already enrolled changes nothing about their enrollment- their roles will not be modified to match the body parameters. Instead any changes must be made via PATCH.

When batch creating enrollments, it is important to note that rate-limiting applies. It is best to pause for at least 500ms between requests.

Endpoint

POST /api/v1/cohorts/:cohort_id/users

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
first_name required [Body Parameter]
The first name of the user to enroll.
Jamie
last_name required [Body Parameter]
The last name of the user to enroll.
Wittman
email required [Body Parameter]
The email of the user to enroll. This field is used to find existing users.
jamie@example.com
cohort_repo_url [Body Parameter]
The cohort repository url for the student. Only available to single student repository cohorts.
https://gitlab.com/org/cohort/student-name
instructor [Body Parameter]
The boolean that sets the forge.instructor role for enrollment. Default = false.
true = has instructor role
false = has student role
onboard [Body Parameter]
The boolean that sets the auth.product_admin role for enrollment. Default = false.
true = user can enroll others in the cohort
false = no onboarding ability
observer [Body Paramter]
The boolean that sets the forge.read_only role for the enrollment. Can't be set at the same time as instructor. Default = false.
true = has read only permission
false = no read only permission
tags [Body Parameter]
Tags applied to a user in this cohort. Available colors: 'red', 'orange', 'green', 'blue', 'purple', and 'gray'. If a tag already exists, the color will not be updated.
[{'name': 'Super', 'color': 'red'}, {'name': 'Awesome', 'color': 'blue'}]

Request

Route

POST /api/v1/cohorts/890/users

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "first_name": "Jamie",
  "last_name": "Wittman",
  "email": "jamie@example.com",
  "instructor": true,
  "onboard": true,
  "observer": false,
  "tags": [
    {
      "name": "Super",
      "color": "red"
    },
    {
      "name": "Awesome",
      "color": "blue"
    }
  ]
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a79631700b0441c111a315de1e90a0e9"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7a7ee0aa-94fd-4665-b3c8-75ac00af5248
X-Runtime: 0.313047
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 56

Body

{
  "status": "ok",
  "uid": "4b58555dbbc93c9016f7325ead84667d"
}

Updating a user's enrollment roles

Update the roles for the user enrolled in the specified cohort. Can modify the forge.instructor and auth.product_admin roles for that enrollment only. The user will have only the roles specified after the action is taken.

Endpoint

PATCH /api/v1/cohorts/:cohort_id/users/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
:id required [Path Parameter]
The ID of the user.
456
instructor required [Body Parameter]
The boolean that sets the forge.instructor role for enrollment. Can't be set at the same time as observer.
true = has instructor role
false = has student role
onboard required [Body Parameter]
The boolean that sets the auth.product_admin role for enrollment.
true = user can enroll others in the cohort
false = no onboarding ability
observer required [Body Paramter]
The boolean that sets the forge.read_only role for the enrollment. Can't be set at the same time as instructor. Default = false.
true = has read only permission
false = no read only permission
cohort_repo_url [Body Parameter]
The cohort repository url for the student. Only available to single student repository cohorts.
https://gitlab.com/org/cohort/student-name

Request

Route

PATCH /api/v1/cohorts/896/users/10025

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Body

{
  "instructor": true,
  "onboard": true,
  "observer": false
}

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: c7925007-235c-415a-920c-d4ecf57228fe
X-Runtime: 0.314726
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Unenrolling a user from a cohort

Delete the enrollment for a specified cohort and user.

Endpoint

DELETE /api/v1/cohorts/:cohort_id/users/:id

Parameters

Name Description Example
:cohort_id required [Path Parameter]
The ID of the cohort. Matches the ID from the URL when viewing any cohort in Learn
1500
:id required [Path Parameter]
The ID of the user.
456

Request

Route

DELETE /api/v1/cohorts/900/users/2a9d47576b28332036b4abffdd099752

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"a29ee2b15c494311c52521766e44af56"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 7d1e41c3-d35c-4cfa-8be5-0b0688780949
X-Runtime: 0.313197
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 15

Body

{
  "status": "ok"
}

Releases

Show details for a specific release of curriculum content. Each release represents a commit from a block of content found in a git repository. All units, content files, and their challenges are revealed for the release, along with thumbs up / down sums for each content file.

View release details

Endpoint

GET api/v1/releases/:id

Parameters

Name Description Example
:id required [Path Parameter]
The id of the release, as returned from GET /api/v1/blocks/:id.
1234

Request

Route

GET api/v1/releases/569

Headers

Version: HTTP/1.0
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>

Response

Simulated Response

Status

200

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Content-Type: application/json; charset=utf-8
ETag: W/"c86ba61ac0c39d768679af42512f6451"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 233e5da5-965d-44cb-af52-57d6172f9cf4
X-Runtime: 0.324331
Set-Cookie: __profilin=p%3Dt; path=/; HttpOnly; SameSite=Lax
Content-Length: 3074

Body

{
  "block_id": 536,
  "branch_name": "master",
  "cohorts_using_release": [
    {
      "id": 921,
      "name": "Example Cohort"
    }
  ],
  "commit_url": "https://github.com/gSchool/react-block-7efea9b45333fbaa0a16682ab9089fb7/tree/f02e064192c2355e4b8080d5ea7bae1f",
  "block_url": "https://github.com/gSchool/react-block-7efea9b45333fbaa0a16682ab9089fb7",
  "commit_sha": "f02e064192c2355e4b8080d5ea7bae1f",
  "created_at": "2025-03-11T18:34:30.402Z",
  "notes": "Note: notes",
  "version": 1,
  "sync_errors": [

  ],
  "state": null,
  "git_tags": [

  ],
  "created_by": null,
  "thumbs_up": 5,
  "thumbs_down": -1,
  "units": [
    {
      "id": 580,
      "uid": "955478f642c27098e11d77cd162feb34",
      "title": "First Unit",
      "description": "This is a sample standard.",
      "content_files": [
        {
          "id": 1037,
          "uid": "498f77865ca066ffc28eb4336e5bfd2a",
          "title": "0372881ad57d6f79824b361d4a1d427c",
          "git_url": "https://github.com/gSchool/react-block-7efea9b45333fbaa0a16682ab9089fb7/blob/master/1d02918cd4cf6170af5ba151362abe0e.md",
          "type": "lesson",
          "path": "1d02918cd4cf6170af5ba151362abe0e.md",
          "html": "<h1>A sample lesson</h1>",
          "thumbs_up": 2,
          "thumbs_down": -1,
          "challenges": [

          ]
        }
      ]
    },
    {
      "id": 581,
      "uid": "ea25ac0594181f5420c90ab4460edc24",
      "title": "Second Unit",
      "description": "This is a sample standard.",
      "content_files": [
        {
          "id": 1038,
          "uid": "c66b5778548df4cb2a38bedf6e99d1e3",
          "title": "2d885f27834f757c076573a6d2fdb3bd",
          "git_url": "https://github.com/gSchool/react-block-7efea9b45333fbaa0a16682ab9089fb7/blob/master/5518eca248cae5a4bba91a5443417156.md",
          "type": "lesson",
          "path": "5518eca248cae5a4bba91a5443417156.md",
          "html": "<h1>Second Lesson</h1>",
          "thumbs_up": 3,
          "thumbs_down": 0,
          "challenges": [
            {
              "id": 877,
              "uid": "xyz",
              "challenge_type": "checkbox",
              "title": "Which cities have the highest and lowest altitudes?",
              "explanation": null,
              "answer": "[\"Denver\", \"Miami\"]",
              "question": "Select the correct answer",
              "position": 18,
              "language": null,
              "tests": null,
              "upstream_repo_path": null,
              "hints": [

              ],
              "setup": "",
              "created_at": "2025-03-11T18:34:30.413Z",
              "docker_directory_path": null,
              "show_tests": false,
              "data_path": null,
              "points": 1,
              "rubric": null,
              "topics": null,
              "partial_credit": false,
              "external_id": null,
              "external_source": null
            }
          ]
        },
        {
          "id": 1039,
          "uid": "cc2d7fa3fb88459ffec44689d29dadae",
          "title": "63b5f9839436b6f7fb3a34072ce28d0d",
          "git_url": "https://github.com/gSchool/react-block-7efea9b45333fbaa0a16682ab9089fb7/blob/master/f1f81c97c127780e8ad0c75e118e0c98.md",
          "type": "checkpoint",
          "path": "f1f81c97c127780e8ad0c75e118e0c98.md",
          "html": "<h1>Checkpoint</h1><div id=\"challenge-abc123\"></div>",
          "thumbs_up": 0,
          "thumbs_down": 0,
          "challenges": [
            {
              "id": 878,
              "uid": "abc123",
              "challenge_type": "project",
              "title": "Checkpoint Challenge",
              "explanation": "<p>The project reflects your technical abilities.</p>",
              "answer": null,
              "question": "Submit your project.",
              "position": 19,
              "language": null,
              "tests": null,
              "upstream_repo_path": null,
              "hints": [
                "Example hint"
              ],
              "setup": "",
              "created_at": "2025-03-11T18:34:30.419Z",
              "docker_directory_path": null,
              "show_tests": false,
              "data_path": null,
              "points": 3,
              "rubric": null,
              "topics": [
                "ORM",
                "SQL"
              ],
              "partial_credit": false,
              "external_id": null,
              "external_source": null
            }
          ]
        }
      ]
    }
  ]
}