---
title: "Create Slash Command"
method: POST
path: "/api/slash-commands"
---

# Create Slash Command

`POST /api/slash-commands`

## Request body

- SlashCommandMutationRequest
  - `description` string, required
  - `name` string, required
  - `prompt` string, required
  - `targets` string[], nullable

## Response `200`

Successful Response

- SlashCommandMutationResponse
  - `command` SlashCommandResponse, required
    - `description` string, required
    - `name` string, required
    - `prompt` string, required
    - `syncTargets` SlashSyncEntryResponse[], required
      - `error` string, nullable
      - `path` string, required
      - `status` 'synced' | 'removed' | 'not_selected' | 'blocked_manual_file' | 'blocked_modified_file' | 'missing' | 'drifted' | 'failed', required
      - `target` 'opencode' | 'claude' | 'cursor' | 'codex', required
  - `ok` boolean, required
  - `sync` SlashSyncEntryResponse[], required
    - `error` string, nullable
    - `path` string, required
    - `status` 'synced' | 'removed' | 'not_selected' | 'blocked_manual_file' | 'blocked_modified_file' | 'missing' | 'drifted' | 'failed', required
    - `target` 'opencode' | 'claude' | 'cursor' | 'codex', required

## Other responses

- `422` — Validation Error

## Changes

- **2026-04-29** `2073c669fff2` — 6 warning
  - added the new `blocked_modified_file` enum value to the `command/anyOf[subschema #1: SlashCommandResponse]/syncTargets/items/status` response property for the response status `200`
  - added the new `blocked_modified_file` enum value to the `sync/items/status` response property for the response status `200`
  - added the new `drifted` enum value to the `command/anyOf[subschema #1: SlashCommandResponse]/syncTargets/items/status` response property for the response status `200`
  - added the new `drifted` enum value to the `sync/items/status` response property for the response status `200`
  - …2 more
- **2026-04-29** `7710f75fad0f` — 1 info
  - endpoint added
- **2026-04-17** `a9787ab8c53c` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/mode-io/apis/skill-manager/changes/api/slash-commands/post.md)

---

[API](https://skmtc.dev/mode-io/apis/skill-manager.md) · [All operations](https://skmtc.dev/mode-io/apis/skill-manager/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mode-io/skill-manager/revisions/a2b29a5aa8b4/schema)
