Documentation

API reference · git
Sections

git

Used by the website. These routes don't accept an API key.

POST/git/{project_id}/token

Mint a short-lived git token for a project you own or are a member of

Website sign-in only

Pass it to git as the HTTP password (any username) against `clone_url`. A write token can push branches under `ref_prefix`; a read token can only clone and fetch. An owner or editor may ask for a write token; a viewer only a read token (403 for write). The token carries your own user id. Only available while git access is switched on.

Parameters
NameInTypeDescription
project_id *pathinteger
Request body (JSON)
FieldTypeDescription
ref_prefixstringThe refs a write token may push: everything under this prefix, e.g. refs/heads/ or refs/heads/sessions/<id>
rolestring'write' to clone and push, 'read' to clone and fetch only
Response: GitTokenResponse
FieldTypeDescription
clone_url *stringThe repository's HTTPS URL, without credentials
expires_at *stringWhen the token stops working
token *stringUse as the HTTP password (any username) with git
curl
curl -X POST 'https://api.papervantage.com/git/1/token' \
  -H "Authorization: Bearer $COGNITO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref_prefix":"refs/heads/"}'

Next: Interests