GitHub Subscriptions API

The Subscriptions API from GitHub — 2 operation(s) for subscriptions.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
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-subscriptions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Subscriptions API
  version: 1.1.4
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  description: 'Operations tagged Subscriptions across 3 of this provider''s published API definitions: github-notifications-openapi.yml, github-repo-subscription-api-openapi.yml, github-repo-tags-api-openapi.yml. Each path carries the servers of the definition it was published in.'
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
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Subscriptions
paths:
  /notifications/threads/{thread_id}/subscription:
    get:
      summary: GitHub Get Thread Subscription for the Authenticated User
      description: 'This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.9/rest/activity/watching#get-a-repository-subscription).


        Note that subscriptions are only generated if a user is participating in a conversation--for example, they''ve replied to the thread, were **@mentioned**, or manually subscribe to a thread.'
      tags:
      - Subscriptions
      operationId: getThreadSubscriptionForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/thread-id'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thread-subscription'
              examples:
                default:
                  $ref: '#/components/examples/thread-subscription'
        '304':
          $ref: '#/components/responses/not_modified'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: notifications
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Thread Subscription
      description: 'If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.


        You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.


        Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#delete-a-thread-subscription) endpoint.'
      tags:
      - Subscriptions
      operationId: setThreadSubscription
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#set-a-thread-subscription
      parameters:
      - $ref: '#/components/parameters/thread-id'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                ignored:
                  description: Whether to block all notifications from a thread.
                  default: false
                  type: boolean
              type: object
            examples:
              default:
                value:
                  ignored: false
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thread-subscription'
              examples:
                default:
                  $ref: '#/components/examples/thread-subscription'
        '304':
          $ref: '#/components/responses/not_modified'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: notifications
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete Thread Subscription
      description: Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`.
      tags:
      - Subscriptions
      operationId: deleteThreadSubscription
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#delete-a-thread-subscription
      parameters:
      - $ref: '#/components/parameters/thread-id'
      responses:
        '204':
          description: Response
        '304':
          $ref: '#/components/responses/not_modified'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: notifications
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    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
  /repos/{owner}/{repo}/subscription:
    get:
      summary: GitHub Get Repository Subscription
      description: Gets information about whether the authenticated user is subscribed to the repository.
      tags:
      - Subscriptions
      operationId: getRepositorySubscription
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/watching#get-a-repository-subscription
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - 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: if you subscribe to the repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/repository-subscription'
              examples:
                response-if-you-subscribe-to-the-repository:
                  $ref: '#/components/examples/repository-subscription-response-if-you-subscribe-to-the-repository'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          description: Not Found if you don't subscribe to the repository
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: watching
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Repository Subscription
      description: If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/enterprise-server@3.9/rest/activity/watching#delete-a-repository-subscription) completely.
      tags:
      - Subscriptions
      operationId: setRepositorySubscription
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/watching#set-a-repository-subscription
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - 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: false
        content:
          application/json:
            schema:
              type: object
              properties:
                subscribed:
                  type: boolean
                  description: Determines if notifications should be received from this repository.
                ignored:
                  type: boolean
                  description: Determines if all notifications should be blocked from this repository.
            examples:
              default:
                value:
                  subscribed: true
                  ignored: false
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/repository-subscription'
              examples:
                default:
                  $ref: '#/components/examples/repository-subscription'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: watching
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete Repository Subscription
      description: This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/enterprise-server@3.9/rest/activity/watching#set-a-repository-subscription).
      tags:
      - Subscriptions
      operationId: deleteRepositorySubscription
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/activity/watching#delete-a-repository-subscription
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - 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:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: activity
        subcategory: watching
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
components:
  responses:
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    not_modified:
      description: Not modified
    requires_authentication:
      description: Requires authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  parameters:
    thread-id:
      name: thread_id
      description: The unique identifier of the notification thread. This corresponds to the value returned in the `id` field when you retrieve notifications (for example with the [`GET /notifications` operation](https://docs.github.com/enterprise-server@3.9/rest/activity/notifications#list-notifications-for-the-authenticated-user)).
      in: path
      required: true
      schema:
        type: integer
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    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
  schemas:
    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
    thread-subscription:
      title: Thread Subscription
      description: Thread Subscription
      type: object
      properties:
        subscribed:
          type: boolean
          example: true
        ignored:
          type: boolean
          example: true
        reason:
          type:
          - string
          - 'null'
          example: example_value
        created_at:
          type:
          - string
          - 'null'
          format: date-time
          example: '2012-10-06T21:34:12Z'
        url:
          type: string
          format: uri
          example: https://api.github.com/notifications/threads/1/subscription
        thread_url:
          type: string
          format: uri
          example: https://api.github.com/notifications/threads/1
        repository_url:
          type: string
          format: uri
          example: https://api.github.com/repos/1
      required:
      - created_at
      - ignored
      - reason
      - url
      - subscribed
    repository-subscription:
      title: Repository Invitation
      description: Repository invitations let you manage who you collaborate with.
      type: object
      properties:
        subscribed:
          description: Determines if notifications should be received from this repository.
          type: boolean
          example: true
        ignored:
          description: Determines if all notifications should be blocked from this repository.
          type: boolean
          example: true
        reason:
          type: string
          example: example_value
        created_at:
          type: string
          format: date-time
          example: '2012-10-06T21:34:12Z'
        url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/example/subscription
        repository_url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/example
      required:
      - created_at
      - ignored
      - reason
      - subscribed
      - url
      - repository_url
  examples:
    thread-subscription:
      value:
        subscribed: true
        ignored: false
        reason: null
        created_at: '2012-10-06T21:34:12Z'
        url: https://api.github.com/notifications/threads/1/subscription
        thread_url: https://api.github.com/notifications/threads/1
    repository-subscription:
      value:
        subscribed: true
        ignored: false
        reason: ''
        created_at: '2012-10-06T21:34:12Z'
        url: https://api.github.com/repos/octocat/example/subscription
        repository_url: https://api.github.com/repos/octocat/example
    repository-subscription-response-if-you-subscribe-to-the-repository:
      value:
        subscribed: true
        ignored: false
        reason: ''
        created_at: '2012-10-06T21:34:12Z'
        url: https://api.github.com/repos/octocat/example/subscription
        repository_url: https://api.github.com/repos/octocat/example
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/
x-refined-from:
- github-notifications-openapi.yml
- github-repo-subscription-api-openapi.yml
- github-repo-tags-api-openapi.yml