API Documentation

Integrate DM Dad into your applications with our RESTful API. Automate DMs, manage tasks, and track account activity programmatically.

Quick Start

All API requests should be made to: https://dmdad.com/api/v1

You'll need an access key to authenticate requests. Get your access key from your account dashboard.

// Example: Send a DM
const response = await fetch('https://dmdad.com/api/v1/sendDM', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    key: 'your-access-key',
    message: 'Hello!',
    username: 'target_username',
    platform: 'reddit' // or 'x'
  })
});

Authentication

All API requests require an access key. Include your access key in the request body for each endpoint.

Note: Keep your access keys secure. Never expose them in client-side code or public repositories.

PUT

/api/v1/ping

Ping the server to update your connection status and retrieve pending tasks. This endpoint is automatically called periodically to maintain connection status and receive new tasks when your DM Dad extension is in API mode. You can use it too to test api connection and recieve the latest tasks you have for a connection key.

Request

PUT /api/v1/ping
Content-Type: application/json

{
  "key": "your-access-key"
}

Response

{
  "success": true,
  "message": "Ping successful",
  "task": {
    "id": "task-id",
    "action": {
      "type": "sendDM",
      "platform": "reddit",
      "username": "target_username",
      "message": "Hello!"
    },
    "key": "your-access-key",
    "created_at": "2024-01-01T00:00:00Z",
    "complete": false
  }
}

If there are no pending tasks, task will be null.

POST

/api/v1/sendDM

Create a task to send a direct message to a specific user on Reddit or X (Twitter).

Request

POST /api/v1/sendDM
Content-Type: application/json

{
  "key": "your-access-key",
  "message": "Hello! I'd like to connect.",
  "username": "target_username",
  "platform": "reddit" // or "x"
}

Parameters

FieldTypeRequiredDescription
keystringYesYour access key
messagestringYesThe message content to send
usernamestringYesTarget username on the platform
platformstringYesEither "reddit" or "x" (for Twitter)

Response

{
  "success": true,
  "message": "Action created successfully"
}

Update Task Status

After DMing the user DM Dad automatically updates the status with a message using this PUT endpoint. You can set complete to true to cancel DMing the user.

PUT /api/v1/sendDM
Content-Type: application/json

{
  "task": {
    "id": "task-id",
    "key": "your-access-key",
    "message": "Task completed successfully",
    "complete": true
  }
}
POST

/api/v1/dmCommenters

Create a task to send DMs to commenters and/or the author of a specific post on Reddit or X (Twitter).

Request

POST /api/v1/dmCommenters
Content-Type: application/json

{
  "key": "your-access-key",
  "message": "Thanks for your comment!",
  "postUrl": "https://reddit.com/r/subreddit/comments/...",
  "platform": "reddit", // or "x"
  "dmAuthor": false, // optional, default: false
  "dmCommenters": true // optional, default: true
}

Parameters

FieldTypeRequiredDescription
keystringYesYour access key
messagestringYesThe message content to send
postUrlstringYesURL of the post
platformstringYesEither "reddit" or "x" (for Twitter)
dmAuthorbooleanNoWhether to DM the post author (default: false)
dmCommentersbooleanNoWhether to DM commenters (default: true)

Response

{
  "success": true,
  "message": "Action created successfully"
}

Update Task Status

After DMing all the commenters DM Dad automatically updates the status using this PUT endpoint. Cancel task by setting complete to true:

PUT /api/v1/dmCommenters
Content-Type: application/json

{
  "task": {
    "id": "task-id",
    "key": "your-access-key",
    "message": "Task completed successfully",
    "complete": true
  }
}

Error Handling

All errors return a JSON response with a success field set to false and a message field describing the error.

{
  "success": false,
  "message": "Invalid request data must include key, message, username, and platform"
}
Status CodeDescription
400Bad Request - Invalid parameters
404Not Found - Invalid access key
500Internal Server Error

Rate Limiting

API requests are subject to rate limiting based on your plan. Contact us at help@dmdad.com for information about rate limits and upgrading your plan.

Need Help?

Have questions about the API or need assistance with integration? We're here to help!