---
title: "Issue a template project Git credential"
method: POST
path: "/v1/templates/{id}/repository/credentials"
tags: ["Templates"]
---

# Issue a template project Git credential

`POST /v1/templates/{id}/repository/credentials`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/templates/{id}/repository/credentials`
- Auth: API key in header `x-api-key`

Exchanges the caller's Samva authorization for a one-hour Git credential scoped to the template repository.

## Path parameters

- `id` string, required

## Request body

- object
  - `scope` 'read' | 'write', required

## Response `200`

Success

- object
  - `remote` string, required
  - `username` 'x-access-token', required
  - `password` string, required
  - `expiresAt` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

[API](https://skmtc.dev/samva/apis/samva-api.md) · [All operations](https://skmtc.dev/samva/apis/samva-api/llms.txt) · [OpenAPI document](https://skmtc.dev/samva/apis/samva-api/revisions/a99408542cc3?raw)
