Schedule a call
Puts an X call on the authenticated user’s X Calls calendar, with them as its organizer, and invites people to it. The call exists right away: share its join_url, or put an agent in it at start time with POST /2/calls/:id/join. A recurrence (an RFC 5545 RRULE) repeats it. Invitees get an email unless notify_invitees is false.
curl --request POST \
--url https://api.x.com/2/calls/scheduled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_time": "<string>",
"description": "<string>",
"duration_minutes": 22320,
"invitee_ids": [
"<string>"
],
"notify_invitees": true,
"recurrence": "<string>",
"time_zone": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.x.com/2/calls/scheduled"
payload = {
"start_time": "<string>",
"description": "<string>",
"duration_minutes": 22320,
"invitee_ids": ["<string>"],
"notify_invitees": True,
"recurrence": "<string>",
"time_zone": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '<string>',
description: '<string>',
duration_minutes: 22320,
invitee_ids: ['<string>'],
notify_invitees: true,
recurrence: '<string>',
time_zone: '<string>',
title: '<string>'
})
};
fetch('https://api.x.com/2/calls/scheduled', 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/calls/scheduled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_time' => '<string>',
'description' => '<string>',
'duration_minutes' => 22320,
'invitee_ids' => [
'<string>'
],
'notify_invitees' => true,
'recurrence' => '<string>',
'time_zone' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/calls/scheduled"
payload := strings.NewReader("{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/calls/scheduled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/calls/scheduled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"calendar": "<string>",
"call_id": "<string>",
"description": "<string>",
"end_time": "<string>",
"id": "<string>",
"invitees": [
{
"id": "<string>",
"response": "<string>"
}
],
"join_url": "<string>",
"occurrence_start_time": "<string>",
"organizer_id": "<string>",
"recurrence": "<string>",
"start_time": "<string>",
"status": "<string>",
"time_zone": "<string>",
"title": "<string>"
},
"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
The access token received from the authorization server in the OAuth 2.0 flow.
Body
When the call starts (RFC 3339); not in the past.
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d{1,9})?(Z|[+-]([01]\d|2[0-3]):[0-5]\d)$What the call is about.
1000How long the call lasts, in minutes. Defaults to 30; at most 31 days.
1 <= x <= 44640X user ids of the people to invite.
100^[0-9]{1,19}$Whether invitees get an email about the call. Defaults to true.
RFC 5545 RRULE to repeat the call by, such as FREQ=WEEKLY;BYDAY=MO; the RRULE: prefix is optional.
500IANA time zone the recurrence follows, such as America/Los_Angeles.
64Title invitees see.
100curl --request POST \
--url https://api.x.com/2/calls/scheduled \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start_time": "<string>",
"description": "<string>",
"duration_minutes": 22320,
"invitee_ids": [
"<string>"
],
"notify_invitees": true,
"recurrence": "<string>",
"time_zone": "<string>",
"title": "<string>"
}
'import requests
url = "https://api.x.com/2/calls/scheduled"
payload = {
"start_time": "<string>",
"description": "<string>",
"duration_minutes": 22320,
"invitee_ids": ["<string>"],
"notify_invitees": True,
"recurrence": "<string>",
"time_zone": "<string>",
"title": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start_time: '<string>',
description: '<string>',
duration_minutes: 22320,
invitee_ids: ['<string>'],
notify_invitees: true,
recurrence: '<string>',
time_zone: '<string>',
title: '<string>'
})
};
fetch('https://api.x.com/2/calls/scheduled', 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/calls/scheduled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start_time' => '<string>',
'description' => '<string>',
'duration_minutes' => 22320,
'invitee_ids' => [
'<string>'
],
'notify_invitees' => true,
'recurrence' => '<string>',
'time_zone' => '<string>',
'title' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/calls/scheduled"
payload := strings.NewReader("{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/calls/scheduled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/calls/scheduled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_time\": \"<string>\",\n \"description\": \"<string>\",\n \"duration_minutes\": 22320,\n \"invitee_ids\": [\n \"<string>\"\n ],\n \"notify_invitees\": true,\n \"recurrence\": \"<string>\",\n \"time_zone\": \"<string>\",\n \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"calendar": "<string>",
"call_id": "<string>",
"description": "<string>",
"end_time": "<string>",
"id": "<string>",
"invitees": [
{
"id": "<string>",
"response": "<string>"
}
],
"join_url": "<string>",
"occurrence_start_time": "<string>",
"organizer_id": "<string>",
"recurrence": "<string>",
"start_time": "<string>",
"status": "<string>",
"time_zone": "<string>",
"title": "<string>"
},
"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>"
}