Fansly API LogoFansly API
Mass messaging

Create Automated Message

Create an automated message.

Create a new automated message that triggers based on specific events (like new followers, subscribers, or tips...).

https://v1.apifansly.com/api/fansly
POST
/{account_id}/automated-messages

Get Started

All requests to the Fansly API require an API Key. See the Authentication page for details.

    curl -X POST "https://v1.apifansly.com/api/fansly/{account_id}/automated-messages" \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "triggerType": "new_subscriber",
        "content": "Welcome to my page! Thanks for subscribing.",
        "delay": 0,
        "cooldown": 0
      }'
    fetch("https://v1.apifansly.com/api/fansly/{account_id}/automated-messages", {
      method: "POST",
      headers: {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        triggerType: "new_subscriber",
        content: "Welcome to my page! Thanks for subscribing.",
        delay: 0,
        cooldown: 0
      })
    })
    import requests

    url = "https://v1.apifansly.com/api/fansly/{account_id}/automated-messages"
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    data = {
        "triggerType": "new_subscriber",
        "content": "Welcome to my page! Thanks for subscribing.",
        "delay": 0,
        "cooldown": 0
    }

    response = requests.post(url, headers=headers, json=data)
    print(response.json())
    import java.net.URI;
    import java.net.http.HttpClient;
    import java.net.http.HttpRequest;
    import java.net.http.HttpResponse;

    HttpClient client = HttpClient.newHttpClient();

    String requestBody = """
        {
            "triggerType": "new_subscriber",
            "content": "Welcome to my page! Thanks for subscribing.",
            "delay": 0,
            "cooldown": 0
        }
    """;

    HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://v1.apifansly.com/api/fansly/{account_id}/automated-messages"))
            .header("x-api-key", "YOUR_API_KEY")
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(requestBody))
            .build();

    client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
            .thenApply(HttpResponse::body)
            .thenAccept(System.out::println)
            .join();
    using System.Net.Http;
    using System.Text;
    using System.Threading.Tasks;

    var client = new HttpClient();
    client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");

    var json = """
        {
            "triggerType": "new_subscriber",
            "content": "Welcome to my page! Thanks for subscribing.",
            "delay": 0,
            "cooldown": 0
        }
    """;
    var content = new StringContent(json, Encoding.UTF8, "application/json");

    var response = await client.PostAsync("https://v1.apifansly.com/api/fansly/{account_id}/automated-messages", content);
    var responseString = await response.Content.ReadAsStringAsync();

    Console.WriteLine(responseString);
    package main

    import (
        "bytes"
        "fmt"
        "io/ioutil"
        "net/http"
    )

    func main() {
        url := "https://v1.apifansly.com/api/fansly/{account_id}/automated-messages"

        var jsonStr = []byte(`{
            "triggerType": "new_subscriber",
            "content": "Welcome to my page! Thanks for subscribing.",
            "delay": 0,
            "cooldown": 0
        }`)
        req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
        req.Header.Set("x-api-key", "YOUR_API_KEY")
        req.Header.Set("Content-Type", "application/json")

        client := &http.Client{}
        resp, _ := client.Do(req)
        defer resp.Body.Close()

        body, _ := ioutil.ReadAll(resp.Body)
        fmt.Println(string(body))
    }

Path Parameters

account_id*
string
The unique identifier for the connected account.

Body Parameters

For media attachments and permissions (e.g. mediaIds, access_type, price, etc.), please refer to the Media Permissions page. These parameters can be included in the body of this request as well.

triggerType*
string
The trigger type for the automated message. Options: new_follower, new_subscriber, new_gift_link_subscriber, subscriber_renew, new_gift_link_subscriber_renew, new_tip, disabled.
content*
string
The text content of the message.
delay ?
number
Delay in seconds before the message is sent.
cooldown ?
number
Cooldown in seconds before the trigger can fire again.
subscriptionStreak ?
number
Subscription streak (used in subscriber_renew). Default value: 1
tipAmount ?
number
Tip amount in dollars (used in new_tip).
keywords ?
array
Array of keywords (used in new_tip).

Response

    {
    "statusCode": 201,
    "message": "Success",
    "data": {
        "status_code": 200,
        "data": {
            "success": true,
            "response": "automated message created"
        }
    },
    "timestamp": "iso_8601_timestamp"
}

On this page