Change a repository's credentials
const url = 'http://localhost:8080/api/v1/extension-repositories/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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 PATCH \ --url http://localhost:8080/api/v1/extension-repositories/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "credentials": { "type": "bearer", "token": "example" } }'Replaces the repository’s credentials, or removes them with null. The index is fetched with the new credentials first, and credentials that don’t work are refused. Only an admin can change a repository on the allow list.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
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 repository, with the index fetched with the new credentials.
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"}The signed-in user may not do this. demo_account when the user is a
shared demo account, named in CHEK_DEMO_USERS, which can’t change
its password, sessions, sign-in providers, extensions or annotations.
object
Explains the problem to a developer.
Example
{ "code": "bad_request"}The resource does not exist.
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"}