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

# Run a message action

> Edit, delete, forward, pin or unpin one exact message. Requires messages:edit, messages:delete, messages:forward or messages:pin according to action. Forward also requires messages:write on its selected target. Edit/delete apply only to linked-account own sent messages. Groups and DMs are supported with full current account/chat/message proof. Unknown effects remain locked; never automatically retry.



## OpenAPI

````yaml /openapi.json post /chats/{chatId}/messages/{messageId}/actions
openapi: 3.1.0
info:
  title: SuperSkope Customer API
  version: 1.4.0
  description: >-
    Dedicated selected-phone customer API. Keys remain server-side, bound to one
    phone, granular permissions and exact selected conversations. groups:create
    explicitly grants phone-wide creation. The separate opt-in groups:created
    grants conversation access only to verified groups created by this key on
    this phone; every read/send/management scope remains required. Stable
    Idempotency-Key required for mutations; unknown operations never retry.
    Staff administration and arbitrary engine/session lifecycle calls are
    excluded. Additive transport routes expose capabilities, exact messages,
    verified access, private pictures, explicit chat state actions and retained
    group history. Older installations may not provide them. Existing registered
    agents can be explicitly delegated to scoped customer keys; pull agents can
    be created and enrolled within exact owner-granted scopes; existing callback
    identities remain separately delegated compatibility clients.
servers:
  - url: https://api.superskope.com/api/v1
    description: SuperSkope API
  - url: https://{installation}/api/v1
    description: >-
      Dedicated installation. Replace the host with your installation's HTTPS
      origin.
    variables:
      installation:
        default: api.superskope.com
        description: Hostname of your SuperSkope installation.
security: []
tags:
  - name: Connection
    description: Check the linked phone, pair it, confirm it and disconnect it.
  - name: Messages
    description: >-
      Read conversations, send messages and files, react and run message
      actions.
  - name: Transport
    description: >-
      Capabilities, exact messages, verified access, pictures, chat state and
      history.
  - name: Events and logs
    description: Metadata events, request state for uncertain operations and request logs.
  - name: Groups
    description: List, create and manage selected WhatsApp groups.
  - name: Scheduling
    description: Recurring and one-off messages to selected groups.
  - name: Work and reports
    description: Tickets, tasks, chat labels and fields, shared library and reports.
  - name: Agents
    description: >-
      Pull agents, delegated agents, enrollment, activations, typing presence
      and pause controls.
  - name: Keys and MCP
    description: >-
      Inspect the calling key and connect MCP clients to the hosted MCP
      endpoint.
paths:
  /chats/{chatId}/messages/{messageId}/actions:
    post:
      tags:
        - Messages
      summary: Run a message action
      description: >-
        Edit, delete, forward, pin or unpin one exact message. Requires
        messages:edit, messages:delete, messages:forward or messages:pin
        according to action. Forward also requires messages:write on its
        selected target. Edit/delete apply only to linked-account own sent
        messages. Groups and DMs are supported with full current
        account/chat/message proof. Unknown effects remain locked; never
        automatically retry.
      operationId: postChatsChatIdMessagesMessageIdActions
      parameters:
        - name: chatId
          in: path
          required: true
          schema:
            type: string
        - name: messageId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{8,128}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageAction'
      responses:
        '200':
          description: Completed action result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageActionResult'
        '400':
          description: >-
            Invalid fields, ID, cursor or request key. For mutations, an HTTP
            error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Customer credential missing, expired or revoked. For mutations, an
            HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Scope, number, conversation or origin is not authorized. For
            mutations, an HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Route or authorized resource is unavailable. For mutations, an HTTP
            error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: >-
            Method is not supported. For mutations, an HTTP error alone is not
            proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Version, identity, request-key or uncertain-operation conflict. For
            mutations, an HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: >-
            Event cursor expired; resync authorized history before a new
            subscription. For mutations, an HTTP error alone is not proof that
            no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: >-
            Request or decoded attachment exceeds the documented limit. For
            mutations, an HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: >-
            Use application/json for a write. For mutations, an HTTP error alone
            is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '416':
          description: >-
            Single byte range is invalid or unsatisfiable. For mutations, an
            HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Usage/concurrency limit; respect Retry-After when provided. For
            mutations, an HTTP error alone is not proof that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            Upstream result unavailable; a write may already have been
            submitted. For mutations, an HTTP error alone is not proof that no
            effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            Installation temporarily unavailable; inspect an original write
            before resubmitting. For mutations, an HTTP error alone is not proof
            that no effect occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - customerKey: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            # Persist the key first. Reuse it only to inspect an uncertain
            result.

            curl -X POST
            "https://api.superskope.com/api/v1/chats/120000000000@g.us/messages/false_120000000000@g.us_EXAMPLE/actions"
            \
              -H "Authorization: Bearer $SUPERSKOPE_API_KEY" \
              -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
              -H "Content-Type: application/json" \
              -d '{"action":"pin","days":7}'
        - lang: javascript
          label: Node.js
          source: >
            import { SuperSkope } from '@superskope/sdk';


            const client = new SuperSkope({
              origin: 'https://api.superskope.com',
              apiKey: process.env.SUPERSKOPE_API_KEY,
            });

            // Persist the key first. Reuse it only to inspect an uncertain
            result.

            const idempotencyKey = process.env.IDEMPOTENCY_KEY;


            const result = await client.messageAction('120000000000@g.us',
            'false_120000000000@g.us_EXAMPLE', { action: 'pin', days: 7 }, {
            idempotencyKey });

            console.log(result);
        - lang: python
          label: Python
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.superskope.com/api/v1/chats/120000000000@g.us/messages/false_120000000000@g.us_EXAMPLE/actions",
                headers={"Authorization": f"Bearer {os.environ['SUPERSKOPE_API_KEY']}", "Idempotency-Key": os.environ["IDEMPOTENCY_KEY"]},
                json={"action": "pin", "days": 7},
                timeout=40,
            )
            print(response.status_code, response.json())
components:
  schemas:
    MessageAction:
      type: object
      required:
        - action
      additionalProperties: false
      properties:
        action:
          type: string
          enum:
            - edit
            - delete
            - forward
            - pin
            - unpin
        text:
          type: string
          minLength: 1
          maxLength: 4000
        targetChatId:
          type: string
        days:
          type: integer
          enum:
            - 1
            - 7
            - 30
          default: 7
      description: >-
        edit requires text and an own sent message; delete also requires own
        sent message; forward requires a selected targetChatId and independent
        target messages:write. All require full exact same-chat message proof.
    MessageActionResult:
      type: object
      required:
        - requestId
        - state
        - messageId
        - action
      properties:
        requestId:
          type: string
        state:
          type: string
          enum:
            - completed
            - unknown
        messageId:
          type: string
        action:
          type: string
        targetChatId:
          type: string
        replayed:
          type: boolean
        error:
          type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  securitySchemes:
    customerKey:
      type: http
      scheme: bearer
      bearerFormat: ss_api_…

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.