Check a token without saving it: the account it belongs to and its scopes.
const url = 'https://example.com/api/v1/git/connections/test';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"provider":"github","name":"gitlab-acme","baseUrl":"https://gitlab.com","token":"example","defaultBranch":"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 https://example.com/api/v1/git/connections/test \ --header 'Content-Type: application/json' \ --data '{ "provider": "github", "name": "gitlab-acme", "baseUrl": "https://gitlab.com", "token": "example", "defaultBranch": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
github (a personal or fine-grained token; the GitHub App has its
installations), gitlab, or gitea (Gitea and Forgejo).
Unique in the organization: lowercase letters, digits and -.
Example
gitlab-acmeThe provider’s URL; the provider’s public service when empty
(https://api.github.com, https://gitlab.com). Required for Gitea.
Example
https://gitlab.comA personal, project or group access token; write-only.
Responses
Section titled “Responses”What the provider said about a token.
object
The account the token belongs to.
The token’s scopes, when the provider tells them.
Scopes Kuben needs that the token lacks.
Examplegenerated
{ "ok": true, "username": "example", "scopes": [ "example" ], "missingScopes": [ "example" ], "error": "example", "checkedAt": 1}Problem Details body.
object
Stable machine-readable code, e.g. forbidden.
Short human readable title.
HTTP status.
Details, if safe to expose.
Example
{ "code": "forbidden"}Problem Details body.
object
Stable machine-readable code, e.g. forbidden.
Short human readable title.
HTTP status.
Details, if safe to expose.
Example
{ "code": "forbidden"}