uploadxDocs
Esc

    Quickstart

    Create an API key, check it, upload a file, and find it again.

    1. Create an API key

    1. Sign up for UploadX and open the dashboard.
    2. Go to API keys and create a key. Name it after the app or environment that will use it.
    3. Copy the key. It starts with upx_live_ and is shown only once.

    Keep it on your server, for example in an environment variable:

    Terminal
    export UPLOADX_API_KEY=upx_live_...

    Never put the key in a browser or mobile app. Anyone who has it can upload to, and delete from, your account.

    2. Check the key

    GET /v1/me answers with the key you called it with. It is the quickest way to confirm the key works:

    Terminal
    curl https://api.uploadx.in/v1/me \
      -H "Authorization: Bearer $UPLOADX_API_KEY"
    JSON
    { "id": "0b7c4f1e-2a9d-4e6b-8c3f-5d1a7e9b2c40", "name": "production" }

    A 401 means the key is wrong or disabled; see Authentication.

    3. Upload a file

    Create the record, then send the bytes to the upload link it returns:

    Terminal
    UPLOAD_URL=$(curl -s https://api.uploadx.in/v1/files \
      -H "Authorization: Bearer $UPLOADX_API_KEY" \
      -H "Content-Type: application/json" \
      -d "{ \"originalName\": \"onboarding.mp4\", \"mimeType\": \"video/mp4\", \"size\": $(wc -c < onboarding.mp4) }" \
      | jq -r .uploadUrl)
    
    curl -X PUT "$UPLOAD_URL" -H "Content-Type: video/mp4" --data-binary @onboarding.mp4

    The second call answers with the stored file’s record. See Upload a file for every field.

    4. Find it again

    Terminal
    curl "https://api.uploadx.in/v1/files?keyword=onboarding" \
      -H "Authorization: Bearer $UPLOADX_API_KEY"

    The file you just uploaded comes back in files, with its size already formatted for display.

    Next