> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.apologist.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.apologist.ai/_mcp/server.

# Discord Interaction Webhook

POST https://your-agent-domain.com/api/v1/channels/{id}/discord
Content-Type: application/json

Receives Discord interaction callbacks for the channel. Requests are verified via Ed25519 signature headers; unsigned or invalid requests are rejected. Payload shape is defined by Discord.

Reference: https://docs.apologist.ai/agent-api/api-reference/channels/receive-discord-interaction

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: agent-api
  version: 1.0.0
paths:
  /channels/{id}/discord:
    post:
      operationId: receiveDiscordInteraction
      summary: Discord Interaction Webhook
      description: >-
        Receives Discord interaction callbacks for the channel. Requests are
        verified via Ed25519 signature headers; unsigned or invalid requests are
        rejected. Payload shape is defined by Discord.
      tags:
        - channels
      parameters:
        - name: id
          in: path
          description: The channel id
          required: true
          schema:
            type: string
        - name: x-signature-ed25519
          in: header
          description: Discord request signature (hex).
          required: true
          schema:
            type: string
        - name: x-signature-timestamp
          in: header
          description: Discord request timestamp.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Interaction handled
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Channels_receiveDiscordInteraction_Response_200
        '400':
          description: Empty or invalid body
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Invalid signature
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        description: Discord interaction payload.
        content:
          application/json:
            schema:
              type: object
              properties: {}
servers:
  - url: https://your-agent-domain.com/api/v1
    description: Production server
components:
  schemas:
    Channels_receiveDiscordInteraction_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Channels_receiveDiscordInteraction_Response_200

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{}
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient();
    await client.channels.receiveDiscordInteraction("id", {
        signatureEd25519: "x-signature-ed25519",
        signatureTimestamp: "x-signature-timestamp",
        body: {},
    });
}
main();

```

```python
from apologist import ApologistAgent

client = ApologistAgent()

client.channels.receive_discord_interaction(
    id="id",
    signature_ed25519="x-signature-ed25519",
    signature_timestamp="x-signature-timestamp",
    request={},
)

```

```java
package com.example.usage;

import ai.apologist.AgentClient;
import ai.apologist.resources.channels.requests.ReceiveDiscordInteractionRequest;
import java.util.HashMap;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .build();

        client.channels().receiveDiscordInteraction(
            "id",
            ReceiveDiscordInteractionRequest
                .builder()
                .signatureEd25519("x-signature-ed25519")
                .signatureTimestamp("x-signature-timestamp")
                .body(
                    new HashMap<String, Object>()
                )
                .build()
        );
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new

client.channels.receive_discord_interaction(
  id: "id",
  signature_ed25519: "x-signature-ed25519",
  signature_timestamp: "x-signature-timestamp",
  body: {}
)

```

```csharp
using Apologist;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new AgentClient();

        await client.Channels.ReceiveDiscordInteractionAsync(
            new ReceiveDiscordInteractionRequest {
                Id = "id",
                SignatureEd25519 = "x-signature-ed25519",
                SignatureTimestamp = "x-signature-timestamp",
                Body = new Dictionary<string, object?>()
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    apgsdkgo "github.com/apologist-project/apg-sdk-go"
    client "github.com/apologist-project/apg-sdk-go/client"
)

func do() {
    client := client.NewApologistAgentClient()
    request := &apgsdkgo.ReceiveDiscordInteractionRequest{
        ID: "id",
        SignatureEd25519: "x-signature-ed25519",
        SignatureTimestamp: "x-signature-timestamp",
        Body: map[string]any{},
    }
    client.Channels.ReceiveDiscordInteraction(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;
use Apologist\Channels\Requests\ReceiveDiscordInteractionRequest;

$client = new AgentClient();
$client->channels->receiveDiscordInteraction(
    'id',
    new ReceiveDiscordInteractionRequest([
        'signatureEd25519' => 'x-signature-ed25519',
        'signatureTimestamp' => 'x-signature-timestamp',
        'body' => [],
    ]),
);

```

```swift
import Foundation

let headers = [
  "x-signature-ed25519": "x-signature-ed25519",
  "x-signature-timestamp": "x-signature-timestamp",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/channels/id/discord")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```