Transloadit
Pricing
  • File Uploads
  • File Importing
  • Batch Processing
  • Video Encoding
  • Audio Encoding
  • Image Processing
  • Document Processing
  • Artificial Intelligence
  • File Filtering & Security
  • Media Cataloging
  • File Compression
  • Code Evaluation
  • File Exporting
  • Smart CDN
  • View all services
  • Explore integrations
  • Explore live demos
  • Uppy
  • TransloaditKit
  • Android SDK
  • Node.js SDK
  • Python SDK
  • Ruby SDK
  • Go SDK
  • Java SDK
  • PHP SDK
  • Zapier
  • MCP Server
  • Transloadit CLI
  • Terraform
  • Essentials
  • Best Practices
  • FAQ
  • Robots
  • API
  • Formats
  • Build your first app
  • About
  • Comparisons
  • Open Source
  • Testimonials
  • Jobs
  • Security
  • Posts
  • DevTimes
  • DevTips
  • Press
  • Research
  • Case Studies
  • Solutions
  • Guides
  • Glossary
  • Legal
  • Tools
  • Helping Coursera bring education to millions around the world
  • Transloadit Support
  • Open Source Support
  • Service level agreement
EssentialsRobotsFAQAPIFormatsBest Practices
Getting started
  • Overview
  • My first App
  • Saving result files
Topics
  • Assembly Instructions
  • Assembly Variables
  • Dynamic Evaluation
  • Templates
  • Webhooks
  • Third party Credentials
  • Builtin Templates
  • Resize Strategies
  • Assembly Execution Progress
  • Workspaces
  • AI Agents
  • Advanced use Parameter
  • The ignore_errors Parameter
Software Development Kits
  • Overview
  • Android SDK
  • Browsers
  • Convex
  • cURL
  • Go SDK
  • Java SDK
  • MCP Server
  • Multipart Form
  • Node.js SDK
  • PHP SDK
  • Python SDK
  • Ruby SDK
  • Terraform
  • TransloaditKit
  • Zapier Integration
Migration
  • Migrate from Cloudinary to Transloadit
  • Migrate from Uploadcare to Transloadit
  • Migrate from Mux to Transloadit
  • Migrate from Filestack to Transloadit

PHP SDK

transloadit/php-sdk⁠

Our PHP SDK allows you to automate the uploading of files through the Transloadit REST API using PHP.

It can be installed via Composer.

Install

composer require transloadit/php-sdk

Keep your Transloadit account's Auth Key & Secret nearby. You can check the API credentials page for these values.

Usage

Run the PHP examples below in trusted server-side scripts. Keep the Auth Secret on your server; authorize users before allowing them to trigger uploads or request Assembly results.

1. Upload and resize an image from your server

This example demonstrates how you can use the SDK to create an Assembly on your server.

It takes a sample image file, uploads it to Transloadit, and starts a resizing job on it.

<?php
require 'vendor/autoload.php';

use transloadit\Transloadit;

$transloadit = new Transloadit([
  'key' => 'YOUR_TRANSLOADIT_KEY',
  'secret' => 'YOUR_TRANSLOADIT_SECRET',
]);

$response = $transloadit->createAssembly([
  'files' => ['/PATH/TO/FILE.jpg'],
  'params' => [
    'steps' => [
      'resize' => [
        'robot' => '/image/resize',
        'width' => 200,
        'height' => 100,
      ],
    ],
  ],
]);

// Show the results of the assembly we spawned
echo '<pre>';
print_r($response);
echo '</pre>';

2. Create a simple end-user upload form

For browser uploads, follow the Uppy integration below. It keeps signing on your server and uploads files directly from the browser to Transloadit.

For processing-completion notifications, follow the signature-verification instructions in the Webhooks API documentation. A browser redirect does not prove that an Assembly has finished. Transloadit::response() parses incoming notification data; it does not authenticate it. Creating a Transloadit instance with a secret does not make that static method verify a webhook.

3. Use Uppy for file uploads

We recommend Uppy for browser uploads. Start with the canonical Uppy and Transloadit guide⁠ for Template setup, server signing, and framework-specific client examples.

Your PHP backend must authenticate the user and authorize the upload before signing short-lived Assembly options. Choose the allowed Template and Instructions on the server. Do not sign arbitrary parameters from the browser. See Signature Authentication for the signing protocol and the webhook documentation above for verifying completion notifications.

4. Fetch the Assembly Status JSON

You can use the getAssembly method to get the Assembly Status.

<?php
require 'vendor/autoload.php';

use transloadit\Transloadit;

$assemblyId = 'YOUR_ASSEMBLY_ID';

$transloadit = new Transloadit([
  'key' => 'YOUR_TRANSLOADIT_KEY',
  'secret' => 'YOUR_TRANSLOADIT_SECRET',
]);

$response = $transloadit->getAssembly($assemblyId);

echo '<pre>';
print_r($response);
echo '</pre>';

5. Create an Assembly with a Template.

This example demonstrates how you can use the SDK to create an Assembly with Templates.

You are expected to create a Template on your Transloadit account dashboard and add the Template ID here.

<?php
require 'vendor/autoload.php';

use transloadit\Transloadit;

$transloadit = new Transloadit([
  'key' => 'YOUR_TRANSLOADIT_KEY',
  'secret' => 'YOUR_TRANSLOADIT_SECRET',
]);

$response = $transloadit->createAssembly([
  'files' => ['/PATH/TO/FILE.jpg'],
  'params' => [
    'template_id' => 'YOUR_TEMPLATE_ID',
  ],
]);

// Show the results of the assembly we spawned
echo '<pre>';
print_r($response);
echo '</pre>';

Signature Auth

The PHP SDK signs outgoing API requests with your configured Auth Secret using Signature Authentication. Incoming webhooks require separate signature verification as described in the webhook documentation.

Example

For fully working examples take a look at examples/⁠.

Documentation

See GitHub⁠ for the full documentation.

Previous page ← Node.js SDKNext page Python SDK →
Contact support⁠

TransloaditChecking status…

Product

  • Services
  • Pricing
  • Demos
  • Tools
  • Security
  • Support

Company

  • About/Press
  • Blog/Jobs
  • Comparisons/Compliance matrix
  • Research
  • Open source
  • Solutions

Docs

  • Getting started
  • Transcoding
  • FAQ
  • API
  • Guides/DevTips
  • Supported formats

More

  • Platform status⁠
  • Community forum⁠
  • StackOverflow⁠
  • Uppy
  • tus⁠

© 2009–2026 Transloadit-II GmbH

PrivacyTermsImprint
EnglishDeutschEspañolPortuguês (Brasil)