{
  "openapi": "3.0.1",
  "info": {
    "title": "InstaReach AI - Smart Instagram DM Automation & Mass Outreach",
    "description": "Next-generation, ultra-safe Instagram Direct Message (DM) automation and cold outreach tool with multi-account rotation, smart Spintax personalization, and anti-ban protection.",
    "version": "1.0",
    "x-build-id": "svOYZLn9fXAmqTwQm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automation_studio~instareach-instagram-dm-automation/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automation_studio-instareach-instagram-dm-automation",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/automation_studio~instareach-instagram-dm-automation/runs": {
      "post": {
        "operationId": "runs-sync-automation_studio-instareach-instagram-dm-automation",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/automation_studio~instareach-instagram-dm-automation/run-sync": {
      "post": {
        "operationId": "run-sync-automation_studio-instareach-instagram-dm-automation",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "targetUsernames",
          "messageTemplate"
        ],
        "properties": {
          "sessionId": {
            "title": "🔑 Primary Instagram Session ID (sessionid)",
            "type": "string",
            "description": "Your Instagram `sessionid` cookie value. Found via Cookie-Editor extension or Chrome DevTools (F12 -> Application -> Cookies)."
          },
          "csrfToken": {
            "title": "🛡️ CSRF Token (csrftoken - Optional)",
            "type": "string",
            "description": "Your Instagram `csrftoken` cookie value (Optional, auto-resolved if left empty)."
          },
          "dsUserId": {
            "title": "👤 User ID (ds_user_id - Optional)",
            "type": "string",
            "description": "Your numeric Instagram User ID from cookies (Optional)."
          },
          "additionalAccountsCookies": {
            "title": "👥 Multi-Account Cookies (Optional - 1 account per line)",
            "type": "array",
            "description": "Want to send from multiple accounts? Add one cookie string or Cookie-Editor JSON per line. The actor will rotate through all accounts round-robin to scale safely.",
            "items": {
              "type": "string"
            }
          },
          "targetUsernames": {
            "title": "🎯 Target Recipient Usernames",
            "type": "array",
            "description": "Enter the Instagram usernames to receive your direct message (one username per line, e.g. `garyvee`, `shopify`, `hubspot`).",
            "items": {
              "type": "string"
            }
          },
          "messageTemplate": {
            "title": "💬 Message Template (Supports Spintax & Personalization)",
            "type": "string",
            "description": "Write your DM template. Use **Spintax** (`{Hi|Hey|Hello}`) and **Tags** (`{username}`, `{first_name}`) to make every single DM 100% unique."
          },
          "minDelaySeconds": {
            "title": "⏱️ Minimum Safety Delay Between Sends (Seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Minimum delay in seconds before sending to the next recipient (Recommended: 30s - 60s for maximum safety).",
            "default": 35
          },
          "maxDelaySeconds": {
            "title": "⏱️ Maximum Safety Delay Between Sends (Seconds)",
            "minimum": 20,
            "maximum": 1200,
            "type": "integer",
            "description": "Maximum delay in seconds between sends (random jitter between Min and Max simulates natural human typing).",
            "default": 75
          },
          "maxMessagesPerAccount": {
            "title": "🛑 Max Messages per Account (Daily Safety Cap)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum direct messages an individual account will send before rotating to the next account (Recommended: 20–35).",
            "default": 25
          },
          "skipAlreadyMessaged": {
            "title": "⏭️ Skip If Already Messaged",
            "type": "boolean",
            "description": "When enabled, checks if an existing conversation thread exists with the recipient and skips them to avoid duplicate outreach.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Use Apify Residential Proxies to protect your account IP reputation.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}