> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# createTag()

> Create a lightweight tag pointing to a specific commit.

<CodeGroup>
  ```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  const tag = await repo.createTag({
    name: 'v1.0.0',
    target: 'abc123def456...', // commit SHA to tag
  });

  console.log(tag.name); // 'v1.0.0'
  console.log(tag.sha); // resolved SHA
  ```

  ```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  tag = await repo.create_tag(
      name="v1.0.0",
      target="abc123def456...",  # commit SHA to tag
  )

  print(tag["name"])  # 'v1.0.0'
  print(tag["sha"])   # resolved SHA
  ```

  ```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
  // Create a tag
  tag, err := repo.CreateTag(context.Background(), storage.CreateTagOptions{
  	Name:   "v1.0.0",
  	Target: "abc123def456...",
  })

  fmt.Println(tag.Name) // v1.0.0
  fmt.Println(tag.SHA)  // resolved SHA
  ```
</CodeGroup>

Tag names must not start with `refs/` — the SDK handles ref resolution automatically.

## Options

<ParamField path="name" type="string" required>
  Tag name (e.g. `v1.0.0`). Must not start with `refs/`.
</ParamField>

<ParamField path="target" type="string" required>
  Commit SHA the tag should point to.
</ParamField>

<ParamField path="refPolicies" type="object[]">
  Ordered per-ref policy rules (`{ pattern, ops? }`) embedded in the per-call JWT. First match wins. Python: `ref_policies`. Go: `RefPolicies` with type `storage.RefPolicyList`. See the [Branch Protection guide](/docs/guides/branch-protection).
</ParamField>

## Response

<ResponseField name="name" type="string">
  The created tag name
</ResponseField>

<ResponseField name="sha" type="string">
  The resolved commit SHA the tag points to
</ResponseField>

<ResponseField name="message" type="string">
  Confirmation message from the API
</ResponseField>
