User API
The User API provides endpoints for user authentication and account management. All endpoints are served under the base URL https://api.tradearies.dev
.
Authentication
The API uses JWT (JSON Web Tokens) for authentication. Most endpoints require a Bearer token in the Authorization
header: Authorization: Bearer <token>
.
Authenticate User
Authenticates a user with their credentials and returns access and refresh tokens.
POST/v1/auth
{
"email": "user@example.com",
"password": "password123"
}
Refresh Authentication Token
Refreshes the authentication token using a refresh token.
POST/v1/auth/refresh
{
"email": "user@example.com",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Re-authenticate User
Re-authenticates a user with their password. Requires a valid access token.
POST/v1/auth/reauth
{
"password": "password123"
}
Requires Authorization: Bearer <token>
header.
Get User Accounts
Retrieves all accounts associated with the authenticated user.
GET/v1/users/me/accounts
{
"accounts": [
{
"id": 123456789,
"fdid": "ARIESFD",
"apex_id": "APEX123",
"apex_account_id": "APEXACC456",
"sterling_account_id": "STER789",
"status": "OPEN",
"apex_status": "Active",
"is_sim": false,
"primary_user_id": 1,
"primary_user": {
"id": 1,
"email": "user@example.com",
"country": "US",
"plaid_status": "verified",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z"
},
"joint_user": null,
"account_application": {
"submitted": true,
"missing_fields": [],
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z"
},
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
]
}
Requires Authorization: Bearer <token>
header.
Error Responses
All endpoints may return the following error responses:
400 Bad Request
GET
{
"error": "bad_request",
"message": "Invalid request parameters"
}
401 Unauthorized
GET
{
"error": "unauthorized",
"message": "Invalid or expired token"
}
500 Internal Server Error
GET
{
"error": "internal_error",
"message": "An unexpected error occurred"
}
Data Types
Account
Field | Type | Description |
---|---|---|
id | integer | Account ID |
fdid | string | FDID |
apex_id | string | Apex ID |
apex_account_id | string | Apex account ID |
sterling_account_id | string | Sterling account ID |
status | string | Account status (e.g., NEW, OPEN, CLOSED) |
apex_status | string | Apex account status |
is_sim | boolean | Whether this is a simulation account |
primary_user_id | integer | Primary user ID |
primary_user | AccountItemUser | Primary user details |
joint_user | AccountItemUser | Joint user details (nullable) |
account_application | AccountItemApplication | Account application details |
created_at | string | Account creation timestamp (ISO 8601) |
updated_at | string | Account last update timestamp (ISO 8601) |
AccountItemUser
Field | Type | Description |
---|---|---|
id | integer | User ID |
string | User email | |
country | string | User country |
plaid_status | string | Plaid verification status |
created_at | string | User creation timestamp (ISO 8601) |
updated_at | string | User last update timestamp (ISO 8601) |
AccountItemApplication
Field | Type | Description |
---|---|---|
submitted | boolean | Whether the application has been submitted |
missing_fields | string[] | List of missing required fields |
created_at | string | Application creation timestamp (ISO 8601) |
updated_at | string | Application last update timestamp (ISO 8601) |
AuthResponse
Field | Type | Description |
---|---|---|
access_token | string | JWT access token |
refresh_token | string | JWT refresh token |
expires_in | integer | Token expiration time in seconds |
curl https://api.aries.trade/v1/auth \
-X POST \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'