Mint a git token
POST
/api/orgs/{org}/projects/{project}/git-token
const url = 'https://api-dev.wrktr.com/api/orgs/example/projects/example/git-token';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"scope":"read"}'};
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://api-dev.wrktr.com/api/orgs/example/projects/example/git-token \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "scope": "read" }'A short-lived token for the project’s git remote (what wrktr credential hands git). With no scope: write for the organization’s members, read for anyone else reading a public project.
Authorizations
Section titled “Authorizations”- bearer
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”org
required
string
project
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”GitToken
Media typeapplication/json
object
token
required
string
expiresAt
required
string
Examplegenerated
{ "token": "example", "expiresAt": "example"}Unauthorized
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Unauthorized"}Forbidden
Media typeapplication/json
object
_tag
required
string
message
required
string
Example
{ "_tag": "Forbidden"}ProjectNotFound
Media typeapplication/json
object
_tag
required
string
project
required
string
Example
{ "_tag": "ProjectNotFound"}