P4 REST API

Developers can use the P4 REST API to build scripts and applications that integrate with P4, automate workflows, and extend P4.

Features offered in Technology Preview are experimental and not guaranteed to always work as expected. If you have feedback and functionality suggestions, email techpreview@perforce.com.

The REST API runs on the built-in P4 Web Server, which must be started before you can use the API. To learn more, see p4 webserver in the P4 CLI Reference.

Administrators can limit the number of files that can be downloaded in a single REST API request by configuring restapi.download.maxfiles. This can help prevent excessive server load caused by large file download requests. For details, see restapi.download.maxfiles in the configurables reference.

Escape P4 Server reserved characters in filenames when using REST API requests. To learn more, see P4 REST API: Reserved characters.

To learn more about using the REST API, see the P4 REST API documentation.

P4 REST API 2026.2 enhancements

The P4 REST API is in Technology Preview and under active development. If you used an earlier version of the P4 REST API, review the changes and required actions to make sure your application is not impacted when upgrading.

Breaking change

The following GET /depot endpoint query parameters have been renamed:

  • filter is now depot

  • ciFilter is now ciDepot

Existing integrations that use the previous parameter names must be updated.

The GET /api/v0/depot endpoint response also renames two keys. In most cases the values are unchanged, but streamDepth is now returned as a numeric value instead of a string.

  • For remote depot entries, remoteAddress replaces address. This key holds the P4PORT of the remote server, for example ssl:remote.example.com:1666. The response no longer includes address.

  • For stream depot entries, streamDepth replaces depth. This key now holds the stream depth as a numeric value, for example 1. The response no longer includes depth.

This is a breaking change for clients that read address or depth from the GET /api/v0/depot response.

Update integrations to read remoteAddress or streamDepth instead, and to handle streamDepth as a number rather than a string. The p4 depots -ztag command line output is unchanged, because the rename applies only to the REST API response.

In this section: