# fyi.opensocial.getTemplateUse

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getTemplateUse)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getTemplateUse/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.getTemplateUse/examples)

## Definitions

### `fyi.opensocial.getTemplateUse#barView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `days` | `integer` | Yes | For how many days. |
| `groups` | `integer` | Yes | How many groups keep it. |

### `fyi.opensocial.getTemplateUse`

**Type**: `query`

How groups on this host use a template shared with everyone, for whoever made it: counts, never which groups, and never what anyone wrote in a tab of it, which stays in each group. Groups on other hosts can't be seen. For a person's template, them; for a group's, whoever may publish for it.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | The template, its fyi.opensocial.template. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `bar` | `ref` → `#barView` | Yes | What it takes to be listed here. |
| `keptAWhile` | `integer` | Yes | Of those, the groups that have had it for as long as the bar asks. |
| `keptBy` | `integer` | Yes | Groups with a tab of it now, of any version. |
| `notNow` | `array` | Yes | Versions groups undid, and how many groups for each. |
| `tookOff` | `integer` | Yes | Groups that removed a tab of it in the last 30 days and have none now. |

#### Errors

- **NotFound**
- **Forbidden**

### `fyi.opensocial.getTemplateUse#notNowView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `groups` | `integer` | Yes |  |
| `number` | `integer` | No |  |
| `version` | `string` (cid) | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "barView": {
      "properties": {
        "days": {
          "description": "For how many days.",
          "minimum": 0,
          "type": "integer"
        },
        "groups": {
          "description": "How many groups keep it.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "groups",
        "days"
      ],
      "type": "object"
    },
    "main": {
      "description": "How groups on this host use a template shared with everyone, for whoever made it: counts, never which groups, and never what anyone wrote in a tab of it, which stays in each group. Groups on other hosts can't be seen. For a person's template, them; for a group's, whoever may publish for it.",
      "errors": [
        {
          "name": "NotFound"
        },
        {
          "name": "Forbidden"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "bar": {
              "description": "What it takes to be listed here.",
              "ref": "#barView",
              "type": "ref"
            },
            "keptAWhile": {
              "description": "Of those, the groups that have had it for as long as the bar asks.",
              "minimum": 0,
              "type": "integer"
            },
            "keptBy": {
              "description": "Groups with a tab of it now, of any version.",
              "minimum": 0,
              "type": "integer"
            },
            "notNow": {
              "description": "Versions groups undid, and how many groups for each.",
              "items": {
                "ref": "#notNowView",
                "type": "ref"
              },
              "type": "array"
            },
            "tookOff": {
              "description": "Groups that removed a tab of it in the last 30 days and have none now.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "keptBy",
            "keptAWhile",
            "tookOff",
            "notNow",
            "bar"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "uri": {
            "description": "The template, its fyi.opensocial.template.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "uri"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "notNowView": {
      "properties": {
        "groups": {
          "minimum": 1,
          "type": "integer"
        },
        "number": {
          "minimum": 1,
          "type": "integer"
        },
        "version": {
          "format": "cid",
          "type": "string"
        }
      },
      "required": [
        "version",
        "groups"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.getTemplateUse",
  "lexicon": 1
}
```
