Signs in with email and password and starts a browser session: a 1-hour access token and a 30-day refresh token.
Note
Public — no credential needed. Any plan.
Request Body
NameDescription
emailThe account's email address.
passwordThe account's password.
timezoneThe browser's IANA timezone, e.g.
America/New_York. Replaces the one stored on the account. An invalid value is ignored, not rejected.countryThe browser's ISO 3166-1 alpha-2 country code, e.g.
US. Replaces the one stored on the account. An invalid value is ignored, not rejected.timezone and country are hints for when and how Syntext emails you. They're never used for access decisions.
Response — 200 OK
NameDescription
orgIdThe workspace the access token is issued for — the first of your memberships — or
null when you belong to none.orgsEvery workspace you belong to, with your role in each, so a client can offer a workspace switcher.
Error Responses
401 Unauthorized
unauthorized — the email or password is wrong. The message is the same for both, so it doesn't reveal whether an account exists.
json
{
"error": {
"code": "unauthorized",
"message": "Invalid email or password",
"details": { "traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10" }
}
}
400 Bad Request
validation_error — email or password is missing, or email isn't an email address.
Was this page helpful? Yes No
Previous
Next
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X POST https://api.syntext.dev/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US"
}'
const response = await fetch('https://api.syntext.dev/v1/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US"
}),
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.syntext.dev/v1/auth/login"
payload = {
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US",
}
response = requests.post(url, json=payload)
print(response.status_code)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US"
}`)
req, err := http.NewRequest("POST", "https://api.syntext.dev/v1/auth/login", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "json"
require "net/http"
require "uri"
uri = URI("https://api.syntext.dev/v1/auth/login")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"email" => "alex@example.com",
"password" => "a much longer passphrase",
"timezone" => "America/New_York",
"country" => "US",
})
response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
'email' => 'alex@example.com',
'password' => 'a much longer passphrase',
'timezone' => 'America/New_York',
'country' => 'US',
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.syntext.dev/v1/auth/login',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String payload = """
{
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.syntext.dev/v1/auth/login"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.syntext.dev/v1/auth/login");
request.Content = new StringContent(
"""
{
"email": "alex@example.com",
"password": "a much longer passphrase",
"timezone": "America/New_York",
"country": "US"
}
""",
Encoding.UTF8,
"application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200OK
{
"data": {
"user": { "id": "0b7e4c2d-9a1f-4d3e-8c56-2f1a7b9e0d48", "email": "alex@example.com", "name": "Alex Rivera" },
"orgId": "9c2e7a14-5b3d-4f86-a1e0-7d4b2c9f6e31",
"orgs": [
{ "id": "9c2e7a14-5b3d-4f86-a1e0-7d4b2c9f6e31", "role": "owner" }
],
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "2f8c1e9a7b...",
"expiresIn": 3600
}
}