Metacleaner API Documentation

Welcome to the Metacleaner API! This API allows your app to integrate seamlessly with our metacleaner service, enabling automated metadata removal and cleanup.

Step 1: Register Your Application

Go to your dashboard's Integrations page:

There, provide:

  • App name — the name of your application
  • API Callback URL — the endpoint on your server where we'll redirect after authorization

After submitting, you will receive:

  • A Client ID
  • A Client Secret
  • An Authorization Endpoint URL

Step 2: Authorize Your Application

Click the Authorization Endpoint URL. This will open a page showing:

  • An Authorize button
  • A Cancel button

If you click Authorize, you will be redirected to your API Callback URL with a code parameter appended:

https://your-callback-url.com/callback?code=AUTHORIZATION_CODE_HERE

Important: Copy this authorization code from the URL. You will need it for the next step.

Step 3: Exchange Authorization Code for Access Token

Send a POST request to:

https://metacleaner.com/oauth/token

With the following form data (application/x-www-form-urlencoded):

Parameter Description Example
grant_type Must be authorization_code authorization_code
client_id Your Client ID abc123xyz
client_secret Your Client Secret shh-its-a-secret
redirect_uri Your API Callback URL https://your-callback-url.com/callback
code The authorization code from Step 2 AUTHORIZATION_CODE_HERE

Example cURL

Terminal
curl -X POST https://metacleaner.com/oauth/token \
     -d "grant_type=authorization_code" \
     -d "client_id=your_client_id" \
     -d "client_secret=your_client_secret" \
     -d "redirect_uri=https://your-callback.com" \
     -d "code=AUTH_CODE_HERE"

You'll receive:

JSON Response
{
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "YOUR_ACCESS_TOKEN",
    "refresh_token": "REFRESH_TOKEN"
}

Step 4: Clean Files

Use the access_token to call the cleaning endpoint:

Endpoint

POST https://metacleaner.com/api/files

Headers

HTTP Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: multipart/form-data

Form Data

Field Description
files[] File(s) to clean (array)

Example cURL

Terminal
curl -X POST https://metacleaner.com/api/files \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -F "files[]=@/path/to/yourfile1.jpg" \
     -F "files[]=@/path/to/yourfile2.png"

Response

JSON Response
{
    "contents": [
        {
            "filename": "cleaned1749572403_yourfile1.jpg",
            "path": "https://test.metacleaner.com/storage/cleaned1749572403_yourfile1.png"
        },
        {
            "filename": "cleaned1749572404_yourfile2.png",
            "path": "https://test.metacleaner.com/storage/cleaned1749572404_yourfile2.png"
        }
    ]
}

Need Help?

If you need assistance or wish to upgrade to an advanced or enterprise plan: