Note: For more information about the Shotgun API, see our Developer Hub.
The Shotgun API (Application Programming Interface) enables users to easily integrate their tools with Shotgun. Through it you can create automated processes, integrate with many third party software packages, and communicate with existing tools within your studio. Using the simple CRUD-based, Python API, you can quickly get your scripts integrated with Shotgun. Because the needs of every studio are very different, we provide powerful, low-level functionality and leave most of the business logic to you.
The API follows the CRUD pattern allowing simple Create, Read, Update, and Delete actions. Each request acts on a single entity type and depending on the specific action, can define filters, columns to return, sorting information, and additional options. In order to communicate with the Shotgun server via the API, the script must be registered with your Shotgun site and have a valid API key. You generate script keys from the Admin Scripts page :
We strongly recommend that you register your scripts separately and have individual API keys for each. This will help you to monitor each of your scripts and the actions they are performing much more accurately in the event logs.
Action Menu Items
If you set up a script that you want to easily launch from within the Shotgun interface, you can do that via Action Menu Items. These are custom menu choices that appear in the menu you get when right-clicking on an entity, and that call your script when a user clicks on them.
You can set up different Action Menu Items for different entities, and can restrict access to them by Project or by Permission Group. Read more technical details on how to set up Action Menu Items here.
Contribute and Collaborate
Have you made some amazing tools with Shotgun you want to share with the world? Awesome! We have an active and vibrant developer community who loves to share and collaborate with each other. So how do you get involved?
- Join the Shotgun-Dev List
- Post your code to GitHub (make sure your code isn't pipeline specific, is well documented, and has a README in either txt or mdk format)
- Post a link and description to the dev list. The dev community and Shotgun developers will check it out, provide feedback, and sing your praises.
We are constantly amazed and inspired by many of the tools and integrations made by our clients. Show us what you can do!
Event Trigger Daemon
Every action performed in Shotgun (either by a user or an API script) generates an Event. The Event Daemon can monitor that event stream and then execute specific API scripts based on conditions you define. Some examples include:
- Automatically changing downstream Task statuses based on the status of upstream Tasks.
- Recalculate relevant cut duration fields when values change.
- Perform file packaging and transfer operations when a Shot is set to a particular status.
And many more! The API and trigger framework are very flexible and can accommodate just about any operation you require.
Common First Projects
- Create a Version and link it to a Shot - allows you to automate the submission of new renders for review.
- Upload a thumbnail - everything on your site can have an up-to-date thumbnail without manually adding them.
- Integrate Shotgun with your code repository such as SVN - utilise Shotgun to project manage any software development.
- Link to directory creation on disk - ensure that your directories are always created with consistent structure by automating the process when Shots, Assets, etc are created in Shotgun.
Some things you can't do with the API
- Access or alter permission rules, for security reasons (though we're considering read-only access)
- Read or alter page settings
- Access filter / query settings for individual pages or widgets
- Interact with the UI
- Set user passwords
- Add, edit or remove Tags
- Add, edit or remove conditional formatting rules
- Create or edit query fields
- Limit script access to specific projects
Q: Do I have to pay extra to use the API?
A: No, use of the API is included for free with Shotgun.
Q: Where can I find the API?
A: The API is hosted on Github.
Q: Are there any example scripts I can use?
Q: Is there a developer community?
A: Yes! We have a vibrant community of Shotgun developers who are happy to discuss implementation techniques and share code. Join the discussion here.