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

# Send DM V2

> Send a direct message to a user.You must set the login_cookie..You can get the login_cookie from /twitter/user_login_v2.You can only send DMs to those who have enabled DMs. Sometimes it may fail, so be prepared to retry.Trial operation price: $0.003 per call. 



## OpenAPI

````yaml POST /twitter/send_dm_to_user
openapi: 3.0.1
info:
  title: TwitterAPI.io the most stable/fastest/cheapest twitter api.
  description: Provide the most stable/fastest/cheapest twitter api.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twitterapi.io
security:
  - ApiKeyAuth: []
paths:
  /twitter/send_dm_to_user:
    post:
      description: >-
        Send a direct message to a user.You must set the login_cookie..You can
        get the login_cookie from /twitter/user_login_v2.You can only send DMs
        to those who have enabled DMs. Sometimes it may fail, so be prepared to
        retry.Trial operation price: $0.003 per call. 
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - login_cookies
                - user_id
                - text
                - proxy
              properties:
                login_cookies:
                  type: string
                  description: >-
                    The login cookie of the user.You can get the login_cookies
                    from /twitter/user_login_v2.Must be set
                user_id:
                  type: string
                  description: The id of the user to send the direct message to.Must be set
                text:
                  type: string
                  description: The text of the direct message.Must be set
                media_id:
                  type: string
                  description: >-
                    ID of a single media asset to attach. Optional. Obtain from
                    /twitter/upload_media_v2.
                proxy:
                  type: string
                  description: >-
                    The proxy to use.Please use high-quality residential proxies
                    and avoid free proxies.Required.Example:
                    http://username:password@ip:port . You can get proxy from:
                    https://www.webshare.io/?referral_code=4e0q1n00a504
                reply_to_message_id:
                  type: string
                  description: The id of the message to reply to.Optional
      responses:
        '200':
          description: Login response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message_id:
                    type: string
                    description: The id of the sent direct message.
                  status:
                    type: string
                    description: Status of the request.success or error
                  msg:
                    type: string
                    description: Message of the request.error message
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````