# Follow or Unfollow a GitHub User API

> Follow or unfollow a GitHub user as the supplied token's account. Idempotent in both directions. Bring your own GitHub token: a fine-grained PAT with the 'Followers' user permission (write), or a classic PAT with 'user:follow' (broad). The token is used for this one call, never stored; sent only to api.github.com.

Category: [Developer Tools APIs](https://upapi.io/apis/developer-tools) · Last updated 2026-11-07

## How to call it

- Endpoint: `POST https://api.upapi.io/github-user-follow.post`, key in the `X-Api-Key` header, JSON body.
- Cost: 1 weighted unit per call.
- Timeout: 30 seconds.
- Cache: none; every call runs the operation.
- Try it without writing code: https://app.upapi.io/try/github-user-follow.post

```bash
curl -X POST https://api.upapi.io/github-user-follow.post \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "token": "example", "action": "follow", "username": "torvalds" }'
```

## Request parameters

- `token` (string, required) — GitHub token of the account that will follow. Fine-grained PAT: 'Followers' user permission (write); classic PAT: 'user:follow' (broad, prefer fine-grained). Used for this one call, never stored; sent only to api.github.com.
- `action` (enum) — follow = PUT, unfollow = DELETE. Both are idempotent.
- `proxyUrl` (string) — Optional proxy URL. Use the same one across related calls when the upstream expects a consistent IP.
- `username` (string, required) — Login to follow or unfollow

## Response fields

- `action` (string, required)
- `status` (integer, required) — GitHub's status; 204 is its success for both directions
- `actedAt` (string, required)
- `username` (string, required)
- `rateLimit` (object, required) — The rate-limit headers GitHub returned on THIS response, surfaced so the caller
can pace itself instead of the operation sleeping on its behalf.
- `rateLimit.limit` (integer, required) — X-RateLimit-Limit: requests allowed per window
- `rateLimit.resetAt` (string, required) — X-RateLimit-Reset as an ISO-8601 UTC timestamp
- `rateLimit.resource` (string, required) — X-RateLimit-Resource: which bucket (core, search, graphql, ...)
- `rateLimit.remaining` (integer, required) — X-RateLimit-Remaining: requests left
- `rateLimit.resetEpoch` (integer, required) — X-RateLimit-Reset as unix seconds

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "token": "example",
  "action": "follow",
  "username": "torvalds"
}
```

```json
{
  "action": "example",
  "status": 1,
  "actedAt": "example",
  "username": "torvalds",
  "rateLimit": {
    "limit": 5,
    "resetAt": "example",
    "resource": "example",
    "remaining": 1,
    "resetEpoch": 1
  }
}
```

## Frequently asked questions

### How much does the Follow or Unfollow a GitHub User API cost per call?

Each call spends 1 weighted unit of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Follow or Unfollow a GitHub User API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Follow or Unfollow a GitHub User API responses cached?

No — every call runs the operation live; responses are not cached.

## More Developer Tools APIs

- [Get GitHub User](https://upapi.io/apis/developer-tools/github-user)
- [Get GitHub User Commit Emails](https://upapi.io/apis/developer-tools/github-user-emails)
- [Post a GitHub Issue Comment](https://upapi.io/apis/developer-tools/github-issue-comment)
- [React to a GitHub Issue Comment](https://upapi.io/apis/developer-tools/github-comment-reaction)
- [Star or Unstar a GitHub Repository](https://upapi.io/apis/developer-tools/github-repo-star)
- [Get GitHub Repository](https://upapi.io/apis/developer-tools/github-repo)
- [List GitHub Issue Comments](https://upapi.io/apis/developer-tools/github-issue-comments)
- [List GitHub Repository Contributors](https://upapi.io/apis/developer-tools/github-repo-contributors)
