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

# Decline a change request

> The repo's org, but for a request from one of the repo's own branches, whoever opened it withdraws it instead. Needs the `publish` scope. Its hidden branch goes, so outside the org its commits are out of reach by id, and what it changed stays on its page. It's the way to take commits out of reach that a rewrite of the repo left there.



## OpenAPI

````yaml /api-reference/openapi.json post /projects/{owner}/{slug}/change-requests/{number}/decline
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /projects/{owner}/{slug}/change-requests/{number}/decline:
    post:
      tags:
        - Change requests
      summary: Decline a change request
      description: >-
        The repo's org, but for a request from one of the repo's own branches,
        whoever opened it withdraws it instead. Needs the `publish` scope. Its
        hidden branch goes, so outside the org its commits are out of reach by
        id, and what it changed stays on its page. It's the way to take commits
        out of reach that a rewrite of the repo left there.
      parameters:
        - schema:
            type: string
            example: patch
          required: true
          name: owner
          in: path
        - schema:
            type: string
            example: demo-mod
          required: true
          name: slug
          in: path
        - schema:
            type: integer
            minimum: 1
            example: 12
          required: true
          name: number
          in: path
      responses:
        '200':
          description: Declined
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeRequest'
        '308':
          description: Renamed; follow the Location header
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The request isn't open
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    ChangeRequest:
      type: object
      properties:
        number:
          type: integer
          example: 12
        title:
          type: string
          example: Port to 26.5
        description:
          type: string
        state:
          type: string
          enum:
            - open
            - merged
            - declined
            - withdrawn
          description: >-
            open: waiting on the repo's owner. merged: its commits are in the
            branch it was for. declined: the owner turned it down. withdrawn:
            its author took it back.
        from:
          type:
            - string
            - 'null'
          description: >-
            The repo its branch is in, as owner/slug: the fork it comes from, or
            this repo itself for one of its own branches. Null if you can't
            reach the fork.
          example: kai/sky-mod
        branch:
          type: string
          description: The branch it offers, in `from`
          example: port-26.5
        into:
          type: string
          description: The branch it would change in this repo
          example: '26.5'
        head_commit:
          type: string
          description: >-
            Its latest commit, as copied into this repo, where a clone doesn't
            see it: `git fetch <clone_url> <head_commit>` gets its commits while
            it's open.
        problems:
          type: array
          items:
            type: string
          description: >-
            What stopped the latest push to its branch being copied, which stays
            out of the request until it's fixed: a refusal, a fork that isn't
            open, which copies when it opens, or a copy that failed, which a new
            push tries again. Empty says nothing has stopped one, and a copy may
            still be on its way.
        author:
          type:
            - string
            - 'null'
          description: 'Who opened it: their username'
          example: kai
        talk_count:
          type: integer
          description: Posts in its talk
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_by:
          type:
            - string
            - 'null'
          description: 'Who merged, declined or withdrew it: their username'
        merge_commit:
          type:
            - string
            - 'null'
          description: The commit its branch was at after the merge.
      required:
        - number
        - title
        - description
        - state
        - from
        - branch
        - into
        - head_commit
        - problems
        - author
        - talk_count
        - created_at
        - updated_at
        - closed_at
        - closed_by
        - merge_commit
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key (pch_...) or the token from pch login.

````

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