API essentials - Retrieving IDs

Prev Next

Introduction

Most items in the platform that can be created, edited, or deleted have a unique ID. This ID is essential for performing API actions on those items. For example, if you want to view course data using the API endpoint GET /learn/v1/courses/{course_id}, you need the course ID to make the request.

API reference for viewing a course with required parameters and response sample.

This article explains how to retrieve unique IDs, such as user IDs, course IDs, and catalog IDs, which are required for performing API actions and accessing data. It provides methods and examples for how to obtain these IDs through API endpoints, using the API browser.

Retrieve IDs directly from the platform

The most common IDs platform administrators utilize are user IDs and course IDs. These can be retrieved directly from the platform.

  • User IDs:  You can find them by generating a Users custom report

  • Course IDs:  You can obtain them through an export of the course data in CSV or XLS format from the Course management page

For extra details on how to recover IDs directly from the Docebo platform interface, this Community article on finding unique IDs (opens in a new tab) can be helpful.

In the next chapter we will see how, by using APIs, we can retrieve IDs not just for users and courses, but also for catalogs, learning plans, notifications, and more.

Retrieve IDs using the API browser

When IDs cannot be retrieved via the platform interface, some GET API endpoints can help. Here’s how to do it:

Check the response sample

Before launching the endpoint, check the response sample to ensure it includes the ID you need. The sample shows what data the API will return.

API reference for retrieving all courses with parameters and response sample shown.

Launch the endpoint

After verifying that the endpoint provides the needed ID, such as a course ID, you can make the appropriate API call.

Example API endpoint:

GET /learn/v1/courses

Remember to authenticate as described in the article Get started with the Docebo API browser.

Examples without usage of the API-Browser

In these examples, replace <yoursubdomain> with your actual Docebo platform URL and YOUR_ACCESS_TOKEN with your valid OAuth2 token.

This example uses curl for the requests and jq for JSON processing, Please make sure your environment has these commands available.

#!/bin/bash

# Configuration variables
DOMAIN="<yoursubdomain>.docebosaas.com"
TOKEN="YOUR_ACCESS_TOKEN"

# Perform the GET request to the courses endpoint
# We use -s (silent) to hide the progress bar
curl -s -X GET "https://$DOMAIN/learn/v1/courses" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" | jq -r '.data.items[] | "ID: \(.id_course) | Name: \(.course_name)"'

# EXPLANATION:
# .data.items[] iterates through the list of courses
# \(.id_course) extracts the specific ID needed for enrollments or updates

This script is ideal for modern web applications or Node.js environments. It authenticates using your access token and logs a list showing each course's name and ID.

/**
 * Script to retrieve all Course IDs from Docebo
 * Replace <yoursubdomain> and YOUR_ACCESS_TOKEN with your actual data
 */

const domain = "<yoursubdomain>.docebosaas.com";
const token = "YOUR_ACCESS_TOKEN";

async function getCourseIds() {
    try {
        const response = await fetch(`https://${domain}/learn/v1/courses`, {
            method: 'GET',
            headers: {
                'Authorization': `Bearer ${token}`,
                'Accept': 'application/json'
            }
        });

        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }

        const result = await response.json();
        
        // Iterate through items to extract course names and IDs
        result.data.items.forEach(course => {
            console.log(`Course Name: ${course.course_name} | ID: ${course.id_course}`);
        });
    } catch (error) {
        console.error('Error fetching courses:', error);
    }
}

getCourseIds();

Python is the standard for automation and data migration tasks. This script extracts and prints a clean list of IDs and their associated course names.

import requests

# Configuration variables
DOMAIN = "<yoursubdomain>.docebosaas.com"
TOKEN = "YOUR_ACCESS_TOKEN"

# Endpoint URL
url = f"https://{DOMAIN}/learn/v1/courses"

# Headers including authentication
headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Accept": "application/json"
}

def retrieve_course_ids():
    try:
        # Perform the GET request
        response = requests.get(url, headers=headers)
        
        # Raise an exception for any HTTP error statuses
        response.raise_for_status()
        
        data = response.json()
        
        # Parse the course items from the response data
        courses = data.get('data', {}).get('items', [])
        
        print("--- List of Courses ---")
        for course in courses:
            course_name = course.get('course_name')
            course_id = course.get('id_course')
            print(f"ID: {course_id} | Name: {course_name}")
            
    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    retrieve_course_ids()

Many enterprise systems use PHP for platform integrations. This script uses the native cURL library to fetch and display course information.

<?php
/**
 * PHP script to retrieve Course IDs from Docebo
 */

$domain = "<yoursubdomain>.docebosaas.com";
$token = "YOUR_ACCESS_TOKEN";

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => "https://$domain/learn/v1/courses",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $token",
        "Accept: application/json"
    ],
]);

$response = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    $result = json_decode($response, true);
    
    // Check if the request was successful and data exists
    if (isset($result['data']['items'])) {
        foreach ($result['data']['items'] as $course) {
            echo "Course ID: " . $course['id_course'] . " | Name: " . $course['course_name'] . "\n";
        }
    } else {
        echo "No courses found or error in response.";
    }
}
?>

Postman is recommended for manually testing and browsing dynamically generated JSON data.

  1. Create Request: Open a new tab and set the method to GET.

  2. Enter URL: Paste https://<yoursubdomain>.docebosaas.com/learn/v1/courses replacing <yoursubdomain> with your platform’s actual subdomain.

  3. Configure Authorization:

    1. Click the Auth tab.

    2. Select Bearer Token from the Type dropdown.

    3. Paste YOUR_ACCESS_TOKEN in the Token field.

  4. Action: Click Send.

  5. Review Output: The response body will contain an array of items. Look for the id_course field in each object to find the IDs you need.

Retrieve catalog IDs

To retrieve catalog IDs, you can follow a similar approach, taking some differences with other endpoints into consideration.

Find the endpoint and validate the response schema

As explained earlier, reviewing the response schema helps determine if the endpoint returns the ID you're looking for. Typically, the ID appears at the top of the response. However, for catalog IDs, it is usually located toward the end of each item in the response. The screenshots below highlight this difference:

API response sample showing course parameters and highlighted course ID field.

Returns all courses

API parameters for retrieving catalog content, including cursor and sorting options.

Retrieves some content for all the given catalogs

Launch the Catalog endpoint

Keep in mind:

When using the API, the returned list of catalog content depends on the course settings and catalog visibility rules for the user making the request. If a catalog is not visible or has not been associated with the requesting user, it will not appear in the results.

To retrieve catalog information within this scope, use the endpoint:

GET /learn/v1/catalog_content/internal/preview

API documentation showing parameters for retrieving catalog content with highlighted fields.

Scope the results

When using the API to retrieve catalog IDs, you can limit the number of results to just one to quickly access the course ID. This makes it easier to find the information you need. Keep in mind that only catalogs with associated courses or learning plans will be returned.

API parameters for retrieving catalog content, highlighting items per catalog and cursor settings.

Authenticate and launch the endpoint

Authenticate as described in the article article Get started with the Docebo API browser. Then use the Try button to send your request.

Identify the catalog ID in the response

Once the response is displayed, identify the catalog ID. Look for the extra_data field, where the catalog ID integer will be displayed:

JSON structure showing extra data with sales information and attributes.

Example: Use a catalog ID to retrieve a given catalog information

To retrieve details about a specific catalog, use the following endpoint:

GET /learn/v1/catalog_content/internal/{catalog_id}

This will provide all the content linked to that particular catalog.

Identify the endpoint and its requirements

Endpoint:

GET /learn/v1/catalog_content/internal/{catalog_id}

Requirements:

catalog_id is a required parameter

API reference showing parameters for retrieving catalog content, highlighting catalog_id input.

Retrieve the Catalog ID

Use the endpoint GET /learn/v1/catalog_content/internal/preview to get the catalog ID, as described in the preceding chapter.

Once you have the ID of the desired catalog, you can input it as a parameter for:
GET /learn/v1/catalog_content/internal/{catalog_id}

API endpoint for retrieving catalog content using a specific catalog ID parameter.

Authenticate and launch the endpoint

After authenticating, you can click Try to launch the endpoint.

OAuth button highlighted for testing API endpoint functionality in the interface.

The results will include the total number of courses in the catalog and detailed information for each course. The response structure is fixed and cannot be customized.

API response body showing item count and item ID details for a learning course.

By following these steps, you can efficiently retrieve and use IDs within the platform to interact with its various components using APIs.

Examples without usage of the API-Browser

In these examples, replace <yoursubdomain> with your actual Docebo platform URL and YOUR_ACCESS_TOKEN with your valid OAuth2 token.

This example uses curl for the requests and jq for JSON processing, Please make sure your environment has these commands available.

#!/bin/bash

# ==============================================================================
# DOCEBO API: RETRIEVING CATALOG DETAILS (CHAINED CALL)
# This script demonstrates how to fetch a list of catalogs, extract the ID
# of the first one, and then request the full details of that specific catalog.
# ==============================================================================

# 1. DEFINE YOUR VARIABLES
# Replace the placeholder values with your actual platform details.
DOMAIN="<yoursubdomain>.docebosaas.com"
TOKEN="YOUR_ACCESS_TOKEN"

echo "Checking for available catalogs..."

# 2. THE FIRST API CALL (The "List" Call)
# We call the 'preview' endpoint to get a list of catalogs. 
# We limit the result to 1 (page_size=1) because we only need one ID to demonstrate the chain.
LIST_RESPONSE=$(curl -s -X GET "https://$DOMAIN/learn/v1/catalog_content/internal/preview?page_size=1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json")

# 3. EXTRACT THE ID
# We use 'jq' to navigate the JSON structure. 
# In Docebo, the Catalog ID is found inside: data -> items -> [first item] -> extra_data -> id_catalog
CATALOG_ID=$(echo $LIST_RESPONSE | jq -r '.data.items[0].extra_data.id_catalog')

# 4. ERROR CHECKING
# Before making the second call, we ensure an ID was actually found.
if [ "$CATALOG_ID" == "null" ] || [ -z "$CATALOG_ID" ]; then
    echo "Error: No catalog was found in the response."
    exit 1
fi

echo "Successfully found Catalog ID: $CATALOG_ID"
echo "Fetching full details for this catalog..."

# 5. THE SECOND API CALL (The "Detail" Call)
# Now we plug the $CATALOG_ID variable directly into the URL path.
curl -s -X GET "https://$DOMAIN/learn/v1/catalog_content/internal/$CATALOG_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json" | jq .

# Note: The final '| jq .' simply formats the JSON output so it is easy to read in the terminal.

This script is ideal for modern web applications or Node.js environments. It authenticates using your access token and logs a list showing each course's name and ID.

/**
 * DOCEBO API CHAINING EXAMPLE
 * Logic: Fetch List -> Extract ID -> Fetch Detail
 */

const domain = "<yoursubdomain>.docebosaas.com";
const token = "YOUR_ACCESS_TOKEN";

async function fetchCatalogData() {
    const headers = {
        'Authorization': `Bearer ${token}`,
        'Accept': 'application/json'
    };

    try {
        // --- STEP 1: Fetch the list of catalogs ---
        console.log("Requesting catalog list...");
        const listResponse = await fetch(`https://${domain}/learn/v1/catalog_content/internal/preview?page_size=1`, { headers });
        
        const listJson = await listResponse.json();

        // --- STEP 2: Extract the specific ID ---
        // We use optional chaining (?.) to prevent the script from crashing if data is missing
        const catalogId = listJson.data?.items[0]?.extra_data?.id_catalog;

        if (!catalogId) {
            console.error("No Catalog ID found.");
            return;
        }

        console.log(`Found ID ${catalogId}. Requesting full details...`);

        // --- STEP 3: Use the ID to get more info ---
        // We inject the catalogId variable into the string using backticks ``
        const detailResponse = await fetch(`https://${domain}/learn/v1/catalog_content/internal/${catalogId}`, { headers });
        const detailJson = await detailResponse.json();

        // Log the final result to the console
        console.log("Full Catalog Details:", detailJson);

    } catch (error) {
        console.error("An error occurred during the API chain:", error);
    }
}

fetchCatalogData();

Python is the standard for automation and data migration tasks. This script extracts and prints a clean list of IDs and their associated course names.

import requests
import json

# ==============================================================================
# CONFIGURATION
# Set up your platform domain and the security token you generated.
# ==============================================================================
DOMAIN = "<yoursubdomain>.docebosaas.com"
TOKEN = "YOUR_ACCESS_TOKEN"

# Standard headers required for Docebo API calls
headers = {
    "Authorization": f"Bearer {TOKEN}",
    "Content-Type": "application/json"
}

def get_catalog_workflow():
    # --- STEP 1: Get the list of catalogs ---
    # We use a 'preview' endpoint which gives us a high-level list.
    list_url = f"https://{DOMAIN}/learn/v1/catalog_content/internal/preview"
    params = {"page_size": 1} # We only need the first one
    
    response = requests.get(list_url, headers=headers, params=params)
    
    # Check if the call was successful (Status Code 200)
    if response.status_code != 200:
        print(f"Failed to fetch list: {response.status_code}")
        return

    # Convert the raw response text into a Python Dictionary
    data = response.json()

    # --- STEP 2: Drill down into the Data ---
    # We navigate: data -> items list -> first index [0] -> extra_data -> id_catalog
    try:
        catalog_id = data['data']['items'][0]['extra_data']['id_catalog']
        print(f"Found Catalog ID: {catalog_id}")
    except (KeyError, IndexError):
        print("Could not find a Catalog ID in the response.")
        return

    # --- STEP 3: Get specific details using the ID ---
    # Now we build a NEW URL using the ID we just grabbed.
    detail_url = f"https://{DOMAIN}/learn/v1/catalog_content/internal/{catalog_id}"
    
    detail_response = requests.get(detail_url, headers=headers)
    
    # Print the final result in a pretty format
    print(json.dumps(detail_response.json(), indent=4))

if __name__ == "__main__":
    get_catalog_workflow()

Many enterprise systems use PHP for platform integrations. This script uses the native cURL library to fetch and display course information.

<?php
/**
 * DOCEBO API: Automated ID Retrieval and Chaining
 */

$domain = "<yoursubdomain>.docebosaas.com";
$token = "YOUR_ACCESS_TOKEN";

// --- STEP 1: Setup the initial call to get the list ---
$ch = curl_init("https://$domain/learn/v1/catalog_content/internal/preview?page_size=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer $token",
    "Accept: application/json"
]);

$listResponse = curl_exec($ch);
$listData = json_decode($listResponse, true);

// --- STEP 2: Extract the Catalog ID ---
// We navigate the array: data -> items -> first element -> extra_data -> id_catalog
$catalogId = $listData['data']['items'][0]['extra_data']['id_catalog'];

if ($catalogId) {
    echo "Found Catalog ID: " . $catalogId . "\n";

    // --- STEP 3: Reuse the cURL handle for the second call ---
    // We update the URL to include the ID we just found
    curl_setopt($ch, CURLOPT_URL, "https://$domain/learn/v1/catalog_content/internal/$catalogId");
    
    $detailResponse = curl_exec($ch);
    
    // Output the final JSON result
    echo $detailResponse;
} else {
    echo "Error: Could not find a Catalog ID.";
}

curl_close($ch);
?>

Postman is recommended for manually testing and browsing dynamically generated JSON data.

This example uses variables to pass data between requests automatically.

  1. Request A (The Fetcher):

    1. Set Method to GET.

    2. URL: https://{{domain}}/learn/v1/catalog_content/internal/preview?page_size=1.

    3. Click the Tests tab and paste this script:

      // Parse the response into a variable
      var jsonData = pm.response.json();
      // Extract the ID
      var catalogId = jsonData.data.items[0].extra_data.id_catalog;
      // Save the ID into the environment so the next request can see it
      pm.environment.set("active_catalog_id", catalogId);
      console.log("Saved Catalog ID: " + catalogId);
  2. Request B (The Receiver):

    1. Set Method to GET.

    2. URL: https://{{domain}}/learn/v1/catalog_content/internal/{{active_catalog_id}}.

    3. Because you used {{active_catalog_id}}, Postman will automatically fill in the ID that Request A just saved.

List of APIs to retrieve IDs

In the preceding chapters you saw some examples of how to use APIs to retrieve IDs of objects in the platform. Now you can try to apply a similar pattern to retrieve other IDs.

The following tables provide some suggestions of endpoints that you can use to retrieve commonly-used platform IDs. The lists are organized by service, but be aware that sometimes you can retrieve IDs of a particular object from more than one service. As explained in the preceding examples, after you make a call, use the schema in the API browser to determine where the ID can be found in the response.

Tip:

This is not a comprehensive list of all the ways you can potentially retrieve IDs, just a selection of useful endpoints. In addition, remember that visibility rules apply to the responses of these endpoints; the objects included in the responses will depend on the permissions and resource assignments of the user making the call.  In particular:

  • For Power Users, their visibility on objects depends on their permissions and resource assignments

  • In addition, some endpoints may not return all objects. For example, users (even Superadmins) only have visibility on the catalogs to which they are assigned.

Learn service

Retrieve the IDs of

Endpoint / Notes

Courses

GET /learn/v1/courses

Catalogs

GET /learn/v1/catalog_content/internal/preview

Notes:

  • The cursor parameter is required (use the default value 0)

  • The catalog ID is in the extra_data field

  • Only catalogs assigned to the user are included in the response

Categories

GET /learn/v1/categories

Certifications

GET /learn/v1/certification

Classrooms

GET /learn/v1/classroom

Sessions

GET /learn/v1/courses/{course_id}/sessions/enrollments

Note:

  • The course_id parameter is required

Course additional fields

GET /learn/v1/courses/field

Training materials

GET /learn/v1/courses/{course_id}/los

Note:

  • The course_id parameter is required

External training

GET /learn/v1/external_training

Assignments submission

GET /learn/v1/instructor/assignment

Location classroom

GET /learn/v1/location

Note:

  • This is also visible in the platform interface

Subscription bundle

GET /learn/v1/sub_bundle

Subscription bundle additional fields

GET /learn/v1/sub_field

Subscription plans

GET /learn/v1/sub_plan

Subscription records

GET /learn/v1/sub_record

Web conference tools paired with the platform

GET /learn/v1/webinar/accounts (Zoom)

GET /learn/v1/webinar/adobeconnect/accounts (Adobe connect)

GET /learn/v1/webinar/gotomeeting/accounts (GotoMeeting)

GET /learn/v1/webinar/msteams/accounts (Microsoft Teams)

Manage service

Retrieve the IDs of

Endpoint / Notes

Channels

GET /manage/v1/channels

Note:

  • Only channels visible to the user are returned

Content partners

GET /manage/v1/contentpartners

Legacy enrollment rules

GET /manage/v1/enrollment_rules

Enrollment field

GET /manage/v1/enrollment_fields

Manager types

GET /manage/v1/managers/types

Extended enterprise domains

GET /manage/v1/multidomain

Branches

GET /manage/v1/orgchart

Privacy policies

GET /manage/v1/policy

Tags

GET /manage/v1/tags

Terms & conditions

GET /manage/v1/termsandconditions

Users

GET /manage/v1/user

User additional fields

GET /manage/v1/user_fields

Skills service

Retrieve the IDs of

Endpoint / Notes

Skills list

GET /skill/v1/skills/catalog

Skill groups

GET /skill/v1/skillgroups

Workforce category list

GET /skill/v1/workforce/categories

Share service

Retrieve the IDs of

Endpoint / Notes

Channels

GET /share/v1/admin/channels

Assets

GET /share/v1/admin/assets

Assets by user

GET /share/v1/assets

Note:

  • Only assets assigned to channels visible to the user are returned

Experts

GET /share/v1/admin/assets

Questions

GET /share/v1/questions

GET /share/v1/questions/list

Answers

GET /share/v1/answers

Comments

GET /share/v1/comments

Playlists

GET /share/v1/playlists

Note:

  • The type_content parameter is required. Possible values are asset or
    my-course.

Share (Gamification) service

Retrieve the IDs of

Endpoint / Notes

Training materials

GET /share/v1/gamification/courses/{id_course}/los

Note:

  • The id_course parameter is required

Badges

GET /share/v1/gamification/badges

Badges collections

GET /share/v1/gamification/collections

Badge images

GET /share/v1/gamification/badges/images

Ecommerce service

Retrieve the IDs of

Endpoint / Notes

Coupons

GET /ecommerce/v1/coupon

Transactions

GET /ecommerce/v1/transaction

GET /ecommerce/v1/transaction/list

Report service

Retrieve the IDs of

Endpoint / Notes

External training records (transcript)

GET /report/v1/mytranscript

Query builder report ID

GET /report/v1/query_builder

Legacy reports ID

GET /report/v1/report

Pages service

Retrieve the IDs of

Endpoint / Notes

Menus

GET /pages/v1/menus

Pages

GET /pages/v1/pages

OTJ (Checklists) service

Retrieve the IDs of

Endpoint / Notes

Checklist

GET /otj/v1/checklists

Checklist version

GET /otj/v1/checklists/{checklist_id}/versions

Note:

  • The checklist_id parameter is required

Courses service

Retrieve the IDs of

Endpoint / Notes

Course

GET /course/v1/courses

Session

GET /course/v1/sessions/ilt

Events by session

GET /course/v1/sessions/{session_id}/events

Note:

  • The session_id parameter is required

Thumbnails

GET /course/v1/thumbnails

Analytics service

Retrieve the IDs of

Endpoint / Notes

Query builder reports IDs

GET /analytics/v1/custom-report-types/active

Query builder reports IDs

GET /analytics/v1/custom-report-types

New reports (No legacy)

GET /analytics/v1/reports

Audiences service

Retrieve the IDs of

Endpoint / Notes

Audience ID (Group)

GET /audiences/v1/audience

Group ID by audience ID

GET /audiences/v1/audience/{uuid}/audience_to_group

Note:

  • The uuid parameter is required

Audience ID by group ID

GET /audiences/v1/audience/{id}/group_to_audience

Note:

  • The id parameter is required

Powerusers service

Retrieve the IDs of

Endpoint / Notes

Power Users

GET /poweruser/v1/powerusers

Power User profiles

GET /poweruser/v1/profile

Power Users by profile ID

GET /poweruser/v1/profiles/{profile_id}/poweruser

Note:

  • The profile_id parameter is required

Learningplan service

Retrieve the IDs of

Endpoint / Notes

Learning plans

GET /learningplan/v1/learningplans

Learning plan additional fields

GET /learningplan/v1/learningplans/{learning_plan_id}/additionalfields
Note:

  • The learning_plan_id parameter is required

Enrollment service

Retrieve the IDs of

Endpoint / Notes

Archived enrollment record IDs

GET /enrollment/v1/courses/{course_id}/archives

Note:

  • The course_id parameter is required

Session list of archived course enrollments

GET /enrollment/v1/courses/archives/{record_id}/sessions

Note:

  • The record_id parameter is required