Skip to content
GitmoapAPIBeta
Identity & platformtemplates
GET/templates

List file templates

list_templates
  • Public
    This operation declares no security requirement: it takes no token.
  • Single-resource

    x-gitmoap-isolation: {"kind":"single_or_self_scoped"}

  • Conditional · 304
    Declares 304 Not Modified.

The templates a new file can start from — licences, .gitignore files, and a repository's paperwork: a changelog, a contributing guide, a code of conduct, a security policy and a service catalog. Without kind, every template.

Parameters

Query
  • kindTemplateKindlicensegitignorechangelogcontributingcode_of_conductsecuritycatalogoptionalOnly templates of this kind

Responses

200The templates, by kind and then keyapplication/json
  • itemsarray of TemplateSummary
    • The TemplateSummary schema
    • default_pathstringWhere the file usually goes: LICENSE, .gitignore, .gitmoap/catalog.yaml.
    • fieldsarray of TemplateFieldThe values the content asks for, in the order it first asks.
      • The TemplateField schema
      • labelstringWhat to call it next to the input that fills it in.
      • namestringThe placeholder's name — year stands for {{year}}.
    • keystringUnique within its kind: mit, rust, default.
    • kindTemplateKindlicensegitignorechangelogcontributingcode_of_conductsecuritycatalogWhat a template is for.
    • namestring
    • spdx_idstring or nulloptionalA licence's SPDX identifier.
    • summarystring or nulloptional
200 exampleSynthesized example
{
"items": [
{
"default_path": "default-path-6454",
"fields": [],
"key": "key-eba8",
"kind": "license",
"name": "payments-api"
},
{
"default_path": "default-path-9e6e",
"fields": [],
"key": "key-9cb4",
"kind": "license",
"name": "payments-api"
}
]
}
304The templates have not changed since the validator was issued

No body.

400`kind` names no kind of templateapplication/json
Error codes
  • BAD_REQUESTThe request is malformed: a parameter or a body field is not a well-formed value of its type
  • errorErrorBody
    • The ErrorBody schema
    • codestringThe coarse category, tied to the status: NOT_FOUND, CONFLICT, INSUFFICIENT_SCOPE. Every error has one; the API reference's error catalogue lists them all.
    • messagestringWhat went wrong, for a person. Written to be read, not parsed: match on reason or code.
    • fieldstring or nulloptionalOn a 400 that refused one field's value, the field, as its JSON path: email, items[0].name. Put the message under that input. Absent on every other error.
    • reasonstring or nulloptionalThe specific code, when the error has one: LAST_ORGANIZATION_OWNER, BRANCH_PROTECTED. The message starts with it too. Match on this when it is present, and on code otherwise.
    • required_scopestring or nulloptionalThe scope the access token was missing, on INSUFFICIENT_SCOPE.
    • violationsanyoptionalPresent on the structured-validation errors (PROVIDER_VALIDATION_FAILED per-node, PIPELINE_VALIDATION_FAILED DAG): a JSON array of the offending elements, so a caller can fix every one in a single round-trip. Absent (omitted) on every other error.
400 exampleSynthesized example
{
"error": {
"code": "code-76ca",
"message": "Inline scalar newtypes but keep their brand"
}
}

CLI

gitmoap templates list-templates

  • --kindlicense | gitignore | changelog | contributing | code_of_conduct | security | catalogoptionalOnly templates of this kind

Used in these guides