Skip to main content
RapidDev - Software Development Agency
retool-integrationsDevelopment Workflow

How to Integrate Retool with Travis CI

Connect Retool to Travis CI using a REST API Resource targeting the Travis CI API v3 (api.travis-ci.com). Authenticate with a Travis CI API token passed in a Travis-API-Version header alongside an Authorization Bearer token. Pull build and job status data into Retool to build a unified CI dashboard that combines Travis CI build results with GitHub commit data for a complete PR-to-deploy pipeline view.

What you'll learn

  • How to obtain a Travis CI API token and configure the required headers in a Retool REST API Resource
  • How to query Travis CI builds, jobs, and repository status using the v3 API
  • How to build a CI build status dashboard showing recent builds with pass/fail indicators
  • How to combine Travis CI build data with GitHub commit data for PR traceability
  • How to use JavaScript transformers to format build duration and status data for dashboard display
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate16 min read30 minutesDevOpsLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to Travis CI using a REST API Resource targeting the Travis CI API v3 (api.travis-ci.com). Authenticate with a Travis CI API token passed in a Travis-API-Version header alongside an Authorization Bearer token. Pull build and job status data into Retool to build a unified CI dashboard that combines Travis CI build results with GitHub commit data for a complete PR-to-deploy pipeline view.

Quick facts about this guide
FactValue
ToolTravis CI
CategoryDevOps
MethodDevelopment Workflow
DifficultyIntermediate
Time required30 minutes
Last updatedApril 2026

Why connect Retool to Travis CI?

Travis CI provides a web interface for viewing build history, but engineering teams often need CI data in context with other development metrics: which GitHub PR triggered this build, who authored the failing commit, how long builds have been trending longer, or which repositories have been failing for multiple consecutive runs. Travis CI's native UI is build-centric, not repository-fleet-centric — it does not provide a cross-repository health overview without clicking into each repo individually. Retool solves this by querying the Travis CI API alongside GitHub and presenting a unified engineering operations dashboard.

The most impactful use case for a Travis CI Retool integration is a build health monitor for teams managing multiple repositories. A Table showing all repositories with their last build status (passing, failing, errored), last build duration, and failure streak count lets engineering managers instantly spot which repos need attention without checking Travis CI for each one individually. Combining this with GitHub API data adds the PR author, branch name, and commit message to each build record, enabling faster root cause identification when a build goes red.

Travis CI's API v3 is the current version and uses a resource-oriented structure: the key endpoints are /repos (repository list and metadata), /builds (build history with status and duration), and /jobs (individual job output within a build). All resources are scoped to an owner (organization or user). The API requires the Travis-API-Version: 3 header on every request — omitting this header causes the API to respond with the legacy v2 format, which has a different response structure.

Integration method

Development Workflow

Travis CI data is pulled into Retool via a REST API Resource targeting the Travis CI API v3 at https://api.travis-ci.com. Authentication requires two headers: Authorization with a Bearer token (your Travis CI API token) and Travis-API-Version set to '3'. This is a development workflow integration — Retool queries Travis CI build status and job data to create engineering dashboards and CI health monitors, rather than a user-facing application integration. Combining Travis CI data with GitHub API data in the same Retool app creates a complete PR-to-build traceability view.

Prerequisites

  • A Travis CI account (travis-ci.com) with access to the repositories you want to monitor
  • A Travis CI API token from your Travis CI account settings (Settings → API Authentication)
  • The owner slug (GitHub organization or username) for the repositories you want to query
  • Basic understanding of CI/CD concepts and your team's Travis CI configuration
  • A Retool account with Resource creation permissions

Step-by-step guide

1

Obtain a Travis CI API token

Travis CI uses token-based authentication for its API v3. The API token is tied to your Travis CI account and provides access to all repositories visible to that account. In the Travis CI web application (travis-ci.com), click your profile picture or name in the top right corner to open the account dropdown. Select Settings from the menu. On the Settings page, navigate to the API Authentication section. Click Generate New Token or Copy Token if one already exists. Name the token something descriptive (e.g., Retool Dashboard) if prompted. Copy the generated token — it is typically a 22-character string. Store this token securely: it provides read access to your Travis CI build data and repository information, and in some configurations write access to trigger builds. Unlike some CI providers that use project-specific API keys, Travis CI API tokens are user-scoped and provide access to all repositories the account can see. For organizational use, consider creating a dedicated Travis CI machine user account that is a member of your GitHub organization, generating a token from that account, and using it for the Retool integration — this decouples the dashboard from any individual's account and ensures access does not break when team members leave. Note your GitHub organization slug as well — Travis CI uses the GitHub organization name as the repository owner in API paths (e.g., /owner/my-org/repos lists all repositories for the GitHub org 'my-org').

Pro tip: Travis CI API tokens are user-scoped, not repository-scoped. A single token from an account with access to your organization's GitHub repos will work for all repositories in that organization. You do not need a separate token per repository.

Expected result: You have a Travis CI API token and know your GitHub organization or username slug. Both are needed for configuring the Retool Resource and writing queries.

2

Configure the Travis CI API Resource in Retool

In Retool, navigate to the Resources tab and click Add Resource. Select REST API from the list. Name the resource Travis CI API. In the Base URL field, enter https://api.travis-ci.com — this is the Travis CI.com API endpoint. Note: travis-ci.org (the legacy open-source endpoint) was shut down in June 2021; all builds now use travis-ci.com regardless of whether the repository is public or private. Travis CI's API v3 has a critical requirement: every request must include a Travis-API-Version header set to 3, otherwise the API responds with a legacy v2 format that has a completely different response structure. In the Headers section, add two headers. First header: name Travis-API-Version, value 3. Second header: name Authorization, value token {{ config.TRAVIS_API_TOKEN }} — note the format is 'token YOUR_TOKEN' (not 'Bearer YOUR_TOKEN') for Travis CI's auth scheme. Create the configuration variable: navigate to Settings → Configuration Variables. Click Add variable, name it TRAVIS_API_TOKEN, paste your Travis CI API token as the value, and enable the secret toggle. Click Save on the Travis CI API Resource. Test the connection by creating a GET query to /user — this returns your Travis CI user profile and is a reliable authentication health check. The response includes your Travis CI user id, login (GitHub username), and synced_at timestamp.

Pro tip: Travis CI's Authorization header format uses 'token YOUR_VALUE' rather than the more common 'Bearer YOUR_VALUE'. If you use the Bearer format, you will receive a 403 error. The header value must start with the word 'token' followed by a space and then the actual token string.

Expected result: The Travis CI API Resource is saved in Retool with both the Travis-API-Version: 3 header and the token-format Authorization header. A test query to /user returns your Travis CI user profile, confirming authentication is working.

3

Query repositories and recent build status

Create a query to fetch the list of repositories for your organization along with their latest build status. Set Method to GET and Path to /owner/{{ retoolContext.configVars.TRAVIS_ORG_SLUG }}/repos — replace TRAVIS_ORG_SLUG with a configuration variable containing your GitHub organization name. Create this configuration variable in Retool Settings → Configuration Variables. Add URL parameters to the repos query: limit with value 100 to fetch up to 100 repositories, include with value repo.last_build to embed the last build details in each repository object, and sort_by with value default_branch.last_build:desc to sort by most recently built repositories first. The response returns a repositories array where each item includes the repository name, slug, description, and a last_build object containing the build id, state (passed, failed, errored, canceled), number, branch, duration, and started_at timestamp. Add a JavaScript transformer to flatten the nested last_build data and compute derived fields like failure_indicator and human-readable duration. Store your org slug as a configuration variable TRAVIS_ORG_SLUG. Create a second query for recent builds for a selected repository: Path /repo/{{ repoSlugInput.value }}/builds with limit parameter 25 — this powers the repository drill-down view when a user clicks a repo row.

repos_transformer.js
1// JavaScript transformer: flatten repos with last build status
2const repos = data.repositories || [];
3
4const stateColors = {
5 passed: '✅',
6 failed: '❌',
7 errored: '⚠️',
8 canceled: '⏹️',
9 created: '🕐',
10 started: '🔄'
11};
12
13return repos.map(repo => {
14 const lastBuild = repo.last_build || {};
15 const durationSec = lastBuild.duration || 0;
16 const minutes = Math.floor(durationSec / 60);
17 const seconds = durationSec % 60;
18
19 return {
20 repo_id: repo.id,
21 name: repo.name,
22 slug: repo.slug,
23 description: repo.description || '',
24 default_branch: repo.default_branch?.name || 'main',
25 build_id: lastBuild.id || null,
26 build_number: lastBuild.number || 'N/A',
27 build_state: lastBuild.state || 'unknown',
28 state_icon: stateColors[lastBuild.state] || '❓',
29 build_branch: lastBuild.branch?.name || '',
30 build_duration: durationSec,
31 duration_display: durationSec > 0 ? `${minutes}m ${seconds}s` : 'N/A',
32 started_at: lastBuild.started_at || '',
33 started_display: lastBuild.started_at
34 ? new Date(lastBuild.started_at).toLocaleString()
35 : 'Never'
36 };
37});

Pro tip: The repo slug in Travis CI's API is in the format 'owner/repo-name' (e.g., 'my-org/my-repo'). When constructing paths that reference a specific repository, use the URL-encoded slug: replace the forward slash with %2F in the path (e.g., /repo/my-org%2Fmy-repo/builds). Retool handles URL encoding automatically if you use the slug as a URL parameter value.

Expected result: The repos query returns a flat array of repository objects with last build state, duration, and human-readable timestamps. The data is ready to bind to a Table component with color-coded status indicators.

4

Build the CI health monitor dashboard

With the repository and build data available, build the engineering dashboard. Drag a Table component onto the canvas and bind it to the repos transformer output. Configure columns: state_icon (rename to Status, disable sorting since emoji strings sort arbitrarily), name (rename to Repository), build_branch (rename to Branch), duration_display (rename to Duration), and started_display (rename to Last Build). Enable column sorting on duration and started_at. Add conditional row styling: apply a red background to rows where build_state equals 'failed' or 'errored', green background for 'passed', and yellow for 'canceled'. Add a Text Input or Select component at the top to filter by repository name for large organizations with many repos. Add a Toggle or Checkbox to filter to show only failing repositories — wire this to a JavaScript transformer that filters the repos array to only rows where build_state is not 'passed'. Add a Stat row at the top showing: Total Repositories, Passing (count where state = passed), Failing (count where state = failed or errored), and Average Build Duration across all repos. When a user clicks a repo row in the Table, load recent builds for that repository using the second query and display them in a Container panel on the right side or in a Drawer component — show the build number, branch, commit message, status, and duration for the last 25 builds in a secondary Table.

ci_health_stats.js
1// JavaScript query: CI health summary stats for Stat components
2const repos = getRepos.data || [];
3
4const total = repos.length;
5const passing = repos.filter(r => r.build_state === 'passed').length;
6const failing = repos.filter(r => ['failed', 'errored'].includes(r.build_state)).length;
7const withBuilds = repos.filter(r => r.build_duration > 0);
8const avgDuration = withBuilds.length > 0
9 ? Math.round(withBuilds.reduce((s, r) => s + r.build_duration, 0) / withBuilds.length)
10 : 0;
11
12return {
13 total,
14 passing,
15 failing,
16 unknown: total - passing - failing,
17 pass_rate: total > 0 ? ((passing / total) * 100).toFixed(0) + '%' : 'N/A',
18 avg_duration_display: avgDuration > 0
19 ? `${Math.floor(avgDuration / 60)}m ${avgDuration % 60}s`
20 : 'N/A'
21};

Pro tip: Set the Table's row click event handler to store the clicked repo's slug in a Retool state variable, then use that variable as the path parameter in the detailed builds query. This creates a master-detail navigation pattern without page navigation.

Expected result: A CI health monitor Table shows all repositories with color-coded build status, duration, and last build time. Summary Stats show pass rate and average build duration. Clicking a repository loads its recent build history in a detail panel.

5

Add GitHub integration for PR traceability

Enhance the dashboard by combining Travis CI build data with GitHub commit and PR information. Create a second Retool Resource for the GitHub API: navigate to Resources → Add Resource → REST API. Name it GitHub API. Set Base URL to https://api.github.com. Add headers: Authorization with value Bearer {{ config.GITHUB_TOKEN }} and Accept with value application/vnd.github+json. Create a GITHUB_TOKEN configuration variable with a GitHub personal access token that has repo read access. In the Retool app, create a query targeting the GitHub API Resource: GET /repos/{{ retoolContext.configVars.TRAVIS_ORG_SLUG }}/{{ reposTable.selectedRow.name }}/commits with parameter per_page set to 25. This fetches recent commits for the selected repository. Create a JavaScript query that joins Travis CI builds with GitHub commits using the commit SHA — Travis CI build objects include a commit object with an sha field. Match each build to a commit to add the commit message, author name, and associated PR information. Display the enriched build list in the detail panel, showing: build status, commit message, author, and a link to the GitHub PR if one exists. For complex multi-tool engineering dashboards integrating CI, deployment, error tracking, and repository data in Retool, RapidDev's team can help architect comprehensive engineering operations platforms.

join_builds_commits.js
1// JavaScript query: join Travis CI builds with GitHub commits
2// Assumes: getBuilds.data = Travis CI builds array
3// getCommits.data = GitHub commits array
4const builds = getBuilds.data?.builds || [];
5const commits = getCommits.data || [];
6
7// Build commit lookup map by SHA
8const commitMap = {};
9commits.forEach(c => {
10 commitMap[c.sha] = {
11 message: c.commit?.message?.split('\n')[0] || '', // First line only
12 author: c.commit?.author?.name || c.author?.login || '',
13 html_url: c.html_url || ''
14 };
15});
16
17return builds.map(build => {
18 const sha = build.commit?.sha || '';
19 const commitInfo = commitMap[sha] || {};
20
21 const durationSec = build.duration || 0;
22
23 return {
24 build_number: build.number,
25 state: build.state,
26 branch: build.branch?.name || '',
27 duration_display: durationSec > 0
28 ? `${Math.floor(durationSec / 60)}m ${durationSec % 60}s`
29 : 'N/A',
30 started_at: build.started_at
31 ? new Date(build.started_at).toLocaleString()
32 : '',
33 sha: sha.substring(0, 7), // Short SHA for display
34 commit_message: commitInfo.message || build.commit?.message || '',
35 author: commitInfo.author || build.created_by?.login || '',
36 commit_url: commitInfo.html_url || ''
37 };
38});

Pro tip: Travis CI build objects include a commit.sha field that exactly matches the GitHub commit SHA. Use this as the join key when cross-referencing with the GitHub Commits API. For PR information, use GitHub's /repos/{owner}/{repo}/commits/{sha}/pulls endpoint to find which PRs include a given commit.

Expected result: The build detail panel now shows commit messages and authors alongside Travis CI build status, creating a complete traceability view from commit to build result. Engineers can see who authored a failing build without switching between Travis CI and GitHub.

Common use cases

Cross-repository CI build health monitor

Build a Retool dashboard showing all Travis CI repositories with their current build status, last build time, last build duration, and failure streak count. A Table with color-coded status indicators (green for passing, red for failing, yellow for errored) lets engineering managers see at a glance which repositories are healthy. Clicking a repository row shows its recent build history in a detail panel on the right side of the dashboard.

Retool Prompt

Build a Retool Travis CI health monitor that queries all repositories for an organization via the Travis CI API v3. Show a Table with repository name, last build status (color-coded), last build time, build duration, and branch. Enable row click to load the last 10 builds for the selected repository in a detail panel. Add a filter for showing only failing repositories.

Copy this prompt to try it in Retool

PR-to-build traceability dashboard

Create a Retool panel that combines Travis CI build data with GitHub PR information. Query Travis CI builds alongside the GitHub API to match each build to the PR that triggered it, adding PR title, author, and review status to the build record. Engineering leads can see which open PRs have failing CI and who needs to fix them, without switching between Travis CI and GitHub.

Retool Prompt

Build a Retool PR traceability dashboard that queries Travis CI builds for a repository alongside GitHub pull requests. Join builds to PRs using the branch name or commit SHA. Display a Table with PR title, author, CI status, build duration, and a link to the Travis CI build log. Filter to show only PRs with failing CI or builds that are taking longer than a threshold duration.

Copy this prompt to try it in Retool

Build duration trend and performance tracker

Build a Retool analytics dashboard tracking how CI build times have changed over the past 30 days for key repositories. Query Travis CI build history and extract duration data, then plot duration trends in a Line Chart. Identify which repositories have builds getting slower over time (indicating growing test suites or dependency bloat) and which are consistently fast. This informs CI optimization decisions.

Retool Prompt

Build a Retool Travis CI performance tracker that queries the last 50 builds for each of 5 key repositories. Show a Line Chart of build duration over time for each repository (one line per repo). Show a Table of average build duration by repository sorted by slowest. Add threshold lines at 5, 10, and 15 minutes to visually flag builds exceeding target durations.

Copy this prompt to try it in Retool

Troubleshooting

API returns 403 Forbidden with 'access denied' or 'invalid credentials' message

Cause: The Authorization header format is incorrect — Travis CI requires 'token YOUR_VALUE' not 'Bearer YOUR_VALUE', or the Travis-API-Version header is missing causing the API to use legacy v2 auth behavior.

Solution: Verify the Authorization header value starts with the word 'token ' (lowercase, with a space) followed by the API token. Confirm the Travis-API-Version header is present with value 3. Test by querying /user with these exact headers. If using Travis CI.com, ensure you are using the travis-ci.com API endpoint rather than the deprecated travis-ci.org endpoint.

Repos query returns 404 Not Found for a valid organization

Cause: The owner slug is incorrect, the organization has not been synced with Travis CI, or the API endpoint path is malformed.

Solution: Verify the owner slug exactly matches the GitHub organization name (case-sensitive). In Travis CI, navigate to Settings → Organizations to see which organizations are connected. If the organization does not appear, click Sync with GitHub to import repositories. Test with /owner/your-org-name (not /repos/your-org-name which is a GitHub API path, not Travis CI).

Repository builds query works but returns an empty builds array

Cause: The repository slug in the URL path contains a forward slash that is not URL-encoded, causing the API to misinterpret the path segments.

Solution: URL-encode the repository slug when using it in a path: replace the forward slash (/) in 'owner/repo-name' with %2F. In Retool, if the slug is stored as a URL parameter value it is encoded automatically, but if used directly in the path it must be encoded manually: /repo/my-org%2Fmy-repo/builds.

Build duration is showing as 0 or null for recent builds

Cause: Builds that are still in progress (state: 'started' or 'created') have not yet been assigned a duration since it is computed only after the build completes.

Solution: Handle null or zero duration values in the transformer by checking the build state before computing duration display. For in-progress builds, compute elapsed time from the started_at timestamp: Math.floor((Date.now() - new Date(build.started_at).getTime()) / 1000). Display 'In progress' or the computed elapsed time rather than N/A for better user experience.

typescript
1// Handle in-progress builds in transformer
2const durationSec = build.duration || 0;
3const isRunning = ['started', 'created'].includes(build.state);
4const displayDuration = isRunning && build.started_at
5 ? `Running (${Math.floor((Date.now() - new Date(build.started_at).getTime()) / 60000)}m)`
6 : durationSec > 0
7 ? `${Math.floor(durationSec / 60)}m ${durationSec % 60}s`
8 : 'N/A';

Best practices

  • Store the Travis CI API token in a Retool configuration variable marked as secret — the token provides access to all build logs and repository metadata for your organization.
  • Always include the Travis-API-Version: 3 header at the Resource level rather than per-query — omitting this header causes the API to return legacy v2 formatted responses that are incompatible with your v3 transformers.
  • Use the Authorization: token format (not Bearer) for Travis CI — this is Travis CI's specific auth convention and deviating from it causes 403 errors.
  • Cache repository list queries for 5-10 minutes — the repo list changes infrequently and caching reduces API load when multiple engineers view the dashboard simultaneously.
  • Use the include=repo.last_build parameter when querying /repos to get last build status in a single API call rather than making separate build queries per repository.
  • For organizations with more than 100 repositories, implement pagination using the limit and offset URL parameters and aggregate results across multiple queries in a JavaScript query.
  • Combine Travis CI build data with GitHub API data using commit SHA as the join key to add PR context, author information, and commit messages to build records without requiring additional Travis CI data.

Alternatives

Frequently asked questions

What is the difference between Travis CI.com and Travis CI.org, and which API endpoint should I use?

Travis CI.org was the original free platform for open-source projects and was shut down in June 2021. All builds now run on Travis CI.com (api.travis-ci.com) regardless of whether repositories are public or private. If you have existing configurations or links pointing to travis-ci.org, they are no longer active. Always use api.travis-ci.com as the API base URL in your Retool Resource.

Can I trigger a new Travis CI build from Retool?

Yes. Travis CI's API v3 supports triggering builds via POST to /repo/{slug}/requests with a JSON body specifying the branch and optional configuration overrides. This requires your API token to have write permissions on the repository. In Retool, create a POST query with the repo slug and branch name, then add a confirmation dialog before triggering builds to prevent accidental re-runs of expensive CI pipelines.

How do I access Travis CI build logs for failed builds from Retool?

Build logs are accessible per-job rather than per-build. Get the jobs for a build with GET /build/{id}/jobs — each build contains one or more jobs. Then fetch the log for a specific job with GET /job/{id}/log. The log endpoint returns a plain text response rather than JSON. Display it in a Retool Text component with monospace formatting. Note that Travis CI automatically archives logs after 90 days.

Why does my repos query only return 25 repositories when I have more?

Travis CI's API v3 defaults to a limit of 25 results per request. Add a limit URL parameter (maximum 100) to increase results per page. For organizations with more than 100 repositories, use the offset parameter for pagination: make multiple requests with offset=0, offset=100, offset=200 and combine results in a JavaScript query using Promise.all() to fetch all pages in parallel.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.