API Documentation
Syntaxia Anchor API
RESTful API for managing users, accounts, and profiles. All responses are in JSON format.
Base URL
https://anchor.staging.syntaxia.com
Version
v1
Format
JSON
Authentication
All API requests require authentication using a bearer token. Include your token in the Authorization header of every request.
How to authenticate
-
1.
Get a token by calling
/api/v1/authwith your credentials -
2.
Include the token in every request:
Authorization: Bearer YOUR_TOKEN -
3.
Set
Content-Type: application/jsonfor all requests
Example
curl -X POST "https://anchor.staging.syntaxia.com/api/v1/auth" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password",
"otp_attempt": "123456"
}'
{
"token": "eyJhbGciOiJIUzI1NiJ9..."
}
Quickstart
Get started in minutes with these code examples. Select your preferred language below.
1. List your accounts
export TOKEN="your-api-token"
curl "https://anchor.staging.syntaxia.com/api/v1/accounts" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
2. Get current user
curl "https://anchor.staging.syntaxia.com/api/v1/me" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
1. List your accounts
import requests
TOKEN = "your-api-token"
BASE_URL = "https://anchor.staging.syntaxia.com"
response = requests.get(
f"{BASE_URL}/api/v1/accounts",
headers={"Authorization": f"Bearer {TOKEN}"}
)
response.raise_for_status()
accounts = response.json()
print(accounts)
2. Get current user
response = requests.get(
f"{BASE_URL}/api/v1/me",
headers={"Authorization": f"Bearer {TOKEN}"}
)
response.raise_for_status()
user = response.json()
print(f"User: {user['name']}")
1. List your accounts
const TOKEN = "your-api-token";
const BASE_URL = "https://anchor.staging.syntaxia.com";
async function getAccounts() {
const response = await fetch(`${BASE_URL}/api/v1/accounts`, {
headers: {
"Authorization": `Bearer ${TOKEN}`,
"Content-Type": "application/json"
}
});
if (!response.ok) throw new Error(await response.text());
const accounts = await response.json();
console.log(accounts);
}
getAccounts();
2. Get current user
async function getCurrentUser() {
const response = await fetch(`${BASE_URL}/api/v1/me`, {
headers: {
"Authorization": `Bearer ${TOKEN}`,
"Content-Type": "application/json"
}
});
if (!response.ok) throw new Error(await response.text());
const user = await response.json();
console.log(`User: ${user.name}`);
}
getCurrentUser();
User Management
Create and manage user accounts, update profiles, and handle authentication.
/api/v1/users
Create a new user account and receive an API token.
{
"user": {
"email": "new@example.com",
"password": "secure-password",
"password_confirmation": "secure-password",
"name": "John Doe"
}
}
{
"user": {
"id": "usr_123",
"email": "new@example.com",
"name": "John Doe",
"api_tokens": [{
"id": "tok_123",
"name": "API Token",
"token": "your-generated-token"
}]
}
}
/api/v1/me
Get the currently authenticated user's profile.
{
"id": "usr_123",
"name": "Ada Lovelace",
"avatar_url": "https://cdn.syntaxia.io/avatar.png",
"sgid": "user-sgid",
"content": "<div>Profile HTML content</div>"
}
/api/v1/password
Update the current user's password.
{
"user": {
"current_password": "old-password",
"password": "new-password",
"password_confirmation": "new-password"
}
}
{
"success": true
}
/api/v1/me
Delete the current user account permanently.
⚠️ Returns an empty object on success. This action cannot be undone.
Accounts
Manage workspaces and team accounts. List accounts and view account details.
/api/v1/accounts
List all accounts the authenticated user belongs to.
[
{
"id": "acc_001",
"name": "Main Workspace",
"personal": false,
"owner_id": "usr_123",
"created_at": "2024-01-10T12:00:00Z",
"updated_at": "2024-02-03T16:21:00Z",
"account_users": [
{"id": "acu_01", "user_id": "usr_123"}
]
}
]
Notifications
Retrieve and manage user notifications. Mark notifications as read and list all notifications.
/api/v1/notification_tokens
Register or remove push notification tokens (for Hotwire Native apps).
{
"token": "device-push-token",
"platform": "ios"
}
Connect your LLM to your workspace
Use the Model Context Protocol to safely expose your data to AI agents.