Get account settings
Returns the account settings of the authenticated user: language, time zone, protected status, location tagging, discoverability, sensitive media, quiet hours, personalization, and who may tag or message them.
GET
/
2
/
users
/
me
/
settings
Get account settings
curl --request GET \
--url https://api.x.com/2/users/me/settings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/users/me/settings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/users/me/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/users/me/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/users/me/settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.x.com/2/users/me/settings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/users/me/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"allow_dms_from": "<string>",
"allow_media_tagging": "<string>",
"always_allow_dms_from_subscribers": true,
"discoverable_by_email": true,
"discoverable_by_phone": true,
"display_sensitive_media": true,
"id": "<string>",
"language": "<string>",
"location_tagging_enabled": true,
"personalized_trends": true,
"protected": true,
"quiet_hours": {
"enabled": true,
"end_hour": 123,
"start_hour": 123
},
"time_zone": {
"name": "<string>",
"tz_name": "<string>",
"utc_offset_seconds": 123
},
"use_cookie_personalization": true
},
"errors": [
{
"detail": "<string>",
"resource_type": "<string>",
"title": "<string>",
"type": "https://api.x.com/2/problems/resource-not-found",
"parameter": "<string>",
"resource_id": "<string>",
"status": 123,
"value": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}Authorizations
OAuth2UserTokenUserToken
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
A comma separated list of UserSettings fields to display. The fields available for a UserSettings object.
Minimum array length:
1Available options:
allow_dms_from, allow_media_tagging, always_allow_dms_from_subscribers, discoverable_by_email, discoverable_by_phone, display_sensitive_media, id, language, location_tagging_enabled, personalized_trends, protected, quiet_hours, time_zone, use_cookie_personalization Response
The request has succeeded.
Show child attributes
Show child attributes
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
- Option 19
- Option 20
- Option 21
- Option 22
- Option 23
- Option 24
- Option 25
- Option 26
- Option 27
- Option 28
- Option 29
- Option 30
- Option 31
- Option 32
- Option 33
- Option 34
- Option 35
- Option 36
- Option 37
- Option 38
- Option 39
- Option 40
- Option 41
- Option 42
- Option 43
- Option 44
- Option 45
- Option 46
- Option 47
- Option 48
- Option 49
- Option 50
- Option 51
- Option 52
- Option 53
- Option 54
- Option 55
Show child attributes
Show child attributes
⌘I
Get account settings
curl --request GET \
--url https://api.x.com/2/users/me/settings \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/users/me/settings"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/users/me/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/users/me/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/users/me/settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.x.com/2/users/me/settings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/users/me/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"allow_dms_from": "<string>",
"allow_media_tagging": "<string>",
"always_allow_dms_from_subscribers": true,
"discoverable_by_email": true,
"discoverable_by_phone": true,
"display_sensitive_media": true,
"id": "<string>",
"language": "<string>",
"location_tagging_enabled": true,
"personalized_trends": true,
"protected": true,
"quiet_hours": {
"enabled": true,
"end_hour": 123,
"start_hour": 123
},
"time_zone": {
"name": "<string>",
"tz_name": "<string>",
"utc_offset_seconds": 123
},
"use_cookie_personalization": true
},
"errors": [
{
"detail": "<string>",
"resource_type": "<string>",
"title": "<string>",
"type": "https://api.x.com/2/problems/resource-not-found",
"parameter": "<string>",
"resource_id": "<string>",
"status": 123,
"value": "<string>"
}
]
}{
"code": 123,
"message": "<string>"
}