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

# Create a tag

> Creates a lightweight tag as if it were pushed, which fires the `create` webhook.



## OpenAPI

````yaml POST /repos/{owner}/{repo}/tags
openapi: 3.0.3
info:
  title: Gogs API
  version: v1
  description: >-
    RESTful API for interacting with your Gogs instance. Follows a format
    similar to the GitHub REST API v3.
servers:
  - url: https://gogs.example.com/api/v1
security:
  - AccessToken: []
tags:
  - name: Repositories
    description: Create, search, and manage repositories, branches, commits, and contents
  - name: Collaborators and Deploy Keys
    description: Manage repository collaborators and deploy keys
  - name: Releases
    description: List repository releases
  - name: Webhooks
    description: Create, edit, and delete repository webhooks
  - name: Issues
    description: Manage issues, comments, labels, and milestones
  - name: Users
    description: Search users, manage access tokens, emails, followers, and public keys
  - name: Organizations
    description: Manage organizations, members, and teams
  - name: Administration
    description: Site administration endpoints (requires admin privileges)
  - name: Miscellaneous
    description: Markdown rendering and Git data endpoints
paths:
  /repos/{owner}/{repo}/tags:
    post:
      tags:
        - Repositories
      summary: Create a tag
      description: >-
        Creates a lightweight tag as if it were pushed, which fires the `create`
        webhook.
      operationId: createTag
      parameters:
        - name: owner
          in: path
          required: true
          schema:
            type: string
          description: Repository owner
        - name: repo
          in: path
          required: true
          schema:
            type: string
          description: Repository name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the new tag
                  example: v1.0.0
                target:
                  type: string
                  description: >-
                    Branch, tag, or commit SHA to point at. Defaults to the
                    default branch.
              required:
                - name
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tag'
        '403':
          description: No write access to the repository, or the repository is a mirror.
        '404':
          description: Resource not found.
        '422':
          description: >-
            Invalid tag name, the tag already exists, or the target does not
            exist.
components:
  schemas:
    Tag:
      type: object
      properties:
        name:
          type: string
        commit:
          type: object
          properties:
            id:
              type: string
            message:
              type: string
            url:
              type: string
            author:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                username:
                  type: string
            committer:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                username:
                  type: string
            timestamp:
              type: string
              format: date-time
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Personal access token. Use format: token {YOUR_ACCESS_TOKEN}'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.