---
title: Generating resource templates
description: Most resource types in Ping CLI support a template action that generates a complete JSON body skeleton. Use it as a starting point when creating or replacing a resource rather than authoring the request body from scratch.
component: pingcli
version: 1.0
page_id: pingcli:using_pingcli:generating-resource-templates
canonical_url: https://developer.pingidentity.com/pingcli/1.0/using_pingcli/generating-resource-templates.html
section_ids:
  how-it-works: How it works
  basic-workflow: Basic workflow
  resources-with-multiple-type-variants: Resources with multiple type variants
  learn-more: Learn more
---

# Generating resource templates

Most resource types in Ping CLI support a `template` action that generates a complete JSON body skeleton. Use it as a starting point when creating or replacing a resource rather than authoring the request body from scratch.

## How it works

Running `pingcli <product> <resource> template` prints a JSON object to stdout containing every field that `create` and `replace` accept, with all values set to their zero defaults. You edit the skeleton to supply the values you want, then feed the file back to `create` or `replace` using `--from-file`.

```bash
pingcli pingone groups template
```

Output:

```json
{
  "customData": {},
  "description": "",
  "displayName": "",
  "externalId": "",
  "name": "",
  "population": {
    "id": ""
  },
  "sourceId": "",
  "sourceType": "",
  "userFilter": ""
}
```

Fields set to empty strings, zero, `false`, or empty arrays are optional or will use service defaults. You only need to populate the fields relevant to your use case.

## Basic workflow

1. Generate the skeleton and save it to a file:

   ```bash
   pingcli pingone groups template > group.json
   ```

2. Edit the file to supply your values. Remove or leave blank any fields you don't need:

   ```json
   {
     "name": "Developers",
     "description": "Internal developer group",
     "population": {
       "id": "<population-id>"
     }
   }
   ```

3. Pass the edited file to `create`:

   ```bash
   pingcli pingone groups create --environment-id <env-id> --from-file group.json
   ```

You can also write directly to a file using `--output-file` instead of shell redirection:

```bash
pingcli pingone groups template --output-file group.json
```

## Resources with multiple type variants

Some resources support multiple configuration types in a single template output. For example, `pingcli pingone applications template` emits all four protocol variants (`oidc`, `saml`, `wsfed`, and `externalLink`) as separate top-level blocks:

```bash
pingcli pingone applications template > application.json
```

Partial output:

```json
{
  "externalLink": {
    "enabled": false,
    "homePageUrl": "",
    "name": "",
    "protocol": "",
    "type": ""
  },
  "oidc": {
    "clientId": "",
    "enabled": false,
    "grantTypes": [],
    "name": "",
    "protocol": "",
    "redirectUris": [],
    "type": ""
  },
  ...
}
```

For these resources, populate exactly one protocol block and delete the others before passing the body to `create` or `replace`. Supplying more than one block will result in an error.

## Learn more

* [pingcli pingone groups template](../command_reference/pingcli_pingone_groups_template.html)

* [pingcli pingone groups create](../command_reference/pingcli_pingone_groups_create.html)

* [pingcli pingone applications template](../command_reference/pingcli_pingone_applications_template.html)

* [Command structure](command-structure.html)

* [Managing resources](managing-resources-overview.html)
