Connect a mod manager
Use the CPC Hub API to find files, download specific versions, and upload releases.
Connect with OAuth
- Register your manager.
Ask the site operator to register your manager as a public OAuth client with an HTTPS or loopback callback URL. Your manager does not need a client secret.
- Open the system browser.
Send the user to
/o/authorize/with a randomstateand an S256 PKCE challenge. They sign in, then approve the permissions your manager requests. - Exchange the code.
Check that the returned
statematches the value you sent. POST the authorization code and original PKCE verifier to/o/token/. Access tokens last one hour. Each refresh returns a new refresh token; replace the old one. - Use the API or create a key.
Send
Authorization: Bearer <token>with API requests. If the user grantedkeys:write, POST to/api/v1/keys/to create a separate API key. Its read/write permissions cannot exceed the permissions the user granted. Omitdaysor sendnullfor no expiry, or set it to 1–90 days.
Keep credentials in the operating system’s credential store. Users can revoke your manager’s access and its keys from their account.
Files & versioning
Filter creations with /api/v1/items/?tag=parking. Tag matching ignores case and extra spaces. Get public tags and creation counts at /api/v1/tags/; signed-in editors can look up tag suggestions at /api/v1/tags/suggest/?q=park. By default, a tag appears in the public list once 11 visible creations use it. Admins can change that threshold.
Check /api/v1/types/ for enabled file types, extensions, and upload limits. Upload raw .cpbp blueprints or .cpcs scenarios. Blueprint packs, ZIPs, JSON, and other mods are not accepted. The server stores accepted game files unchanged.
Create a draft, then upload a game file and at least one screenshot. Each upload returns HTTP 202 with a validation job. Poll /api/v1/items/{id}/upload-jobs/ to check its status. Files stay private until validation passes.
Set status to published when ready. You can also set it while checks are pending to publish automatically after they pass. Each creation allows up to eight screenshots. The default game-file limit is 15 MiB; /api/v1/types/ reports the current limit.
Each approved release includes a stable ID, version, original filename, size, and SHA-256 checksum. Download by release ID and verify the checksum before installation.
Download releases from the URLs returned by the API. Screenshots may use a separate public host. Do not forward your CPC Hub Authorization header to that host.
The server checks file structure. Your manager must handle installation paths and game compatibility.