Getting Started
Get started with Trello's REST API
Trello’s Application Programming Interface (API) provides access to Trello's resources programatically. You can use the API to retrieve information from your boards, cards, and members, or create, update, and delete content using a script or other programming language.
This document focuses on creating your first API request, and interacting with Trello’s API at a very basic level. The full Trello API documentation is available at https://developer.atlassian.com/cloud/trello.
The benefits of using Trello’s API
Trello’s API can be used to:
Access Trello data by making RESTful API requests
Send data between Trello and other systems by writing custom scripts
Share information between Trello and other apps, such as CRMs, for example
Create custom Power-Ups that perform certain actions on a user’s behalf
How to talk about an API
Term | Definition |
---|---|
API key | A unique combination of letters and numbers that identifies the person making the API request |
Token | A unique combination of letters and numbers that is used for authentication and identification. An API tokens also carry the scope of access granted to a specific user |
Endpoint | The digital location where an API receives requests about its resources, usually at the end of the URL. /boards is the endpoint in the URL https://api.trello.com/1/boards |
Client | The application that makes the API request. A web browser is a common client. In our example below, the client is the cURL application |
Request method | Indicates the purpose of a request. Trello allows GET, POST, PUT, and DELETE methods. They tell to the Trello API what you want it to do. Explore all of the HTTP methods |
JSON object | JSON (JavaScript Object Notation) is a way to store and transport data in a structured format that resembles JavaScript object syntax. Learn more about JSON |
API call | A request sent from a client to a server to access data or functionality |
Status code | A three-digit number in the body of an API response that tells you if your request was successful or not. Read all about status codes |
API server | Authenticates and processes API requests before delivering an appropriate response |
API response | A response generated by the API server and returned to the client |
Generate an API key and token
To start using Trello’s API, you’ll need an API key. To generate an API key, you first need to create a Trello Power-Up. Creating a Power-Up is necessary to access Trello’s API because it’s tied to the process of generating an API key, and allows your key to be identified during the authentication process. Visit our guide to create your first Power-Up
After creating your Power-Up, generate your API token:
Go to the https://trello.com/power-ups/admin page
Click on your Power-Up then the API key tab
Click the Token link at the end of the paragraph to the right of your API key to proceed to the authorization page
Never share your API token. Treat it like your password. When used with your API key, it has full access to every aspect of your Trello account.
Allow the token to access your account
The token authorization page explains:
Which account the token can access
What it can do (also called its scope)
A token remains active until you disable it, and will be able to access any boards and Workspaces you gain access to in the future.
The token will be able to:
Read your name and username
Make comments as you
Read your email address
Read your Enterprises
Update and manage your Enterprises
Read all of your boards and Workspaces
Create and update cards, lists, boards, and Workspaces
Read Power-Ups you own
Update Power-Ups you own
The token will not be able to:
See your Trello password
Once you click Allow, you’ll grant your own Power-Up access to your account, and you’ll be redirected to a page that contains your API key and token.
Make your first API call
Now that you have your account's API key and token, you can start making API calls.
One of the most popular API calls in Trello is the board's API endpoint. You can make a GET request to the API 1/members/{memberId}/boards endpoint and list all of the boards associated with your user. For this example, we’ll use cURL in your computer’s terminal application.
Open the terminal application, and type the following:
curl 'https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}'
Replace the {yourKey} and {yourToken} text with the key and token values you previously generated. Replace the curly brackets too.
There are many ways you can use Trello’s API to send API calls, such as:
Coding languages (JavaScript, Python, PHP, Node.JS, etc.) in case you want to write a script that interacts with Trello’s API.
API platforms like Postman or SoapUI. These API platforms offer user-friendly interfaces for APIs.
It’s totally up to you to decide which platform or coding language suits your needs.
Make sense of the response
JSON is designed for computers to read instead of people, so it will look like a long unformatted block of text. Later, you can use a text editor or other tools to format JSON so it’s readable if you want to. For now, find the first board ID:
To find the first board ID:
Scroll back to where you entered your first request
Immediately after the request, you’ll see a 24 character ID formatted like this:[{"id":"xxxxxxxxxxxxxxxxxxxxxxxx",
Copy the ID from inside the quotes
Make another API call with information from the first call
With the information you have in the response, you can get more information from one of your particular boards.
To make your second API call:
Copy one of the board IDs from the JSON response
Replace the {idBoard} text in the following API call with the board ID:
curl 'https://api.trello.com/1/boards/{idBoard}?key={yourKey}&token={yourToken}'
The response will contain information about the board with that ID. You can find the board’s name and description near the beginning of the response, for example.
This is just an example of how to get started using the Trello API, and from here, there are many directions you can explore. Feel free to delve into the Trello API documentation to discover more about its capabilities.
More API call examples:
Get all the boards of your Workspace: curl 'https://api.trello.com/1/members/me/organizations/{organizationId}/boards
Get all cards on a board: curl 'https://api.trello.com/1/boards/{boardId}/cards?key=APIKey&token=APIToken
Get all users of Trello Enterprise: curl 'https://api.trello.com/1/enterprises/{enterpriseId}/members/query?key=APIKey&token=APIToken
While we don’t offer support for custom scripts or user-generated development, we do have an active community of developers. We’re happy you’re curious about using Trello’s API, and we strongly encourage you to seek guidance and support in Trello’s Developer Community.
Additional resources:
Was this helpful?