Twitch Charity API

Retrieve charity campaign information

Documentation

Specifications

Other Resources

OpenAPI Specification

twitch-charity-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twitch Drops Ads Charity API
  description: APIs for game developers to create and manage Drops campaigns that grant in-game rewards to Twitch viewers watching streamers play their game. Drops campaigns are managed through the Twitch Developer Console and fulfilled via the Helix API entitlements endpoints.
  version: '1.0'
  contact:
    name: Twitch Developer Support
    url: https://dev.twitch.tv/support/
  termsOfService: https://www.twitch.tv/p/legal/terms-of-service/
servers:
- url: https://api.twitch.tv/helix
  description: Twitch Helix API Production
security:
- oauth2: []
tags:
- name: Charity
  description: Retrieve charity campaign information
paths:
  /charity/campaigns:
    get:
      operationId: getCharityCampaign
      summary: Twitch Get Charity Campaign
      description: Gets information about the broadcaster's active charity campaign.
      tags:
      - Charity
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: broadcaster_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Charity campaign returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CharityCampaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unauthorized:
      description: Authentication required or token is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    CharityCampaign:
      type: object
      properties:
        id:
          type: string
        broadcaster_id:
          type: string
        broadcaster_login:
          type: string
        broadcaster_name:
          type: string
        charity_name:
          type: string
        charity_description:
          type: string
        charity_logo:
          type: string
        charity_website:
          type: string
        current_amount:
          type: object
          properties:
            value:
              type: integer
            decimal_places:
              type: integer
            currency:
              type: string
        target_amount:
          type: object
          properties:
            value:
              type: integer
            decimal_places:
              type: integer
            currency:
              type: string
    Error:
      type: object
      properties:
        error:
          type: string
        status:
          type: integer
        message:
          type: string
  parameters:
    clientId:
      name: Client-Id
      in: header
      required: true
      schema:
        type: string
      description: Your registered application's client ID
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://id.twitch.tv/oauth2/token
          scopes: {}
externalDocs:
  description: Twitch Drops Documentation
  url: https://dev.twitch.tv/docs/drops/