Skip to Content

Issue a template project Git credential

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

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

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

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
scope*string
Value in"read""write"

Response Body

Success

application/json
  1. response
remote*string
Match^https:\/\/|^http:\/\/127\.0\.0\.1:(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\/git\/[a-z0-9-]+\/[a-z0-9-]+\.git$
username*"x-access-token"
Value in"x-access-token"
password*string
Length1 <= length
expiresAt*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.templates.issueGitCredential({
  "id": "example",
  "scope": "read"
});
Example Response
{
  "remote": "string",
  "username": "x-access-token",
  "password": "string",
  "expiresAt": "string"
}

Related documentation