GitHub Contents API

Repository file and directory contents.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-contents-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Contents API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:
- name: Contents
  description: Repository file and directory contents.
paths:
  /repos/{owner}/{repo}/contents/{path}:
    get:
      summary: GitHub Get Repository Content
      description: "Gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.\n\nThis endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"\n\n- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.\n- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).\n- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.\n\nIf the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value _should_ be \"submodule\". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as \"submodule\".\n\nIf the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.\n\nIf the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the github.com URLs (`html_url` and `_links[\"html\"]`) will have null values.\n\n**Notes**:\n\n- To Get repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.9/rest/git/trees#get-a-tree).\n- This API has an upper limit of 1,000 files for a directory. If you need to retrieve\nmore files, use the [Git Trees API](https://docs.github.com/enterprise-server@3.9/rest/git/trees#get-a-tree).\n- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.\n- If the requested file's size is:\n\n\n\n\n\n\n\n\n\n\n  - 1 MB or smaller: All features of this endpoint are supported.\n  - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an empty\nstring and the `encoding` field will be `\"none\"`. To get the contents of these larger files, use the `raw` media type.\n\n\n\n\n\n\n\n\n\n\n  - Greater than 100 MB: This endpoint is not supported."
      tags:
      - Contents
      operationId: getRepositoryContent
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/repos/contents#get-repository-content
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: path
        description: path parameter
        in: path
        required: true
        schema:
          type: string
        x-multi-segment: true
        examples:
          Default:
            value: README.md
        example: src/index.js
      - name: ref
        description: 'The name of the commit/branch/tag. Default: the repositorys default branch.'
        in: query
        required: false
        schema:
          type: string
        example: main
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/vnd.github.object:
              schema:
                $ref: '#/components/schemas/content-tree'
              examples:
                Default:
                  $ref: '#/components/examples/content-file-response-if-content-is-a-file'
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/content-directory'
                - $ref: '#/components/schemas/content-file'
                - $ref: '#/components/schemas/content-symlink'
                - $ref: '#/components/schemas/content-submodule'
              examples:
                Default:
                  $ref: '#/components/examples/content-file-response-if-content-is-a-file'
        '302':
          $ref: '#/components/responses/found'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: repos
        subcategory: contents
      x-api-evangelist-certified: '2025-07-16'
      x-api-naftiko-published: '2025-07-25'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        dispatcher: SCRIPT
        dispatcherRules: return "Default"
    put:
      summary: GitHub Create or Update File Contents
      description: 'Creates a new file or replaces an existing file in a repository.


        **Note:** If you use this endpoint and the "[Delete a file](https://docs.github.com/enterprise-server@3.9/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory.'
      tags:
      - Contents
      operationId: createOrUpdateFileContents
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/repos/contents#create-or-update-file-contents
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: path
        description: path parameter
        in: path
        required: true
        schema:
          type: string
        x-multi-segment: true
        examples:
          Default:
            value: README.md
        example: src/index.js
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The commit message.
                content:
                  type: string
                  description: The new file content, using Base64 encoding.
                sha:
                  type: string
                  description: '**Required if you are updating a file**. The blob SHA of the file being replaced.'
                branch:
                  type: string
                  description: 'The branch name. Default: the repositorys default branch.'
                committer:
                  type: object
                  description: 'The person that committed the file. Default: the authenticated user.'
                  properties:
                    name:
                      type: string
                      description: The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted.
                    email:
                      type: string
                      description: The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted.
                    date:
                      type: string
                      example: '"2013-01-05T13:13:22+05:00"'
                  required:
                  - name
                  - email
                author:
                  type: object
                  description: 'The author of the file. Default: The `committer` or the authenticated user if you omit `committer`.'
                  properties:
                    name:
                      type: string
                      description: The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted.
                    email:
                      type: string
                      description: The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted.
                    date:
                      type: string
                      example: '"2013-01-15T17:13:22+05:00"'
                  required:
                  - name
                  - email
              required:
              - message
              - content
            examples:
              example-for-creating-a-file:
                summary: Example for creating a file
                value:
                  message: my commit message
                  committer:
                    name: Monalisa Octocat
                    email: octocat@github.com
                  content: bXkgbmV3IGZpbGUgY29udGVudHM=
              example-for-updating-a-file:
                summary: Example for updating a file
                value:
                  message: a new commit message
                  committer:
                    name: Monalisa Octocat
                    email: octocat@github.com
                  content: bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz
                  sha: 95b966ae1c166bd92f8ae7d1c313e738c731dfc3
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file-commit'
              examples:
                Default:
                  $ref: '#/components/examples/file-commit-example-for-updating-a-file'
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file-commit'
              examples:
                Default:
                  $ref: '#/components/examples/file-commit-example-for-creating-a-file'
        '404':
          $ref: '#/components/responses/not_found'
        '409':
          $ref: '#/components/responses/conflict'
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: repos
        subcategory: contents
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        dispatcher: SCRIPT
        dispatcherRules: return "Default"
    delete:
      summary: GitHub Delete File
      description: 'Deletes a file in a repository.


        You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.


        The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user''s information is used.


        You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you''ll receive a `422` status code.


        **Note:** If you use this endpoint and the "[Create or update file contents](https://docs.github.com/enterprise-server@3.9/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.'
      tags:
      - Contents
      operationId: deleteFile
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/repos/contents#delete-a-file
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: path
        description: path parameter
        in: path
        required: true
        schema:
          type: string
        x-multi-segment: true
        examples:
          Default:
            value: README.md
        example: src/index.js
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: The commit message.
                sha:
                  type: string
                  description: The blob SHA of the file being deleted.
                branch:
                  type: string
                  description: 'The branch name. Default: the repositorys default branch'
                committer:
                  type: object
                  description: object containing information about the committer.
                  properties:
                    name:
                      type: string
                      description: The name of the author (or committer) of the commit
                    email:
                      type: string
                      description: The email of the author (or committer) of the commit
                author:
                  type: object
                  description: object containing information about the author.
                  properties:
                    name:
                      type: string
                      description: The name of the author (or committer) of the commit
                    email:
                      type: string
                      description: The email of the author (or committer) of the commit
              required:
              - message
              - sha
            examples:
              default:
                value:
                  message: my commit message
                  committer:
                    name: Monalisa Octocat
                    email: octocat@github.com
                  sha: 329688480d39049927147c162b9d2deaf885005f
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file-commit'
              examples:
                Default:
                  $ref: '#/components/examples/file-commit'
        '404':
          $ref: '#/components/responses/not_found'
        '409':
          $ref: '#/components/responses/conflict'
        '422':
          $ref: '#/components/responses/validation_failed'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: repos
        subcategory: contents
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        dispatcher: SCRIPT
        dispatcherRules: return "Default"
components:
  responses:
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    service_unavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              documentation_url:
                type: string
    conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    found:
      description: Found
    validation_failed:
      description: Validation failed, or the endpoint has been spammed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/validation-error'
  examples:
    file-commit-example-for-updating-a-file:
      value:
        content:
          name: hello.txt
          path: notes/hello.txt
          sha: a56507ed892d05a37c6d6128c260937ea4d287bd
          size: 9
          url: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
          html_url: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
          git_url: https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd
          download_url: https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt
          type: file
          _links:
            self: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
            git: https://api.github.com/repos/octocat/Hello-World/git/blobs/a56507ed892d05a37c6d6128c260937ea4d287bd
            html: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
        commit:
          sha: 18a43cd8e1e3a79c786e3d808a73d23b6d212b16
          node_id: MDY6Q29tbWl0MThhNDNjZDhlMWUzYTc5Yzc4NmUzZDgwOGE3M2QyM2I2ZDIxMmIxNg==
          url: https://api.github.com/repos/octocat/Hello-World/git/commits/18a43cd8e1e3a79c786e3d808a73d23b6d212b16
          html_url: https://github.com/octocat/Hello-World/git/commit/18a43cd8e1e3a79c786e3d808a73d23b6d212b16
          author:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          committer:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          message: my commit message
          tree:
            url: https://api.github.com/repos/octocat/Hello-World/git/trees/9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f
            sha: 9a21f8e2018f42ffcf369b24d2cd20bc25c9e66f
          parents:
          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/da5a433788da5c255edad7979b328b67d79f53f6
            html_url: https://github.com/octocat/Hello-World/git/commit/da5a433788da5c255edad7979b328b67d79f53f6
            sha: da5a433788da5c255edad7979b328b67d79f53f6
          verification:
            verified: false
            reason: unsigned
            signature: ''
            payload: ''
    file-commit-example-for-creating-a-file:
      value:
        content:
          name: hello.txt
          path: notes/hello.txt
          sha: 95b966ae1c166bd92f8ae7d1c313e738c731dfc3
          size: 9
          url: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
          html_url: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
          git_url: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3
          download_url: https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt
          type: file
          _links:
            self: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
            git: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3
            html: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
        commit:
          sha: 7638417db6d59f3c431d3e1f261cc637155684cd
          node_id: MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==
          url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd
          html_url: https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd
          author:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          committer:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          message: my commit message
          tree:
            url: https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb
            sha: 691272480426f78a0138979dd3ce63b77f706feb
          parents:
          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5
            html_url: https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5
            sha: 1acc419d4d6a9ce985db7be48c6349a0475975b5
          verification:
            verified: false
            reason: unsigned
            signature: ''
            payload: ''
    file-commit:
      value:
        content:
          name: hello.txt
          path: notes/hello.txt
          sha: 95b966ae1c166bd92f8ae7d1c313e738c731dfc3
          size: 9
          url: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
          html_url: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
          git_url: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3
          download_url: https://raw.githubusercontent.com/octocat/HelloWorld/master/notes/hello.txt
          type: file
          _links:
            self: https://api.github.com/repos/octocat/Hello-World/contents/notes/hello.txt
            git: https://api.github.com/repos/octocat/Hello-World/git/blobs/95b966ae1c166bd92f8ae7d1c313e738c731dfc3
            html: https://github.com/octocat/Hello-World/blob/master/notes/hello.txt
        commit:
          sha: 7638417db6d59f3c431d3e1f261cc637155684cd
          node_id: MDY6Q29tbWl0NzYzODQxN2RiNmQ1OWYzYzQzMWQzZTFmMjYxY2M2MzcxNTU2ODRjZA==
          url: https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd
          html_url: https://github.com/octocat/Hello-World/git/commit/7638417db6d59f3c431d3e1f261cc637155684cd
          author:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          committer:
            date: '2014-11-07T22:01:45Z'
            name: Monalisa Octocat
            email: octocat@github.com
          message: my commit message
          tree:
            url: https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb
            sha: 691272480426f78a0138979dd3ce63b77f706feb
          parents:
          - url: https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5
            html_url: https://github.com/octocat/Hello-World/git/commit/1acc419d4d6a9ce985db7be48c6349a0475975b5
            sha: 1acc419d4d6a9ce985db7be48c6349a0475975b5
          verification:
            verified: false
            reason: unsigned
            signature: ''
            payload: ''
    content-file-response-if-content-is-a-file:
      summary: Response if content is a file
      value:
        type: file
        encoding: base64
        size: 5362
        name: README.md
        path: README.md
        content: IyBZb2dhIEJvmsgaW4gcHJvZ3Jlc3MhIEZlZWwgdAoKOndhcm5pbmc6IFdvc\nZnJlZSBmUgdG8gY0byBjaGVjayBvdXQgdGhlIGFwcCwgYnV0IGJlIHN1c29t\nZSBiYWNrIG9uY2UgaXQgaXMgY29tcGxldGUuCgpBIHdlYiBhcHAgdGhhdCBs\nZWFkcyB5b3UgdGhyb3VnaCBhIHlvZ2Egc2Vzc2lvbi4KCltXb3Jrb3V0IG5v\ndyFdKGh0dHBzOi8vc2tlZHdhcmRzODguZ2l0aHViLmlvL3lvZ2EvKQoKPGlt\nZyBzcmM9InNyYy9pbWFnZXMvbWFza2FibGVfaWNvbl81MTIucG5nIiBhbHQ9\nImJvdCBsaWZ0aW5nIHdlaWdodHMiIHdpZHRoPSIxMDAiLz4KCkRvIHlvdSBo\nYXZlIGZlZWRiYWNrIG9yIGlkZWFzIGZvciBpbXByb3ZlbWVudD8gW09wZW4g\nYW4gaXNzdWVdKGh0dHBzOi8vZ2l0aHViLmNvbS9za2Vkd2FyZHM4OC95b2dh\nL2lzc3Vlcy9uZXcpLgoKV2FudCBtb3JlIGdhbWVzPyBWaXNpdCBbQ25TIEdh\nbWVzXShodHRwczovL3NrZWR3YXJkczg4LmdpdGh1Yi5pby9wb3J0Zm9saW8v\nKS4KCiMjIERldmVsb3BtZW50CgpUbyBhZGQgYSBuZXcgcG9zZSwgYWRkIGFu\nIGVudHJ5IHRvIHRoZSByZWxldmFudCBmaWxlIGluIGBzcmMvYXNhbmFzYC4K\nClRvIGJ1aWxkLCBydW4gYG5wbSBydW4gYnVpbGRgLgoKVG8gcnVuIGxvY2Fs\nbHkgd2l0aCBsaXZlIHJlbG9hZGluZyBhbmQgbm8gc2VydmljZSB3b3JrZXIs\nIHJ1biBgbnBtIHJ1biBkZXZgLiAoSWYgYSBzZXJ2aWNlIHdvcmtlciB3YXMg\ncHJldmlvdXNseSByZWdpc3RlcmVkLCB5b3UgY2FuIHVucmVnaXN0ZXIgaXQg\naW4gY2hyb21lIGRldmVsb3BlciB0b29sczogYEFwcGxpY2F0aW9uYCA+IGBT\nZXJ2aWNlIHdvcmtlcnNgID4gYFVucmVnaXN0ZXJgLikKClRvIHJ1biBsb2Nh\nbGx5IGFuZCByZWdpc3RlciB0aGUgc2VydmljZSB3b3JrZXIsIHJ1biBgbnBt\nIHN0YXJ0YC4KClRvIGRlcGxveSwgcHVzaCB0byBgbWFpbmAgb3IgbWFudWFs\nbHkgdHJpZ2dlciB0aGUgYC5naXRodWIvd29ya2Zsb3dzL2RlcGxveS55bWxg\nIHdvcmtmbG93Lgo=\n
        sha: 3d21ec53a331a6f037a91c368710b99387d012c1
        url: https://api.github.com/repos/octokit/octokit.rb/contents/README.md
        git_url: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1
        html_url: https://github.com/octokit/octokit.rb/blob/master/README.md
        download_url: https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md
        _links:
          git: https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1
          self: https://api.github.com/repos/octokit/octokit.rb/contents/README.md
          html: https://github.com/octokit/octokit.rb/blob/master/README.md
  parameters:
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
        default: naftiko
        example: naftiko
      examples:
        Default:
          value: octocat
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
        default: capabilities
        example: capabilities
      examples:
        Default:
          value: Hello-World
  schemas:
    content-directory:
      title: Content Directory
      description: list of directory items
      type: array
      items:
        type: object
        properties:
          type:
            type: string
            enum:
            - dir
            - file
            - submodule
            - symlink
          size:
            type: integer
          name:
            type: string
          path:
            type: string
          content:
            type: string
          sha:
            type: string
          url:
            type: string
            format: uri
          git_url:
            type: string
            format: uri
          html_url:
            type: string
            format: uri
          download_url:
            type: string
            format: uri
          _links:
            type: object
            properties:
              git:
                type: string
                format: uri
              html:
                type: string
                format: uri
              self:
                type: string
                format: uri
            required:
            - git
            - html
            - self
        required:
        - _links
        - git_url
        - html_url
        - download_url
        - name
        - path
        - sha
        - size
        - type
        - url
    file-commit:
      title: File Commit
      description: File Commit
      type: object
      required:
      - content
      - commit
      properties:
        content:
          type: object
          properties:
            name:
              type: string
            path:
              type: string
            sha:
              type: string
            size:
              type: integer
            url:
              type: string
            html_url:
              type: string
            git_url:
              type: string
            download_url:
              type: string
            type:
              type: string
            _links:
              type: object
              properties:
                self:
                  type: string
                git:
                  type: string
                html:
                  type: string
        commit:
          type: object
          properties:
            sha:
              type: string
            node_id:
              type: string
            url:
              type: string
            html_url:
              type: string
            author:
              type: object
              properties:
                date:
                  type: string
                name:
                  type: string
                email:
                  type: string
            committer:
              type: object
              properties:
                date:
                  type: string
                name:
                  type: string
                email:
                  type: string
            message:
              type: string
            tree:
              type: object
              properties:
                url:
                  type: string
                sha:
                  type: string
            parents:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                  html_url:
                    type: string
                  sha:
                    type: string
            verification:
              type: object
              properties:
                verified:
                  type: boolean
                reason:
                  type: string
                signature:
                  type: string
                payload:
                  type: string
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
    content-file:
      title: Content File
      description: Content File
      type: object
      properties:
        type:
          type: string
          enum:
          - file
        

# --- truncated at 32 KB (642 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-contents-api-openapi.yml