New to the Photoshop API — The ActionJSON API

We are incredibly excited to announce a new feature in the Photoshop API — support for ActionJSON workflows.
So what’s new?
Previously, the API supported executing Photoshop Action files. This feature lets you take recorded actions from Photoshop on the desktop and apply them at scale via our developer API.
But with ActionJSON support, you can now create powerful and configurable workflows for your API calls. Let’s take a deeper look!
The what and how of ActionJSON
For those of you who are already familiar with recording Photoshop Actions, working with ActionJSON requires a few more steps.
First, you’ll need to enable Developer Mode in Photoshop. In the most recent version of Photoshop, this is done via the Preferences/Plugins menu. (Be sure to exit Photoshop after enabling Developer Mode)
After you’ve done that, go into the Plugins/Development menu, select Record Action Commands
, and begin creating a new ActionJSON file. Our docs provide more detailed instructions on this topic, including information about how an existing action (an .atn
file) can be converted to JSON.
Speaking as a developer with little to no Photoshop experience, I had no trouble creating an action file. I opened up a source image and performed two actions — applying a Gaussian blur and then a Sepia effect. The result of this was the following JSON:
Now let’s see how we can use this with the new endpoint.
Running Photoshop ActionJSON with Dropbox
For our demo, we’re going to use Dropbox and its SDK. We’ll generate both input and output links to use with the Photoshop API. This could definitely be written to be more flexible, and could even be automated in a way that any new file added to a Dropbox folder would use the Photoshop API.
Here’s the Dropbox portion:
As stated above, the paths are static but could absolutely be dynamic. Given that we have our input and output defined, here’s how we can use the new endpoint.
First, we take our ActionJSON and bring it into our code. We could read in the file, or simply copy and paste:
Next, we take this and include it in the data we’ll be sending to the API. This illustrates another really good feature of our endpoint. We don’t need to provide the Photoshop API with read access to your Action file. Our action is just data!
Lastly, we simply send this to the API:
As with the other Photoshop API endpoints, this is going to kick off a job that we can poll for its status.
Here’s the input PSD file used for our test:

And here’s the result with the two operations (blur and sepia) applied:

Of course, the biggest benefit is that we can now tweak the operations on the fly! The first operation, representing the blur, may be something we want to tweak based on various factors. Our action can be dynamic by simply changing the value:
While this is still hard-coded, you get the idea. Here’s an example of how this modified version generates its output:

For more information, check out the API reference as well as the documentation.
Another powerful feature of this endpoint is the ability to apply additional images directly into the JSON via placeholders. You can see this in our docs but we’ll definitely be covering this in our next post!
We’ve included the complete demo application below, but be aware it makes use of the new Adobe OAuth authentication system.
Photoshop APIs work just fine with the “older” authentication system as well as the new, and you can read more about those changes here (Important Update for Developers Using Adobe APIs).
Interested in learning more? You can find other articles and tutorials by Raymond Camden here.