Dynamic API Specification (bb7ef9bb756fdb87e88a5b6c118ae5089b45237b)

Download OpenAPI specification:

This is a dynamically generated API specification for all endpoints existing on the current project.

Assets

Image typed files can be dynamically resized and transformed to fit any need.

Get an Asset

Image typed files can be dynamically resized and transformed to fit any need.

path Parameters
id
required
string

The id of the file.

query Parameters
key
string

The key of the asset size configured in settings.

transforms
string

A JSON array of image transformations

download
boolean

Download the asset to your computer

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Authentication

All data within the platform is private by default. The public role can be configured to expose data without authentication, or you can pass an access token to the API to access private data.

Retrieve a Temporary Access Token

Retrieve a Temporary Access Token

Request Body schema: application/json
email
required
string

Email address of the user you're retrieving the access token for.

password
required
string <password>

Password of the user.

mode
string
Default: "json"
Enum: "json" "cookie" "session"

Whether to retrieve the refresh token in the JSON response, or in a httpOnly cookie.

otp
string

The user's one-time-password (if MFA is enabled).

Responses

Request samples

Content type
application/json
{
  • "email": "admin@example.com",
  • "password": "password",
  • "mode": "json",
  • "otp": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Refresh Token

Refresh a Temporary Access Token.

Request Body schema: application/json
refresh_token
string

JWT access token you want to refresh. This token can't be expired.

mode
string
Default: "json"
Enum: "json" "cookie" "session"

Whether to submit and retrieve the refresh token in the JSON response, or in a httpOnly cookie.

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "eyJ0eXAiOiJKV...",
  • "mode": "json"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Log Out

Log Out

Request Body schema: application/json
refresh_token
string

The refresh token to invalidate. If you have the refresh token in a cookie through /auth/login, you don't have to submit it here.

mode
string
Enum: "json" "cookie" "session"

Whether the refresh token is submitted in the JSON response, or in a httpOnly cookie.

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "eyJ0eXAiOiJKV...",
  • "mode": "json"
}

Request a Password Reset

Request that a password reset email be sent. This does not apply to users authenticated through external providers (OAuth, SAML, LDAP, etc.).

Request Body schema: application/json
email
required
string

Email address of the user you're requesting a reset for.

Responses

Request samples

Content type
application/json
{
  • "email": "admin@example.com"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Reset a Password

The request a password reset endpoint sends an email with a link to the admin app which in turn uses this endpoint to allow the user to reset their password.

Request Body schema: application/json
token
required
string

One-time use JWT token that is used to verify the user.

password
required
string <password>

New password for the user.

Responses

Request samples

Content type
application/json
{
  • "token": "eyJ0eXAiOiJKV1Qi...",
  • "password": "password"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

List OAuth Providers

List configured OAuth providers.

Responses

Response samples

Content type
application/json
{
  • "public": true,
  • "data": [
    ]
}

Authenticated using an OAuth provider

Start OAuth flow using the specified provider

path Parameters
provider
required
string

Key of the activated OAuth provider.

query Parameters
redirect
string

Where to redirect on successful login.
If set the authentication details are set inside cookies otherwise a JSON is returned.

Responses

Response samples

Content type
application/json
{
  • "public": true,
  • "data": {
    }
}

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

Perform a system status check and return the options.

query Parameters
super_admin_token
required
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

Response samples

Content type
application/json
{
  • "data": { }
}

Ping

Ping, pong. Ping.. pong.

Responses

Files

Files can be saved in any given location. Directus has a powerful assets endpoint that can be used to generate thumbnails for images on the fly.

List Files

List the files.

query Parameters
fields
Array of strings

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

offset
integer

How many items to skip when fetching data.

sort
Array of strings

How to sort the returned items. sort is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ? to sort randomly.

filter
object
Example: filter={"<field>":{"<operator>":"<value>"}}

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

meta
string

What metadata to return in the response.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve a Files

Retrieve a single file by unique identifier.

path Parameters
id
required
string
Example: 8cbb43fe-4cdf-4991-8352-c461779cec02

Unique identifier for the object.

query Parameters
fields
Array of strings

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

ItemsBlogPosts

List Items

List the blog_posts items.

Authorizations:
Auth
query Parameters
fields
Array of strings

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
Array of strings

How to sort the returned items. sort is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ? to sort randomly.

filter
object
Example: filter={"<field>":{"<operator>":"<value>"}}

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve an Item

Retrieve a single blog_posts item by unique identifier.

path Parameters
required
integer or string

Index of the item.

query Parameters
fields
Array of strings

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

version
string

Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Items

List Items

List the blog_posts items.

Authorizations:
Auth
query Parameters
fields
Array of strings

Control what fields are being returned in the object.

limit
integer

A limit on the number of objects that are returned.

meta
string

What metadata to return in the response.

offset
integer

How many items to skip when fetching data.

sort
Array of strings

How to sort the returned items. sort is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (-) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ? to sort randomly.

filter
object
Example: filter={"<field>":{"<operator>":"<value>"}}

Select items in collection by given conditions.

search
string

Filter by items that contain the given search query in one of their fields.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "meta": {
    }
}

Retrieve an Item

Retrieve a single blog_posts item by unique identifier.

path Parameters
required
integer or string

Index of the item.

query Parameters
fields
Array of strings

Control what fields are being returned in the object.

meta
string

What metadata to return in the response.

version
string

Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}