GitLab CI/CD draft_notes API

Operations about draft_notes

Operations 7

GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes #
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes #
GET /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id} #
PUT /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id} #
DELETE /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id} #
PUT /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id}/publish #
POST /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/bulk_publish #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitlab-ci-draft-notes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitlab-ci-draft-notes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab access_requests Draft Notes API
  version: v4
  description: Operations related to access requests
servers:
- url: https://gitlab.com
tags:
- name: draft_notes
  description: Operations about draft_notes
paths:
  /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes:
    get:
      description: Get a list of merge request draft notes
      parameters:
      - in: path
        name: id
        description: The ID of a project
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Get a list of merge request draft notes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/API_Entities_DraftNote'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: getApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotes
    post:
      description: Create a new draft note
      parameters:
      - in: path
        name: id
        description: The ID of a project.
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request.
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '201':
          description: Create a new draft note
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_DraftNote'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: postApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotes'
        required: true
  /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id}:
    get:
      description: Get a single draft note
      parameters:
      - in: path
        name: id
        description: The ID of a project
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: draft_note_id
        description: The ID of a draft note
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Get a single draft note
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_DraftNote'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: getApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteId
    put:
      description: Modify an existing draft note
      parameters:
      - in: path
        name: id
        description: The ID of a project.
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request.
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: draft_note_id
        description: The ID of a draft note
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Modify an existing draft note
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_DraftNote'
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: putApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteId
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/putApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteId'
        required: true
    delete:
      description: Delete a draft note
      parameters:
      - in: path
        name: id
        description: The ID of a project
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: draft_note_id
        description: The ID of a draft note
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '204':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: deleteApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteId
  /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/{draft_note_id}/publish:
    put:
      description: Publish a pending draft note
      parameters:
      - in: path
        name: id
        description: The ID of a project
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request
        required: true
        schema:
          type: integer
          format: int32
      - in: path
        name: draft_note_id
        description: The ID of a draft note
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '204':
          description: Publish a pending draft note
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: putApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteIdPublish
  /api/v4/projects/{id}/merge_requests/{merge_request_iid}/draft_notes/bulk_publish:
    post:
      description: Bulk publish all pending draft notes
      parameters:
      - in: path
        name: id
        description: The ID of a project
        required: true
        schema:
          type: string
      - in: path
        name: merge_request_iid
        description: The ID of a merge request
        required: true
        schema:
          type: integer
          format: int32
      responses:
        '204':
          description: Bulk publish all pending draft notes
        '401':
          description: Unauthorized
        '404':
          description: Not found
      tags:
      - draft_notes
      operationId: postApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesBulkPublish
components:
  schemas:
    putApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotesDraftNoteId:
      type: object
      properties:
        note:
          type: string
          description: The content of a note.
        position:
          type: object
          description: Position when creating a note
          properties:
            base_sha:
              type: string
              description: Base commit SHA in the source branch
            start_sha:
              type: string
              description: SHA referencing commit in target branch
            head_sha:
              type: string
              description: SHA referencing HEAD of this merge request
            position_type:
              type: string
              description: Type of the position reference
              enum:
              - text
              - image
              - file
            new_path:
              type: string
              description: File path after change
            new_line:
              type: integer
              format: int32
              description: Line number after change
            old_path:
              type: string
              description: File path before change
            old_line:
              type: integer
              format: int32
              description: Line number before change
            width:
              type: integer
              format: int32
              description: Width of the image
            height:
              type: integer
              format: int32
              description: Height of the image
            x:
              type: integer
              format: int32
              description: X coordinate in the image
            y:
              type: integer
              format: int32
              description: Y coordinate in the image
            line_range:
              type: object
              description: Line range for a multi-line note
              properties:
                start:
                  type: object
                  description: Start line for a multi-line note
                  properties:
                    line_code:
                      type: string
                      description: Start line code for multi-line note
                    type:
                      type: string
                      description: Start line type for multi-line note
                    old_line:
                      type: integer
                      format: int32
                      description: Start old_line line number
                    new_line:
                      type: integer
                      format: int32
                      description: Start new_line line number
                end:
                  type: object
                  description: End line for a multi-line note
                  properties:
                    line_code:
                      type: string
                      description: End line code for multi-line note
                    type:
                      type: string
                      description: End line type for multi-line note
                    old_line:
                      type: integer
                      format: int32
                      description: End old_line line number
                    new_line:
                      type: integer
                      format: int32
                      description: End new_line line number
          required:
          - base_sha
          - start_sha
          - head_sha
          - position_type
      description: Modify an existing draft note
    postApiV4ProjectsIdMergeRequestsMergeRequestIidDraftNotes:
      type: object
      properties:
        note:
          type: string
          description: The content of a note.
        in_reply_to_discussion_id:
          type: string
          description: The ID of a discussion the draft note replies to.
        commit_id:
          type: string
          description: The sha of a commit to associate the draft note to.
        resolve_discussion:
          type: boolean
          description: The associated discussion should be resolved.
        position:
          type: object
          description: Position when creating a note
          properties:
            base_sha:
              type: string
              description: Base commit SHA in the source branch
            start_sha:
              type: string
              description: SHA referencing commit in target branch
            head_sha:
              type: string
              description: SHA referencing HEAD of this merge request
            position_type:
              type: string
              description: Type of the position reference
              enum:
              - text
              - image
              - file
            new_path:
              type: string
              description: File path after change
            new_line:
              type: integer
              format: int32
              description: Line number after change
            old_path:
              type: string
              description: File path before change
            old_line:
              type: integer
              format: int32
              description: Line number before change
            width:
              type: integer
              format: int32
              description: Width of the image
            height:
              type: integer
              format: int32
              description: Height of the image
            x:
              type: integer
              format: int32
              description: X coordinate in the image
            y:
              type: integer
              format: int32
              description: Y coordinate in the image
            line_range:
              type: object
              description: Line range for a multi-line note
              properties:
                start:
                  type: object
                  description: Start line for a multi-line note
                  properties:
                    line_code:
                      type: string
                      description: Start line code for multi-line note
                    type:
                      type: string
                      description: Start line type for multi-line note
                    old_line:
                      type: integer
                      format: int32
                      description: Start old_line line number
                    new_line:
                      type: integer
                      format: int32
                      description: Start new_line line number
                end:
                  type: object
                  description: End line for a multi-line note
                  properties:
                    line_code:
                      type: string
                      description: End line code for multi-line note
                    type:
                      type: string
                      description: End line type for multi-line note
                    old_line:
                      type: integer
                      format: int32
                      description: End old_line line number
                    new_line:
                      type: integer
                      format: int32
                      description: End new_line line number
          required:
          - base_sha
          - start_sha
          - head_sha
          - position_type
      required:
      - note
      description: Create a new draft note
    API_Entities_DraftNote:
      type: object
      properties:
        id:
          type: integer
          format: int32
          example: 2
        author_id:
          type: integer
          format: int32
          example: 4
        merge_request_id:
          type: integer
          format: int32
          example: 52
        resolve_discussion:
          type: boolean
          example: true
        discussion_id:
          type: integer
          format: int32
          example: 613
        note:
          type: string
          example: This is a note
        commit_id:
          type: integer
          format: int32
          example: 4
        line_code:
          type: string
          example: 1c497fbb3a46b78edf0_2_4
        position:
          type: object
          example:
            base_sha: aa149113
            start_sha: b3a0a8c4
            head_sha: be3020c7
            old_path: example.md
            new_path: example.md
            position_type: text
            old_line: 2
            new_line: 4
            line_range:
              start:
                line_code: 1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4
                type: null
                old_line: 2
                new_line: 4
              end:
                line_code: 1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a_2_4
                type: null
                old_line: 2
                new_line: 4
      required:
      - id
      - author_id
      - merge_request_id
      - resolve_discussion
      - discussion_id
      - note
      - commit_id
      - line_code
      - position
      description: API_Entities_DraftNote model
  securitySchemes:
    access_token_header:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header
    access_token_query:
      type: apiKey
      name: private_token
      in: query