TutorialsOfficial documentation9 min readTutorials

Retrieve FastGPT Organizational Data via SSO Interface

This document details the FastGPT SSO standard Get Organizations interface, used to synchronize organizational department data between FastGPT and your in…

Interface Overview

This document details the FastGPT SSO standard Get Organizations interface, used to synchronize organizational department data between FastGPT and your integrated identity management system. A mandatory prerequisite for using this interface: only one root department is supported. If your identity system contains multiple root departments, you must first create a virtual root department to aggregate all top-level departments before submitting requests via this API.

Request Specification

This is an authenticated GET request with two required HTTP headers. The endpoint URL should be replaced with your organization's configured SSO API endpoint.

Request Details

HTTP MethodEndpoint Pattern
GEThttps://your-domain/org/list

Required Headers

Header NameFormat ExamplePurpose
AuthorizationBearer [REDACTED_CREDENTIAL]Authenticate the API request with a valid bearer token
Content-Typeapplication/jsonDeclare the request content type for proper parsing

A complete curl request example is provided below:

curl -X GET "https://example.com/org/list" \
-H "Authorization: Bearer [REDACTED_CREDENTIAL]" \
-H "Content-Type: application/json"

Response Structure & Examples

All responses follow the OrgListResponseType TypeScript definition. The response includes a success flag, optional error message, and an array of department objects.

Core Response Fields

Field NameTypeDescription
successbooleanIndicates whether the request completed successfully
messagestring?Optional error message provided if the request fails
orgListDepartment[]Array of department objects matching the FastGPT organizational structure

Each department object in orgList includes these fields:

Field NameTypeDescription
idstringUnique alphanumeric identifier for the department
namestringHuman-readable display name of the department
parentIdstringUnique identifier of the parent department; empty string for root departments

A critical note: Only one root department can exist in the synchronized organization data. If your source system has multiple root departments, you must add a virtual root department first.

TypeScript Response Type

type OrgListResponseType = {
  message?: string; // Error message
  success: boolean;
  orgList: {
    id: string; // Unique department ID
    name: string; // Name
    parentId: string; // parentId — empty string for root department
  }[];
};

Sample Successful Response

{
  "success": true,
  "message": "",
  "orgList": [
    {
      "id": "od-125151515",
      "name": "Root Department",
      "parentId": ""
    },
    {
      "id": "od-51516152",
      "name": "Sub Department",
      "parentId": "od-125151515"
    }
  ]
}

Source: FastGPT official source

Applicability and version scope

Use this page for the documented Tutorials scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.

Safety guardrails

Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.

Rollback guidance

Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.