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.
| Name | In | Type | Description |
|---|---|---|---|
| project_id * | path | integer |
| Field | Type | Description |
|---|---|---|
| ref_prefix | string | The refs a write token may push: everything under this prefix, e.g. refs/heads/ or refs/heads/sessions/<id> |
| role | string | 'write' to clone and push, 'read' to clone and fetch only |
| Field | Type | Description |
|---|---|---|
| clone_url * | string | The repository's HTTPS URL, without credentials |
| expires_at * | string | When the token stops working |
| token * | string | Use as the HTTP password (any username) with git |
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/"}'