---
title: "Retrieve Schema Difference"
method: POST
path: "/schema/diff"
tags: ["Schema"]
---

# Retrieve Schema Difference

`POST /schema/diff`

Compare the current instance's schema against the schema snapshot in JSON request body or a JSON/YAML file and retrieve the difference. This endpoint is only available to admin users.

## Query parameters

- `force` boolean

## Request body

- object
  - `data` Schema
    - `version` integer
    - `directus` string
    - `vendor` string
    - `collections` Collections[]
      - `collection` string — The collection key.
      - `icon` string, nullable
      - `note` string, nullable
      - `display_template` string, nullable
      - `hidden` boolean
      - `singleton` boolean
      - `translations` unknown
      - `archive_field` string, nullable
      - `archive_app_filter` boolean
      - `archive_value` string, nullable
      - `unarchive_value` string, nullable
      - `sort_field` string, nullable
      - `accountability` string, nullable
      - `color` string, nullable
      - `item_duplication_fields` unknown
      - `sort` integer, nullable
      - `group` union
        - string
        - Collections — recursive
      - `collapse` string
      - `preview_url` string, nullable
      - `versioning` boolean
    - `fields` Fields[]
      - `id` integer
      - `collection` string — Unique name of the collection this field is in.
      - `field` string — Unique name of the field. Field name is unique within the collection.
      - `special` string[], nullable
      - `interface` string, nullable
      - `options` unknown
      - `display` string, nullable
      - `display_options` unknown
      - `readonly` boolean
      - `hidden` boolean
      - `sort` integer, nullable
      - `width` string, nullable
      - `translations` unknown
      - `note` string, nullable
      - `conditions` unknown
      - `required` boolean, nullable
      - `group` union
        - integer
        - Fields — recursive
      - `validation` unknown
      - `validation_message` string, nullable
      - `searchable` boolean
    - `relations` Relations[]
      - `id` integer — Unique identifier for the relation.
      - `many_collection` string — Collection that has the field that holds the foreign key.
      - `many_field` string — Foreign key. Field that holds the primary key of the related collection.
      - `one_collection` string — Collection on the _one_ side of the relationship.
      - `one_field` string, nullable — Alias column that serves as the _one_ side of the relationship.
      - `one_collection_field` string, nullable
      - `one_allowed_collections` string[], nullable
      - `junction_field` string, nullable — Field on the junction table that holds the many field of the related relation.
      - `sort_field` string, nullable
      - `one_deselect_action` string

## Response `200`

Successful request

- object
  - `data` Diff
    - `hash` string
    - `diff` object
      - `collections` object[]
        - `collection` string
        - `diff` object[]
      - `fields` object[]
        - `collection` string
        - `field` string
        - `diff` object[]
      - `relations` object[]
        - `collection` string
        - `field` string
        - `related_collection` string
        - `diff` object[]

## Other responses

- `204` — No schema difference.
- `403` — Error: Unauthorized request

## Changes

> 5 revisions in range; 1 could not be searched.

- **2025-09-18** `4c523c5346af` — 1 warning
  - removed the request property `data/fields/items/searchable`

[Change history](https://skmtc.dev/utomic-media/apis/dynamic-api-specification/changes/schema/diff/post.md)

---

[API](https://skmtc.dev/utomic-media/apis/dynamic-api-specification.md) · [All operations](https://skmtc.dev/utomic-media/apis/dynamic-api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/utomic-media/dynamic-api-specification/revisions/4a0ccd34700e/schema)
