Change Account Privacy

POST/tw-v2/profile/privacy

Description

Change the authenticated X account between public and private. Set isPrivate to true to protect the account or false to make it public.

Making an account public changes who can view its posts. The isPrivate field is required and has no default.

Request Body

ParameterTypeRequiredDescription
authTokenstringrequiredAccount authentication token (auth_token cookie value)
isPrivatebooleanrequiredSet to true for a private account or false for a public account
proxystringoptionalOptional proxy in format 'hostname:port@username:password'

Code Examples

const response = await fetch('https://api.tweetapi.com/tw-v2/profile/privacy', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    authToken: 'YOUR_AUTH_TOKEN',
    isPrivate: true
  })
});

const data = await response.json();
console.log(data);

Response

Success Response (200 OK)

200
{
  "data": {
    "isPrivate": true
  }
}