Server

Access to where Directus runs. Allows you to make sure your server has everything needed to run the platform, and check what kind of latency we're dealing with.

System Info

Provides detailed information about the project server, its schema, and its health.

Query Parameters

super_admin_token
integer

The first time you create a project, the provided token will be saved and required for subsequent project installs. It can also be found and configured in /config/__api.json on your server.

Responses

Successful request
data
object
import { createDirectus, rest, serverInfo } from '@directus/sdk';

const client = createDirectus('directus_project_url').with(rest());

const result = await client.request(serverInfo());
Response Example
{
  "data": {
    "id": 1,
    "project_name": "Directus",
    "project_url": null,
    "project_color": null,
    "project_logo": null,
    "public_foreground": null,
    "public_background": null,
    "public_note": null,
    "auth_login_attempts": 25,
    "storage_asset_transform": "all",
    "storage_asset_presets": null,
    "basemaps": [],
    "module_bar": [],
    "custom_aspect_ratios": [],
    "theme_light_overrides": {},
    "theme_dark_overrides": {},
    "ai_openai_allowed_models": [],
    "ai_anthropic_allowed_models": [],
    "ai_google_allowed_models": [],
    "ai_openai_compatible_headers": [
      {}
    ],
    "ai_openai_compatible_models": [
      {}
    ]
  }
}

Ping

Ping, pong. Ping.. pong.

Responses

Successful request
import { createDirectus, rest, serverPing } from '@directus/sdk';

const client = createDirectus('directus_project_url').with(rest());

const result = await client.request(serverPing());
Response Example
pong

Get GraphQL SDL

Retrieve the GraphQL SDL for the current project.

Responses

GraphQL SDL file.
import { createDirectus, rest, readGraphqlSdl } from '@directus/sdk';

const client = createDirectus('directus_project_url').with(rest());

const result = await client.request(readGraphqlSdl(scope));

Get OpenAPI Specification

Retrieve the OpenAPI spec for the current project.

Responses

Successful request
import { createDirectus, rest, readOpenApiSpec } from '@directus/sdk';

const client = createDirectus('directus_project_url').with(rest());

const result = await client.request(readOpenApiSpec());
Response Example
{}

Health

Shows you a general health status for the server and all connected (third party) services. By default, the endpoint only returns a status of ok, warn or error. By authenticating as an admin, it will return more in-depth information about the current health status of the system.

Responses

Successful request
status
string

One of ok, warn, error.

releaseId
string

Directus version in use. Only returned when authenticated as admin.

serviceId
string

Public URL of the current Directus instance. Only returned when authenticated as admin.

checks
object

Object keyed by service name (e.g. "pg:responseTime"), each containing an array of health check results for that service. Only returned when authenticated as admin.

import { createDirectus, rest, serverHealth } from '@directus/sdk';

const client = createDirectus('directus_project_url').with(rest());

const result = await client.request(serverHealth());
Response Example
{
  "status": "warn",
  "releaseId": "10.0.0",
  "serviceId": "https://directus.example.com",
  "checks": {}
}