Platform Documentation
Breadcrumbs

CodeCollections & Codebundles API

CodeCollections are Git repositories that contain codebundles — reusable troubleshooting and automation scripts used by SLIs, SLOs, and Runbooks. The API provides read-only access to browse collections, branches, and codebundle metadata.


List CodeCollections

Retrieve all code collections available on the platform.



Method

GET

Path

/api/v3/codecollections

Auth

Bearer token required

Query Parameters

Parameter

Type

Required

Description

page

integer

No

Page number for pagination

Response 200 OK

JSON
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "name": "rw-cli-codecollection",
      "repoUrl": "https://github.com/runwhen-contrib/rw-cli-codecollection",
      "createdAt": "2026-01-01T00:00:00Z"
    }
  ]
}

Get CodeCollection Detail

Retrieve details of a specific code collection.



Method

GET

Path

/api/v3/codecollections/{name}

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

Response 200 OK

Returns the full code collection object with repository metadata.


Get CodeCollection Sync Status

Check the synchronization status of a code collection with its upstream Git repository.



Method

GET

Path

/api/v3/codecollections/{name}/sync-status

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

Response 200 OK

Returns the current sync state of the code collection.


Get CodeCollection Branch

Retrieve information about a specific branch of a code collection.



Method

GET

Path

/api/v3/codecollections/{name}/branches/{branch}

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

branch

string

The branch name (e.g., main)

Response 200 OK

Returns branch metadata and available codebundles.


Get Repository Content

Browse the file tree of a code collection branch.



Method

GET

Path

/api/v3/codecollections/{name}/branches/{branch}/{path}

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

branch

string

The branch name

path

string

File or directory path within the repository

Response 200 OK

Returns the file or directory listing at the specified path.


List SLXs in Branch

Retrieve all SLX definitions available in a code collection branch.



Method

GET

Path

/api/v3/codecollections/{name}/branches/{branch}/slxs

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

branch

string

The branch name

Response 200 OK

Returns a list of SLX definitions found in the specified branch.


Get Codebundle Stats

Retrieve statistics about codebundles in a code collection (e.g., usage counts, version info).



Method

GET

Path

/api/v3/codecollections/{name}/codebundle-stats

Auth

Bearer token required

Path Parameters

Parameter

Type

Description

name

string

The name of the code collection

Response 200 OK

Returns codebundle statistics for the collection.


Parse Codebundle

Parse a codebundle from a Git repository to extract its metadata and configuration.



Method

GET

Path

/api/v3/parsecodebundle

Auth

Bearer token required

Query Parameters

Parameter

Type

Required

Description

repoUrl

string

No

The Git repository URL

ref

string

No

The branch or tag reference

pathInRepo

string

No

Path to the codebundle within the repository

Response 200 OK

Returns the parsed codebundle metadata including tasks, parameters, and dependencies.