Add a repository
const url = 'http://localhost:8080/api/v1/extension-repositories';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"chek.page/extensions","credentials":{"type":"bearer","token":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/extension-repositories \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "chek.page/extensions", "credentials": { "type": "bearer", "token": "example" } }'An admin adds to the allow list. Other users add a repository of their own, which needs allowAnyRepository. The server fetches the index first and refuses a repository whose index it can’t read.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Where the repository is, stored as its index’s URL:
- the index itself, such as
https://example.org/chek/index.json; - the folder holding
index.json, such ashttps://chek.page/extensionsorchek.page/extensions; - a GitHub repository as
github:owner/repo, optionally with@reffor a branch or tag and/pathfor a folder, read from its raw files.
Example
chek.page/extensionsobject
object
object
Example
X-Api-KeySeveral headers, such as a Cloudflare Access service token’s ID and secret.
object
object
Example
CF-Access-Client-IdResponses
Section titled “Responses”The added repository.
object
What the repository’s index calls it.
On the admin’s allow list rather than added by the user.
Whether its extensions can be installed and run. A user’s own repository isn’t while the admin allows only the allow list.
Whether credentials are stored for it. They’re never returned.
When the index was last fetched successfully.
Why the last fetch failed, if it did.
Example generated
{ "id": 1, "url": "https://example.com", "name": "example", "allowListed": true, "usable": true, "hasCredentials": true, "extensionCount": 1, "fetchedAt": "2026-04-15T12:00:00Z", "fetchError": "example", "createdAt": "2026-04-15T12:00:00Z"}The request was malformed.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The request has no valid session token.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}Only an admin can add repositories while just the allow list is allowed.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The repository has already been added to this list.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The repository answered 401 or 403, or is a host known to refuse another way: a private GitHub repository’s 404, or Cloudflare Access’s redirect to its sign-in page. The code says what to ask for, from the scheme of its WWW-Authenticate header: repository_needs_token (Bearer), repository_needs_password (Basic), or repository_needs_credentials (another scheme or none, as for a host that checks its own headers). repository_credentials_refused means credentials were sent and refused. Not 401, which would mean the client’s own session ended.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The server failed; details are in its log.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The repository’s index couldn’t be fetched or isn’t valid.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}