> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inkyswap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Messages

> Retrieve and post chat messages for a token

## GET - Retrieve Messages

Fetch chat messages for a specific token.

### Query Parameters

<ParamField query="tokenAddress" type="string" required>
  The token contract address
</ParamField>

<ParamField query="limit" type="number" default="50">
  Maximum number of messages to return
</ParamField>

<ParamField query="offset" type="number" default="0">
  Number of messages to skip for pagination
</ParamField>

### Response

Returns an array of message objects directly:

<Expandable title="Message Object">
  <ResponseField name="id" type="string">
    Unique message ID
  </ResponseField>

  <ResponseField name="token_address" type="string">
    Token contract address
  </ResponseField>

  <ResponseField name="sender_address" type="string">
    Ethereum address of the sender
  </ResponseField>

  <ResponseField name="message" type="string">
    Message content (max 500 characters)
  </ResponseField>

  <ResponseField name="created_at" type="string">
    ISO timestamp of when the message was sent
  </ResponseField>
</Expandable>

## POST - Send Message

<Warning>
  **API Access Required**: To use the POST endpoint for sending messages, please contact [@emperoroftheink](https://t.me/emperoroftheink) on Telegram for access credentials and usage guidelines.
</Warning>

Post a new chat message for a token.

### Request Body

<ParamField body="token" type="string" required>
  Cloudflare Turnstile verification token
</ParamField>

<ParamField body="tokenAddress" type="string" required>
  The token contract address
</ParamField>

<ParamField body="message" type="string" required>
  Message content (max 500 characters)
</ParamField>

<ParamField body="signature" type="string" required>
  Ethereum signature for authentication
</ParamField>

### Rate Limits

* Maximum 5 messages per minute per address

<ResponseExample>
  ```json theme={null}
  [
    {
      "id": "msg_123456",
      "token_address": "0x1234567890abcdef1234567890abcdef12345678",
      "sender_address": "0xabcdef1234567890abcdef1234567890abcdef12",
      "message": "This token looks promising!",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ]
  ```
</ResponseExample>

### POST Response Example

<ResponseExample>
  ```json theme={null}
  {
    "id": "msg_789012",
    "token_address": "0x1234567890abcdef1234567890abcdef12345678",
    "sender_address": "0xabcdef1234567890abcdef1234567890abcdef12",
    "message": "Great project!",
    "created_at": "2024-01-15T11:00:00Z"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://inkypump.com/api/chat?tokenAddress=0x1234567890abcdef1234567890abcdef12345678&limit=50"

  curl -X POST "https://inkypump.com/api/chat" \
    -H "Content-Type: application/json" \
    -d '{
      "token": "TURNSTILE_TOKEN",
      "tokenAddress": "0x1234567890abcdef1234567890abcdef12345678",
      "message": "Great project!",
      "signature": "0xSignature..."
    }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch('https://inkypump.com/api/chat?tokenAddress=0x1234...&limit=50');
  const messages = await response.json();

  const postResponse = await fetch('https://inkypump.com/api/chat', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      token: turnstileToken,
      tokenAddress: '0x1234...',
      message: 'Great project!',
      signature: signature
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://inkypump.com/api/chat",
      params={"tokenAddress": "0x1234...", "limit": 50}
  )
  messages = response.json()

  response = requests.post(
      "https://inkypump.com/api/chat",
      json={
          "token": "TURNSTILE_TOKEN",
          "tokenAddress": "0x1234...",
          "message": "Great project!",
          "signature": "0xSignature..."
      }
  )
  ```
</RequestExample>
