Skip to content


Repository files navigation

TransIP API Client for Kotlin/Java

A complete client implementation of the TransIP REST API for Java/Kotlin.

See the complete documentation here

You can use the following demo token to try it out:



See the repository and versions on maven central

Gradle DSL

implementation 'nl.wouterbohlken.transip-api-kotlin:transip-api-client:1.0.0'

Apache maven



  1. Request a key in the TransIP control panel, save its contents to a key.pem file in your preferred directory.

  2. To make use of the API, the key needs to be converted to PKCS8 format, run the following command and save the key.pkcs8 file:

openssl pkcs8 -topk8 -in key.pem -nocrypt -outform DER -out key.pkcs8
  1. Now that we have a key, we can generate tokens like such:
import nl.wouterbohlken.transip.api.TransipAPI
import nl.wouterbohlken.transip.authentication.Authenticator

val privateKey = File("/path/to/key.pkcs8")
val login = "your-username"
val authenticator = Authenticator(privateKey, login)
val token = authenticator.generateToken()

You can add additional parameters to the Authenticator to override the defaults, possible parameters are: expirationTime, label, readOnly and globalKey


Every API call should make use of the TransipAPI class. This class only requires a token and then passes this to all resources used.

A typical API call looks like this:

val api = TransipAPI(token)
val vpses = api.vps.vpses().list()

Most functionality has been covered by specific methods, for instance, to register a domain, you can use the following call:

val api = TransipAPI(token)"")

For a complete set of API call examples, please refer to the library/src/main/kotlin/nl/wouterbohlken/transip/examples directory in this repository.

Most products (like domain and VPS) have nested resources, for retrieving these nested resources, an additional identifier is needed, you can use the getIdentifier() method for this:

val api = TransipAPI(token)
val vpses = api.vps.vpses().list()
val firstVps = vpses[0]
val snapshots = api.vps.snapshots(firstVps.getIdentifier()).list()

Rate limit

The Client class keeps track of the rate limit by default. It is updated after each request. The current rate limit status can be retrieved as such:


Limitations and future work

  • Only string representation of tokens: the tokens are not JSON decoded and therefore, no expiration date can be read. This issue can be fixed by using one of the JWT libraries and decode it.
  • No pagination: some list methods on resources support pagination to keep the response size small, this is not yet implemented in this client, only full lists will be returned.
  • Resource clients: every child client inherits from the Client class, this class implements all REST methods (GET, POST, PUT, PATCH, DELETE). Most resources, however, don't support all methods. Please refer to the documentation to see what methods can be used on the resources.
  • Only supports pkcs8 format keys, not the original generated in the control panel.
  • The Signer class supports a File parameter containing the private key, not e.g. an InputStream containing it's contents.


Client implementation of the TransIP REST API in Kotlin







No packages published