Users API – GET /api/user-info

The Get User Info endpoint returns the authenticated user’s profile and subscription details. It requires a valid Bearer token.

Endpoint Summary

  • Method: GET
  • URL: /api/user-info
  • Authentication: Bearer token
  • Purpose: Retrieve current user’s ID, name, email, credits, subscription and trial status, and team role.

Response Fields

Field Type Description
id integer Unique user identifier
name string Full name
email string Email address
remaining_credits integer AI-generation credits left
subscription_status string null
trialendsat string null
isontrial boolean true if within paid or auto trial period
team_role string Current user’s role on their team (owner, member, etc.)

Example Responses

{
    "title": "Get Current User Info",
    "description": "Retrieve authenticated user profile and subscription details.",
    "method": "GET",
    "baseUrl": "https://app.docuwriter.ai",
    "endpoint": "/api/user-info",
    "headers": [
        {
            "key": "Authorization",
            "value": "Bearer <token>",
            "required": true
        }
    ],
    "queryParams": [],
    "pathParams": [],
    "bodyType": "none",
    "requestBody": "",
    "formData": [],
    "rawBody": "",
    "responses": {
        "200": {
            "description": "Successful retrieval of user info",
            "body": "{\n  \"success\": true,\n  \"data\": {\n    \"id\": 1,\n    \"name\": \"John Doe\",\n    \"email\": \"[email protected]\",\n    \"remaining_credits\": 42,\n    \"subscription_status\": \"active\",\n    \"trial_ends_at\": \"2023-12-01T10:30:00Z\",\n    \"is_on_trial\": false,\n    \"team_role\": \"owner\"\n  }\n}"
        },
        "401": {
            "description": "Authentication failed or missing token",
            "body": "{\n  \"message\": \"Unauthenticated.\"\n}"
        }
    }
}