Back to Developer Help
1

Authentication

Create an account, log in, and generate API keys for programmatic access.

You can also generate and manage API keys from the Settings panel. Go to Settings → API Keys to create, rotate, and revoke keys visually.

Endpoint

POST /api/v1/auth/register No authentication required

Request Body

Field Type
email string (required)
password string (required, min 8 chars)

Common Error Responses

400 VALIDATION_ERROR

Invalid email or password too short.

409 EMAIL_IN_USE

An account with this email already exists.

Code Samples

# Register a new account
curl -X POST https://api.palmtext.com/api/v1/auth/register \
  -H 'Content-Type: application/json' \
  -d '{"email": "[email protected]", "password": "YOUR_PASSWORD"}'

# Login to get a session
curl -X POST https://api.palmtext.com/api/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email": "[email protected]", "password": "YOUR_PASSWORD"}'

# Create an API key
curl -X POST https://api.palmtext.com/api/v1/auth/api-keys \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name": "My App"}'
import requests

# Register
resp = requests.post(
    'https://api.palmtext.com/api/v1/auth/register',
    json={'email': '[email protected]', 'password': 'YOUR_PASSWORD'}
)
print(resp.json())

# Login
resp = requests.post(
    'https://api.palmtext.com/api/v1/auth/login',
    json={'email': '[email protected]', 'password': 'YOUR_PASSWORD'}
)
session_id = resp.json()['data']['session_id']

# Create API key
resp = requests.post(
    'https://api.palmtext.com/api/v1/auth/api-keys',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    json={'name': 'My App'}
)
print(resp.json())
// Register
const res = await fetch('https://api.palmtext.com/api/v1/auth/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: '[email protected]', password: 'YOUR_PASSWORD' })
});
const data = await res.json();

// Login
const loginRes = await fetch('https://api.palmtext.com/api/v1/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: '[email protected]', password: 'YOUR_PASSWORD' })
});
const { data: loginData } = await loginRes.json();

// Create API key
const keyRes = await fetch('https://api.palmtext.com/api/v1/auth/api-keys', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'My App' })
});
<?php
$ch = curl_init();

// Register
curl_setopt_array($ch, [
  CURLOPT_URL => 'https://api.palmtext.com/api/v1/auth/register',
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode(['email' => '[email protected]', 'password' => 'YOUR_PASSWORD']),
  CURLOPT_RETURNTRANSFER => true,
]);
$resp = curl_exec($ch);
echo $resp;

// Create API key
curl_setopt_array($ch, [
  CURLOPT_URL => 'https://api.palmtext.com/api/v1/auth/api-keys',
  CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode(['name' => 'My App']),
]);
$resp = curl_exec($ch);
echo $resp;
curl_close($ch);
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "net/http"
)

func main() {
  body, _ := json.Marshal(map[string]string{
    "email": "[email protected]", "password": "YOUR_PASSWORD",
  })
  resp, _ := http.Post(
    "https://api.palmtext.com/api/v1/auth/register",
    "application/json", bytes.NewBuffer(body),
  )
  defer resp.Body.Close()
  fmt.Println(resp.Status)
}