IngestIQ

Authentication

User authentication endpoints

Register#

Create a new user account.

emailstringrequired

User's email address

passwordstringrequired

Password (minimum 8 characters)

namestringrequired

User's display name

curl -X POST http://localhost:3000/api/v2/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword123",
    "name": "John Doe"
  }'

Response#

{
  "user": {
    "id": "user-uuid",
    "email": "user@example.com",
    "name": "John Doe"
  },
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}

Login#

Authenticate and receive tokens.

emailstringrequired

User's email address

passwordstringrequired

User's password

curl -X POST http://localhost:3000/api/v2/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword123"
  }'

Response#

{
  "user": {
    "id": "user-uuid",
    "email": "user@example.com",
    "name": "John Doe"
  },
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}

Refresh Token#

Get a new access token using a refresh token.

refreshTokenstringrequired

Valid refresh token

curl -X POST http://localhost:3000/api/v2/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{
    "refreshToken": "eyJhbGciOiJIUzI1NiIs..."
  }'

Response#

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIs..."
}

Logout#

Invalidate the current session.

curl -X POST http://localhost:3000/api/v2/auth/logout \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response#

{
  "message": "Logged out successfully"
}

Get Current User#

Get the authenticated user's profile.

curl http://localhost:3000/api/v2/auth/me \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response#

{
  "user": {
    "id": "user-uuid",
    "email": "user@example.com",
    "name": "John Doe",
    "organizationId": "org-uuid",
    "role": "owner",
    "createdAt": "2024-01-28T12:00:00.000Z"
  }
}

Token Expiry#

Token TypeExpiry
Access Token15 minutes
Refresh Token7 days

Access tokens expire quickly for security. Use refresh tokens to get new access tokens without re-authenticating.

Error Responses#

ErrorStatusDescription
INVALID_CREDENTIALS401Wrong email or password
EMAIL_EXISTS409Email already registered
TOKEN_EXPIRED401Token has expired
INVALID_TOKEN401Token is malformed or invalid
Documentation