memory-bank/components/public-api.md
The Public API defines the gRPC interfaces for programmatic access to Gitpod functionality. It serves as the canonical way for external integrations, automation, and third-party tools to interact with Gitpod's core services. The API is structured into two packages (stable and experimental) with different compatibility guarantees and is designed to be backward compatible, well-documented, and follow modern API design principles.
This API provides a standardized interface for:
The Public API is implemented as a set of gRPC services defined in Protocol Buffer files. These definitions are used to generate client and server code in Go, TypeScript, and Java. The API is exposed on api.gitpod.io or api.<domain> for Dedicated installations.
The API is structured into two main packages:
Stable (v1):
gitpod/v1/Experimental:
gitpod/experimental/v1/The stable API (v1) is implemented directly in the server component using Connect. This means:
The experimental API is handled in the public-api-server component in two ways:
Direct Implementation:
Forwarded Implementation:
All implemented in server component using Connect:
Implemented in public-api-server:
Stable API (v1):
Experimental API:
The API uses Protocol Buffers version 3 (proto3) syntax, which provides forward and backward compatibility features.
The Public API uses Protocol Buffers and gRPC for defining interfaces. When changes are made to the .proto files, the corresponding code in Go, TypeScript, and Java needs to be regenerated.
To regenerate the code:
Navigate to the public-api directory:
cd components/public-api
Run the generate script:
./generate.sh
Rebuild the typescript code:
cd typescript-commond && yarn build
This script performs the following actions:
After regenerating the code, you may need to rebuild components that depend on the Public API. This typically involves:
For Go components:
cd <component-directory>
go build ./...
For TypeScript components:
cd <component-directory>
yarn install
yarn build
Using Leeway (for CI/CD):
leeway build -D components/<component-name>:app
The Public API is a critical component for enabling programmatic access to Gitpod functionality. It enables third-party integrations, automation, and custom tooling to interact with Gitpod in a standardized, versioned way.