> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.algorhythm.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.algorhythm.app/_mcp/server.

# Follow an account from a farm profile

POST https://api.algorhythm.app/v1/farm-profiles/{profile_id}/follow
Content-Type: application/json

Queues the farm profile to follow another TikTok account. The phone opens TikTok, follows the target handle, then performs a short burst of organic activity to look natural. The response returns immediately; the follow runs on the cloud phone in the background and may take a few minutes.

**Preconditions:**

* The profile must have a provisioned phone and be idle (`cold`, `warm`, or `ready`). If it's mid-warmup, mid-post, or already running a follow, the request is rejected with `409`; wait and retry.
* Each profile can follow at most **5 accounts per rolling 24-hour window**. The 6th within that window returns `429` until the window rolls over.

**Webhook:** if you pass `webhook_url`, we POST `{event: 'follow.completed', phone_id, username}` to it once the follow finishes on the device. Fired only on success; no retries.

**Rate limit:** 10 requests per minute per team.

Reference: https://docs.algorhythm.app/api-reference/farm-profiles/follow-account-v-1-farm-profiles-profile-id-follow-post

## Authentication

- `X-API-Key` header (required) — API Key authentication via header

## Request

### Path parameters

- `profile_id` (string, required)

### Body (application/json)

This endpoint expects a FollowAccountRequest.

- `username` (string, required) — The TikTok handle for the profile to follow, without the leading `@` (stripped if included). The phone opens TikTok, follows this account, then performs a short burst of organic activity.
- `webhook_url` (string, optional, nullable) — Optional HTTPS URL we'll POST `{event: 'follow.completed', phone_id, username}` to once the follow finishes on the device. Fire-and-forget; no retries.

## Response

### 200

Successful Response

- `profile_id` (string, required) — The farm profile that performed the follow.
- `username` (string, required) — The handle that was followed, normalized without a leading `@`.
- `status` ("queued", required) — Always `queued` on success; the follow runs asynchronously on the cloud phone.

## Errors

### 404 Not Found Error

Profile not found, or it does not belong to your team.

- `any`

### 409 Conflict Error

Profile has no provisioned phone yet, or is busy running another automation.

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 429 Too Many Requests Error

Rate limit exceeded, or the profile's daily follow limit (5 per 24h) is reached.

- `any`

### 502 Bad Gateway Error

Upstream content-server failure.

- `any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "username": "charlidamelio",
  "webhook_url": "https://example.com/hooks/algorhythm"
}
```

**Response**

```json
{
  "profile_id": "f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d",
  "username": "charlidamelio",
  "status": "queued"
}
```

**SDK Code**

```python
import requests

url = "https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow"

payload = {
    "username": "charlidamelio",
    "webhook_url": "https://example.com/hooks/algorhythm"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"username":"charlidamelio","webhook_url":"https://example.com/hooks/algorhythm"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow"

	payload := strings.NewReader("{\n  \"username\": \"charlidamelio\",\n  \"webhook_url\": \"https://example.com/hooks/algorhythm\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"username\": \"charlidamelio\",\n  \"webhook_url\": \"https://example.com/hooks/algorhythm\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"username\": \"charlidamelio\",\n  \"webhook_url\": \"https://example.com/hooks/algorhythm\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow', [
  'body' => '{
  "username": "charlidamelio",
  "webhook_url": "https://example.com/hooks/algorhythm"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"username\": \"charlidamelio\",\n  \"webhook_url\": \"https://example.com/hooks/algorhythm\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "username": "charlidamelio",
  "webhook_url": "https://example.com/hooks/algorhythm"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.algorhythm.app/v1/farm-profiles/f8a1c2d4-3b7e-4f9a-9c2d-1e5b7a8f9c3d/follow")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```