コンテンツにスキップ

Agent: Cohorts

Read course access codes

GET /api/v1/agent/courses/{course_pk}/codes/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/codes/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/codes/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/codes/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/codes/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run course access codes

POST /api/v1/agent/courses/{course_pk}/codes/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/codes/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/codes/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/codes/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/codes/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Update a course access code

PATCH /api/v1/agent/courses/{course_pk}/codes/{code_pk}/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/codes/<code_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
code_pk path yes
course_pk path yes
COURSE_PK="..."
CODE_PK="..."
curl -sS -X PATCH "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/codes/$CODE_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
code_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/codes/{code_pk}/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const code_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/codes/${code_pk}/`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Delete a course access code

DELETE /api/v1/agent/courses/{course_pk}/codes/{code_pk}/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/codes/<code_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
code_pk path yes
course_pk path yes
COURSE_PK="..."
CODE_PK="..."
curl -sS -X DELETE "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/codes/$CODE_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
code_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/codes/{code_pk}/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const code_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/codes/${code_pk}/`, {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read course groups (cohorts)

GET /api/v1/agent/courses/{course_pk}/cohorts/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/cohorts/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/cohorts/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/cohorts/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/cohorts/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run course groups (cohorts)

POST /api/v1/agent/courses/{course_pk}/cohorts/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/cohorts/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/cohorts/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/cohorts/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/cohorts/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Update a course group

PATCH /api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/cohorts/<cohort_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
cohort_pk path yes
course_pk path yes
COURSE_PK="..."
COHORT_PK="..."
curl -sS -X PATCH "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/cohorts/$COHORT_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
cohort_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const cohort_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/cohorts/${cohort_pk}/`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Delete a course group

DELETE /api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/cohorts/<cohort_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
cohort_pk path yes
course_pk path yes
COURSE_PK="..."
COHORT_PK="..."
curl -sS -X DELETE "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/cohorts/$COHORT_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
cohort_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/"
response = requests.delete(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const cohort_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/cohorts/${cohort_pk}/`, {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run a group's members

POST /api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/members/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/cohorts/<cohort_pk>/members/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
cohort_pk path yes
course_pk path yes
COURSE_PK="..."
COHORT_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/cohorts/$COHORT_PK/members/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
cohort_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/cohorts/{cohort_pk}/members/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const cohort_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/cohorts/${cohort_pk}/members/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read a course's learners

GET /api/v1/agent/courses/{course_pk}/learners/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/learners/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/learners/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/learners/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/learners/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read roster imports

GET /api/v1/agent/courses/{course_pk}/roster-imports/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run roster imports

POST /api/v1/agent/courses/{course_pk}/roster-imports/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read the roster import template

GET /api/v1/agent/courses/{course_pk}/roster-imports/template/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/template/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
COURSE_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/template/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/template/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/template/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Read a roster import

GET /api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/

Requires cohorts: view. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/<import_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
import_pk path yes
COURSE_PK="..."
IMPORT_PK="..."
curl -sS -X GET "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/$IMPORT_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
import_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/"
response = requests.get(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const import_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/${import_pk}/`, {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Update a roster import

PATCH /api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/<import_pk>/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
import_pk path yes
COURSE_PK="..."
IMPORT_PK="..."
curl -sS -X PATCH "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/$IMPORT_PK/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
import_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/"
response = requests.patch(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const import_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/${import_pk}/`, {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run a roster import (cancel)

POST /api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/cancel/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/<import_pk>/cancel/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
import_pk path yes
COURSE_PK="..."
IMPORT_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/$IMPORT_PK/cancel/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
import_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/cancel/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const import_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/${import_pk}/cancel/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.

Create or run a roster import (commit)

POST /api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/commit/

Requires cohorts: edit. Same body, rules and refusals as the creator-studio endpoint /api/v1/courses/<course_pk>/roster-imports/<import_pk>/commit/.

Authentication: API key — Authorization: Bearer <key>

Parameter In Required Description
course_pk path yes
import_pk path yes
COURSE_PK="..."
IMPORT_PK="..."
curl -sS -X POST "https://www-dev.yoshuko.com/api/v1/agent/courses/$COURSE_PK/roster-imports/$IMPORT_PK/commit/" \
  -H "Authorization: Bearer $YOSHUKO_API_KEY"
import os
import requests

course_pk = "..."
import_pk = "..."
url = f"https://www-dev.yoshuko.com/api/v1/agent/courses/{course_pk}/roster-imports/{import_pk}/commit/"
response = requests.post(url, headers={"Authorization": f"Bearer {os.environ['YOSHUKO_API_KEY']}"}, timeout=30)
response.raise_for_status()
print(response.json() if response.content else response.status_code)
const course_pk = "...";
const import_pk = "...";
const response = await fetch(`https://www-dev.yoshuko.com/api/v1/agent/courses/${course_pk}/roster-imports/${import_pk}/commit/`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.YOSHUKO_API_KEY}` }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(response.status === 204 ? response.status : await response.json());
Status Meaning
200 No response body
201 No response body
204 No response body
400 No response body
401 Missing, unknown, revoked or expired key; or the organisation's plan is inactive (subscription_inactive) or unverified (org_unverified).
403 The key's scope for this resource does not allow the action.
404 No such object in this key's organisation.
429 Rate limited (300 requests/hour per key). Retry after the Retry-After header.