> ## 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 an issue



## OpenAPI

````yaml POST /repos/{owner}/{repo}/issues
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}/issues:
    post:
      tags:
        - Issues
      summary: Create an issue
      operationId: createIssue
      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:
                title:
                  type: string
                body:
                  type: string
                assignee:
                  type: string
                milestone:
                  type: integer
                labels:
                  type: array
                  items:
                    type: integer
                closed:
                  type: boolean
                  default: false
              required:
                - title
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Issue'
        '404':
          description: Resource not found.
        '422':
          description: Validation error.
components:
  schemas:
    Issue:
      type: object
      properties:
        id:
          type: integer
        number:
          type: integer
        state:
          type: string
          enum:
            - open
            - closed
        title:
          type: string
        body:
          type: string
        user:
          $ref: '#/components/schemas/User'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/Label'
        assignee:
          $ref: '#/components/schemas/User'
          nullable: true
        milestone:
          $ref: '#/components/schemas/Milestone'
          nullable: true
        comments:
          type: integer
        pull_request:
          type: object
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    User:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        login:
          type: string
          description: Alias of username for GitHub API compatibility
        full_name:
          type: string
        email:
          type: string
          format: email
        avatar_url:
          type: string
    Label:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        color:
          type: string
        url:
          type: string
    Milestone:
      type: object
      properties:
        id:
          type: integer
        state:
          type: string
          enum:
            - open
            - closed
        title:
          type: string
        description:
          type: string
        open_issues:
          type: integer
        closed_issues:
          type: integer
        closed_at:
          type: string
          format: date-time
          nullable: true
        due_on:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Personal access token. Use format: token {YOUR_ACCESS_TOKEN}'

````