CodingMantra LogoCodingMantra
GamesPortfolioProductsServicesAboutContact
  1. Home
  2. API Documentation
  3. User API

User API

Endpoints for accessing user-related data. All endpoints in this section require authentication.

GET
/api/user/credits

Retrieve the current credit balance for the authenticated user.

Example Request

curl -X GET 'https://codingmantra.com/api/user/credits' \
     -H 'Authorization: Bearer YOUR_API_KEY'

Example Response

{
  "data": {
    "credits": 50
  }
}

GET
/api/user/credits/history

Retrieve the last 100 credit transactions for the authenticated user, along with the current credit balance.

Example Request

curl -X GET 'https://codingmantra.com/api/user/credits/history' \
     -H 'Authorization: Bearer YOUR_API_KEY'

Example Response

{
  "data": {
    "currentCredits": 40,
    "history": [
      {
        "id": "some_transaction_id",
        "type": "debit",
        "tool": "Passport Photo Creator",
        "creditsUsed": 10,
        "timestamp": "2024-09-18T10:30:00.000Z"
      },
      {
        "id": "welcome-bonus",
        "type": "credit",
        "source": "Welcome Bonus",
        "creditsAdded": 50,
        "timestamp": "2024-09-18T10:00:00.000Z"
      }
    ]
  }
}

On This Page

Get Credit BalanceGet Credit History
CodingMantra LogoCodingMantra

Providing business solutions for small and medium-sized businesses and helping them to grow.

X / TwitterLinkedInInstagramFacebookGitHub

Company

  • About Us
  • Services
  • Products
  • Portfolio
  • Pricing
  • Blog
  • API Docs
  • Contact Us

Top Tools

  • All Tools
  • Image Tools
  • Digital Marketing
  • Financial Tools
  • Games
  • SEO Tools

Legal

  • Privacy Policy
  • Terms & Conditions
  • Return Policy
  • Deals
  • Sitemap

© 2025 CodingMantra. All Rights Reserved.