Server REST API

The Plastic SCM server REST API is a RESTful API that allows you to consume Plastic SCM information (repositories, branches, revisions, ...) directly from the server.

On-Premises access


If you're running an on-premises Plastic SCM server, the API endpoints will be available in the same port as the WebAdmin — by default, it's 7178 for unencrypted local access and 7179 for external HTTPS access.

Keep in mind that the REST API only supports User/Password and LDAP as authentication methods. You can check what's the current working mode for the server in the WebAdmin, under Configuration > Authentication.


Example - Authenticate in the api

The example below shows how to perform a request to the login endpoint using cURL to authenticate a user. It returns an object containing two JWT tokens: one to authorize requests and another one to refresh the former when it expires.

curl -s --url http://localhost:7178/api/v1/login \
    -H "Content-Type: application/json" \
    -X POST \
    -d '{"user":"mgonzalez@codicesoftware.com","password":"MY_PWD"}'

Example - Retrieve the list of repositories

Using the JWT access token returned by the example above, you can now access the repositories endpoint. It will return a list of repositories available in your server.

curl -s --url http://localhost:7178/api/v1/repos -H "Authorization: Bearer ${jwt}"

Cloud access


If you'd like to access the API from the cloud, you need to know the base URI of the server that hosts your organization. Then, you can take the documentation below as a reference of what's available.