---
title: "Handles a slash command interaction in a Discord bot."
method: POST
path: "/handleInteraction"
---

# Handles a slash command interaction in a Discord bot.

`POST /handleInteraction`

This function processes a slash command interaction received from Discord. It retrieves the corresponding command handler for the interaction and executes it, managing the lifecycle of slash command interactions in a Discord bot.

## Request body

- object
  - `body` object — Body of the handleInteraction sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'apikey' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/discord

## Response `200`

Interaction handled successfully

- object
  - `success` boolean — Indicates if the interaction was handled successfully
  - `message` string — A message describing the result of the interaction handling

## Other responses

- `400` — Bad request - invalid interaction object
- `404` — Command handler not found
- `500` — Internal server error

---

[API](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api.md) · [All operations](https://skmtc.net/microfox-ai/apis/microfox-discord-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/microfox-ai/microfox-discord-sdk-api/versions/7cb5b64ae924/schema)
