CodingMantra LogoCodingMantra
GalleryProductsPortfolioServicesGamesPricingContact
CodingMantra LogoCodingMantra

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

WhatsApp ChannelX / TwitterLinkedInInstagramFacebookGitHubYouTube

Company

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

Top Tools

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

Legal

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

© 2026 CodingMantra. All Rights Reserved.

    1. Home
    2. API Documentation
    3. Image Tools
    4. Passport Photo

    Passport Photo API

    Create compliant, professional passport-style photos, LinkedIn headshots, and ID card images.

    GET
    /api/image/passport-photo-prompts

    Retrieve a list of standard and creative passport photo styles.

    Example Request

    curl -X GET 'https://codingmantra.com/api/image/passport-photo-prompts'

    Example Response

    {
      "data": [
        {
          "id": "standard-passport",
          "title": "Standard Passport Photo",
          "categoryId": "official",
          "categoryTitle": "Official & Formal",
          "description": "Create a high-resolution..."
        },
        // ... more prompts
      ]
    }

    POST
    /api/image/passport-photo

    Process an image into a passport-style photo.

    Request Body

    FieldTypeDescription
    photoDataUristringRequired. Data URI or URL of the source photo.
    promptIdstringOptional. Standard pre-defined instructions template. Fetch IDs via `/api/image/passport-photo-prompts`.
    promptstringOptional. Custom instructions (e.g., "White background..."). Required if `promptId` is omitted.
    modelstringOptional. `'standard'` (default) or `'pro'`.
    aspectRatiostringOptional. Default `'1:1'`.
    referenceImagestringOptional. Style reference image.
    outputResultstringOptional. `'base64'` (default) or `'url'`.

    Example Request

    curl -X POST 'https://codingmantra.com/api/image/passport-photo' \
         -H 'Content-Type: application/json' \
         -H 'Authorization: Bearer YOUR_API_KEY' \
         -d '{
              "photoDataUri": "https://example.com/selfie.jpg",
              "promptId": "standard-passport",
              "aspectRatio": "1:1"
            }'

    Example Response

    {
      "data": {
        "photoDataUri": "data:image/png;base64,..."
      }
    }

    On This Page

    GET PromptsPOST GenerateFAQ

    Frequently Asked Questions