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

# Create a draft GitHub Security Advisory

> Requires reports:triage and a SuperAdmin or StandardAdmin role for the report. The report must be accepted or closed and the chosen repository must be enabled for its organization. The GitHub App installation requires Repository security advisories write permission. Hackrate derives severity and CWE from the report and adds an internal timeline comment after creation. Each POST can create a draft. Check the GitHub repository for the draft before retrying a request with an uncertain outcome.



## OpenAPI

````yaml /openapi/external-admin-2026-11-25.json post /reports/{id}/github/advisories
openapi: 3.0.3
info:
  title: Hackrate External Admin API
  version: API-2026-11-25
  description: >-
    Program discovery and report triage for users with assigned Hackrate roles.
    Tokens are created in Profile Settings > External API. This release adds
    GitHub repository discovery, report advisory references, and draft advisory
    creation. Existing reports:triage tokens can discover repositories and
    create drafts when their owner has the required administrator role. Both
    releases use /api/v1/admin. [Compare API
    versions](/companies/integrations/external-api#api-versions).
servers:
  - url: https://www.hckrt.com/api/v1/admin
security:
  - personalToken: []
paths:
  /reports/{id}/github/advisories:
    parameters:
      - $ref: '#/components/parameters/reportId'
    post:
      summary: Create a draft GitHub Security Advisory
      description: >-
        Requires reports:triage and a SuperAdmin or StandardAdmin role for the
        report. The report must be accepted or closed and the chosen repository
        must be enabled for its organization. The GitHub App installation
        requires Repository security advisories write permission. Hackrate
        derives severity and CWE from the report and adds an internal timeline
        comment after creation. Each POST can create a draft. Check the GitHub
        repository for the draft before retrying a request with an uncertain
        outcome.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitHubAdvisoryInput'
            example:
              repoId: 123456789
              summary: Access control issue in example-project
              description: >-
                Version 2.0.0 corrects an access control issue in
                example-project.
              ecosystem: npm
              packageName: example-project
              affectedVersions: < 2.0.0
              patchedVersions: 2.0.0
      responses:
        '201':
          description: Draft advisory created in GitHub
          headers:
            Location:
              description: GitHub repository advisory URL.
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitHubAdvisoryCreated'
              example:
                ghsaId: GHSA-2345-6789-CFGH
                url: >-
                  https://github.com/example/project/security/advisories/GHSA-2345-6789-CFGH
                state: draft
                timelineCommentRecorded: true
        '400':
          description: Missing or invalid advisory fields
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: >-
            Insufficient role or token scope, or the repository is unavailable
            for this report
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: The report is neither accepted nor closed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '422':
          description: GitHub rejected the advisory fields
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          description: Hackrate could not confirm creation with GitHub
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  parameters:
    reportId:
      name: id
      in: path
      required: true
      schema:
        type: integer
  schemas:
    GitHubAdvisoryInput:
      type: object
      required:
        - repoId
        - summary
        - description
        - ecosystem
        - packageName
        - affectedVersions
        - patchedVersions
      properties:
        repoId:
          type: integer
          format: int64
          minimum: 1
        summary:
          type: string
          minLength: 1
        description:
          type: string
          minLength: 1
        ecosystem:
          type: string
          enum:
            - rubygems
            - npm
            - pip
            - maven
            - nuget
            - composer
            - go
            - rust
            - erlang
            - actions
            - pub
            - swift
            - other
          description: Package ecosystem. Case is ignored.
        packageName:
          type: string
          minLength: 1
        affectedVersions:
          type: string
          minLength: 1
        patchedVersions:
          type: string
          minLength: 1
        reporterGithubLogin:
          type: string
          nullable: true
          description: GitHub account to credit as the reporter. A leading @ is optional.
        startPrivateFork:
          type: boolean
          default: false
          description: Ask GitHub to create a temporary private fork for remediation.
    GitHubAdvisoryCreated:
      type: object
      required:
        - ghsaId
        - url
        - state
        - timelineCommentRecorded
      properties:
        ghsaId:
          type: string
        url:
          type: string
          format: uri
          description: GitHub repository advisory URL.
        state:
          type: string
          example: draft
        timelineCommentRecorded:
          type: boolean
          description: >-
            True when Hackrate recorded the internal timeline comment. A false
            value still confirms that GitHub created the draft.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
  responses:
    Unauthorized:
      description: Missing, invalid, expired, or revoked token
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    NotFound:
      description: Resource not found or outside the token owner's access
    RateLimited:
      description: Per-token limit of 120 requests per minute exceeded
  securitySchemes:
    personalToken:
      type: http
      scheme: bearer
      bearerFormat: hckrt_pat token

````

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