Wowza usage API

Operations related to stream target analytics, including CDN usage and viewer data.

OpenAPI Specification

wowza-usage-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Wowza Streaming Engine REST advanced_token_authentication usage API
  description: Complete REST API for Wowza Streaming Engine. Auto-converted from Swagger 1.2 (http://localhost:8089/swagger.json) to OpenAPI 3.0.3 for public documentation.
  version: 2.0.0
  contact:
    name: Wowza Media Systems
    url: https://www.wowza.com/docs/wowza-streaming-engine-rest-api
  license:
    name: Wowza Media Systems
    url: https://www.wowza.com
servers:
- url: http://localhost:8087
  description: Wowza Streaming Engine Server
security:
- basicAuth: []
tags:
- name: usage
  description: Operations related to stream target analytics, including CDN usage and viewer data.
  x-displayName: Stream Targets
paths:
  /usage/stream_targets:
    get:
      summary: Fetch usage for all stream targets
      description: '(Available from version 1.4) This operation returns detailed CDN usage data for all stream targets in the account. Defaults: from = last billing date, to = end of current day.'
      operationId: usageStreamTargetsIndex
      tags:
      - usage
      x-codeSamples:
      - lang: Shell
        source: "// Using cURL\ncurl -H \"Authorization: Bearer ${WV_JWT}\" \\\n  \n  -H \"Content-Type: application/json\" \\\n  -X \"GET\" \\\n  \"${WV_HOST}/api/v2.0/usage/stream_targets\"\n"
      - lang: JavaScript
        source: "// Using Node.js\nconst https = require('https');\nconst crypto = require('crypto');\nvar hostname = 'api.video.wowza.com'\nvar path = '/api/v2.0/usage/stream_targets';\n//For security, never reveal API token in client-side code\nvar wvJWT = 'Bearer [your JWT]';\n\nconst options = {\n  hostname: hostname,\n  path: path,\n  headers: {\n    'Authorization': wvJWT,\n    'Content-Type': 'application/json'\n  }\n};\nhttps.get(options, function(res) {\n  var body = '';\n  res.on('data', function(data){\n    body += data;\n  });\n  res.on('end', function() {\n    console.log(JSON.parse(body));\n  });\n}).on('error', function(e) {\n  console.log(e.message);\n});\n"
      parameters:
      - name: from
        in: query
        required: false
        description: 'The start of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **from** query parameter without setting the **to** query parameter, the data returned will reflect 90 days starting at the **from** date, or data up to to the current day, whichever is shorter. T


          You can also specify **last_bill_date**.


          **Default**: last billing date'
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        required: false
        description: 'The end of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **to** query parameter without setting the **from** query parameter, the data returned will be from the past 90 days or from your last invoice date, whichever is shorter.


          You can also specify **last_bill_date**.


          **Default**: end of the current day'
        schema:
          type: string
          format: date-time
      - $ref: '#/components/parameters/next_page_key'
      - $ref: '#/components/parameters/per_page_2.0'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/usage_stream_targets'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '410':
          description: Gone
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error410'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error422'
  /usage/stream_targets/{id}:
    get:
      summary: Fetch usage for a single stream target
      description: '(Available from version 1.4) This operation returns CDN usage details for a specific stream target. Defaults: from = last billing date, to = end of current day.'
      operationId: showUsageStreamTarget
      tags:
      - usage
      x-codeSamples:
      - lang: Shell
        source: "// Using cURL\ncurl -H \"Authorization: Bearer ${WV_JWT}\" \\\n  \n  -H \"Content-Type: application/json\" \\\n  -X \"GET\" \\\n  \"${WV_HOST}/api/v2.0/usage/stream_targets/2adffc17\"\n"
      - lang: JavaScript
        source: "// Using Node.js\nconst https = require('https');\nconst crypto = require('crypto');\nvar hostname = 'api.video.wowza.com'\nvar path = '/api/v2.0/usage/stream_targets/2adffc17';\n//For security, never reveal API token in client-side code\nvar wvJWT = 'Bearer [your JWT]';\n\nconst options = {\n  hostname: hostname,\n  path: path,\n  headers: {\n    'Authorization': wvJWT,\n    'Content-Type': 'application/json'\n  }\n};\nhttps.get(options, function(res) {\n  var body = '';\n  res.on('data', function(data){\n    body += data;\n  });\n  res.on('end', function() {\n    console.log(JSON.parse(body));\n  });\n}).on('error', function(e) {\n  console.log(e.message);\n});\n"
      parameters:
      - name: id
        in: path
        required: true
        description: The unique alphanumeric string that identifies the stream target.
        schema:
          type: string
      - name: from
        in: query
        required: false
        description: 'The start of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **from** query parameter without setting the **to** query parameter, the data returned will reflect 90 days starting at the **from** date, or data up to to the current day, whichever is shorter.


          You can also specify **last_bill_date**.


          **Default**: last billing date'
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        required: false
        description: 'The end of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **to** query parameter without setting the **from** query parameter, the data returned will be from the past 90 days or from your last invoice date, whichever is shorter.


          You can also specify **last_bill_date**.


          **Default**: end of the current day'
        schema:
          type: string
          format: date-time
      - name: include
        in: query
        required: false
        description: 'Specify the data you want returned in the response. You can send a comma-separated list of values.


          Valid value is: **trend**.


          Example:

          **trend**'
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/usage_stream_target'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '410':
          description: Gone
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error410'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error422'
  /usage/stream_targets/summary:
    get:
      summary: Fetch stream target usage summary
      description: '(Available from version 1.4) This operation returns a summary of CDN usage for all stream targets in the account. Defaults: from = last billing date, to = end of current day.'
      operationId: summmaryUsageStreamTarget
      tags:
      - usage
      x-codeSamples:
      - lang: Shell
        source: "// Using cURL\ncurl -H \"Authorization: Bearer ${WV_JWT}\" \\\n  \n  -H \"Content-Type: application/json\" \\\n  -X \"GET\" \\\n  \"${WV_HOST}/api/v2.0/usage/stream_targets/summary\"\n"
      - lang: JavaScript
        source: "// Using Node.js\nconst https = require('https');\nconst crypto = require('crypto');\nvar hostname = 'api.video.wowza.com'\nvar path = '/api/v2.0/usage/stream_targets/summary';\n//For security, never reveal API token in client-side code\nvar wvJWT = 'Bearer [your JWT]';\n\nconst options = {\n  hostname: hostname,\n  path: path,\n  headers: {\n    'Authorization': wvJWT,\n    'Content-Type': 'application/json'\n  }\n};\nhttps.get(options, function(res) {\n  var body = '';\n  res.on('data', function(data){\n    body += data;\n  });\n  res.on('end', function() {\n    console.log(JSON.parse(body));\n  });\n}).on('error', function(e) {\n  console.log(e.message);\n});\n"
      parameters:
      - name: from
        in: query
        required: false
        description: 'The start of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **from** query parameter without setting the **to** query parameter, the data returned will reflect 90 days starting at the **from** date, or data up to to the current day, whichever is shorter.


          You can also specify **last_bill_date**.


          **Default**: last billing date'
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        required: false
        description: 'The end of the range of time you want to view. Specify **YYYY-MM-DD HH:00:00** where **HH** is a 24-hour clock in UTC. The range doesn''t include minutes and seconds and rounds minutes up to the hour. The maximum difference between **from** and **to** is 90 days. If you set the **to** query parameter without setting the **from** query parameter, the data returned will be from the past 90 days or from your last invoice date, whichever is shorter.


          You can also specify **last_bill_date**.


          **Default**: end of the current day'
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/usage_stream_target_summary'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
        '410':
          description: Gone
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error410'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error422'
components:
  schemas:
    Error403:
      type: object
      description: ''
      required:
      - meta
      properties:
        meta:
          type: object
          title: meta
          description: ''
          properties:
            status:
              type: integer
              description: ''
              example: ''
              format: int32
            code:
              type: string
              description: ''
              example: ''
            title:
              type: string
              description: ''
              example: ''
            message:
              type: string
              description: ''
              example: ''
            description:
              type: string
              description: ''
              example: ''
            links:
              type: array
              description: ''
              example: ''
              items: {}
      example:
        Example Response 1:
          meta:
            status: 403
            code: ERR-403-RecordUnaccessible
            title: Record Unaccessible Error
            message: The requested resource isn't accessible.
            description: ''
            links: []
    Error401:
      type: object
      description: ''
      required:
      - meta
      properties:
        meta:
          type: object
          title: meta
          description: ''
          properties:
            status:
              type: integer
              description: ''
              example: ''
              format: int32
            code:
              type: string
              description: ''
              example: ''
            title:
              type: string
              description: ''
              example: ''
            message:
              type: string
              description: ''
              example: ''
            description:
              type: string
              description: ''
              example: ''
            links:
              type: array
              description: ''
              example: ''
              items: {}
      example:
        Example Response 1:
          meta:
            status: 401
            code: ERR-401-NoApiKey
            title: No API Key Error
            message: No API key sent in header.
            description: ''
            links: []
        Example Response 2:
          meta:
            status: 401
            code: ERR-401-NoAccessKey
            title: No Access Key Error
            message: No access key sent in header.
            description: ''
            links: []
        Example Response 3:
          meta:
            status: 401
            code: ERR-401-InvalidApiKey
            title: Invalid Api Key Error
            message: Invalid API key.
            description: ''
            links: []
        Example Response 4:
          meta:
            status: 401
            code: ERR-401-InvalidAccessKey
            title: Invalid Access Key Error
            message: Invalid access key.
            description: ''
            links: []
        Example Response 5:
          meta:
            status: 401
            code: ERR-401-BadAccountStatus
            title: Bad Account Status Error
            message: Your account's status doesn't allow this action.
            description: ''
            links: []
        Example Response 6:
          meta:
            status: 401
            code: ERR-401-FeatureNotEnabled
            title: Feature Not Enabled Error
            message: This feature isn't enabled.
            description: ''
            links: []
        Example Response 7:
          meta:
            status: 401
            code: ERR-401-TrialExceeded
            title: Bad Billing Status Error
            message: Your billing status needs attention. You can't start or add live streams until your billing status is updated.
            description: ''
            links: []
        Example Response 8:
          meta:
            status: 401
            code: ERR-401-ExpiredToken
            title: JWT is expired
            message: Token has exired.
            description: ''
            links: []
        Example Response 9:
          meta:
            status: 401
            code: ERR-401-InvalidToken
            title: JWT is invalid
            message: Token is invalid.
            description: ''
            links: []
    usage_stream_target_summary:
      type: object
      description: ''
      properties:
        summary:
          type: object
          title: summary
          description: ''
          properties:
            viewing_seconds:
              type: integer
              description: The total length of time, in seconds, that the stream was played at the target. May be longer than the duration of the stream.
              example: ''
              format: int32
            viewing_bytes:
              type: integer
              description: The amount of content, in bytes, that went through the stream target during the selected time frame.
              example: ''
              format: int32
            zones:
              type: object
              title: Hash of zones
              description: A hash of zones with CDN usage, keyed by the name of the billing zone where the usage was generated.
              properties:
                name:
                  type: string
                  description: The name of the billing zone where the usage was generated.
                  example: ''
                viewing_bytes:
                  type: integer
                  description: The amount of content, in bytes, that went through the stream target during the selected time frame.
                  example: ''
                  format: int32
                type:
                  type: string
                  description: The type of stream target. <br/> **fastly** is a Wowza CDN on Fastly target.
                  example: ''
                  enum:
                  - fastly
        limits:
          type: object
          description: The time frame represented in the response.
          properties:
            from:
              type: string
              description: The start of the range of time represented in the response.
              example: ''
              format: date-time
            to:
              type: string
              description: The end of the range of time represented in the response.
              example: ''
              format: date-time
      example:
        summary:
          viewing_seconds: 67925498
          viewing_bytes: 22886
          zones:
          - name: global
            type: fastly
            viewing_bytes: 12886
        limits:
          from: '2019-11-07T00:00:00.000Z'
          to: '2019-12-05T00:00:00.000Z'
    usage_stream_target:
      type: object
      description: ''
      properties:
        stream_target:
          type: object
          title: stream_target
          description: ''
          properties:
            id:
              type: string
              description: The unique alphanumeric string that identifies the stream target.
              format: int32
            name:
              type: string
              description: A descriptive name for the stream target. Maximum 255 characters.
              example: ''
            archived:
              type: boolean
              description: A value of **true** indicates that the stream target has been removed from Wowza Video.
            type:
              type: string
              description: The type of stream target. <br/> **fastly** is a Wowza CDN on Fastly target.
              example: ''
              enum:
              - fastly
            viewing_seconds:
              type: integer
              description: The total length of time, in seconds, that the stream was played at the target. May be longer than the duration of the stream.
              example: ''
              format: int32
            viewing_bytes:
              type: integer
              description: The amount of content, in bytes, that went through the stream target during the selected time frame.
              example: ''
              format: int32
            trend:
              type: object
              title: Array of viewer trends
              description: 'An array of viewer trend data. The granularity of sampled data changes based on the from and to query values you use:


                Requests made for data within the past 30 days, return the following sample intervals: <ul><li>0 minutes to 3 hours - Samples returned per minute</li> <li>3 hours, 1 second to 24 hours - Samples returned per hour</li> <li>24 hours, 1 second to 90 days - Samples returned per day</li></ul>


                <strong>Defaults</strong>: from = last billing date, to = end of current day'
              properties:
                sampled_at:
                  type: string
                  description: The date and time the trend data was sampled.
                  format: date-time
                viewing_seconds:
                  type: integer
                  description: The total length of time, in seconds, that the stream was played at the target. May be longer than the duration of the stream.
                  example: ''
                  format: int32
                viewing_bytes:
                  type: integer
                  description: The amount of content, in bytes, that went through the transcoder during the selected time frame.
                  example: ''
                  format: int32
            zones:
              type: object
              title: Hash of zones
              description: A hash of zones with CDN usage, keyed by the name of the billing zone where the usage was generated.
              properties:
                name:
                  type: string
                  description: The name of the billing zone where the usage was generated.
                  example: ''
                viewing_bytes:
                  type: integer
                  description: The amount of content, in bytes, that went through the stream target during the selected time frame.
                  example: ''
                  format: int32
                type:
                  type: string
                  description: The type of stream target. <br/> **fastly** is a Wowza CDN on Fastly target.
                  example: ''
                  enum:
                  - fastly
        limits:
          type: object
          description: The time frame represented in the response.
          properties:
            from:
              type: string
              description: The start of the range of time represented in the response.
              example: ''
              format: date-time
            to:
              type: string
              description: The end of the range of time represented in the response.
              example: ''
              format: date-time
      example:
        stream_target:
          id: tvctq36g
          name: My Stream Target
          archived: true
          type: fastly
          viewing_seconds: 44925498
          viewing_bytes: 22886
          trend:
          - sampled_at: '2019-10-01T08:00:00.000Z'
            viewing_seconds: 45
            viewing_bytes: 20
          zones:
          - name: global
            type: fastly
            viewing_bytes: 22886
        limits:
          from: '2019-11-07T00:00:00.000Z'
          to: '2019-12-05T00:00:00.000Z'
    Error422:
      type: object
      description: ''
      required:
      - meta
      properties:
        meta:
          type: object
          title: meta
          description: ''
          properties:
            status:
              type: integer
              description: ''
              example: ''
              format: int32
            code:
              type: string
              description: ''
              example: ''
            title:
              type: string
              description: ''
              example: ''
            message:
              type: string
              description: ''
              example: ''
            description:
              type: string
              description: ''
              example: ''
            links:
              type: array
              description: ''
              example: ''
              items: {}
      example:
        Example Response 1:
          meta:
            status: 422
            code: ERR-422-RecordInvalid
            title: Record Invalid Error
            message: The request couldn't be processed. ... can't be blank
            description: ''
            links: []
        Example Response 2:
          meta:
            status: 422
            code: ERR-422-RecordInvalid
            title: Record Invalid Error
            message: The request couldn't be processed. Provider wowza_video is not allowed
            description: ''
            links: []
        Example Response 3:
          meta:
            status: 422
            code: ERR-422-InvalidStateChange
            title: Invalid State Change Error
            message: The request couldn't be processed. There must be at least one WebRTC output for this transcoder.
            description: ''
            links: []
        Example Response 4:
          meta:
            status: 422
            code: ERR-422-RecordInvalid
            title: Record Invalid Error
            message: API cannot remove the primary Output Stream Target with the ID of <output id> from the Live Stream <livestream id><livestream name>.
            description: ''
            links: []
        Example Response 5:
          meta:
            status: 422
            code: ERR-422-InvalidStateChange
            title: Invalid State Change Error
            message: The request couldn't be processed. The broadcast location can't be updated when using autostart.
            description: ''
            links: []
    Error410:
      type: object
      description: ''
      required:
      - meta
      properties:
        meta:
          type: object
          title: meta
          description: ''
          properties:
            status:
              type: integer
              description: ''
              example: ''
              format: int32
            code:
              type: string
              description: ''
              example: ''
            title:
              type: string
              description: ''
              example: ''
            message:
              type: string
              description: ''
              example: ''
            description:
              type: string
              description: ''
              example: ''
            links:
              type: array
              description: ''
              example: ''
              items: {}
      example:
        Example Response 1:
          meta:
            status: 410
            code: ERR-410-RecordDeleted
            title: Record Deleted Error
            message: The requested resource has been deleted.
            description: ''
            links: []
    usage_stream_targets:
      type: object
      description: ''
      properties:
        stream_targets:
          type: object
          title: Array of stream targets
          description: An array of stream targets and the details of their CDN usage.
          properties:
            id:
              type: string
              description: The unique alphanumeric string that identifies the stream target.
              format: int32
            name:
              type: string
              description: A descriptive name for the stream target. Maximum 255 characters.
              example: ''
            archived:
              type: boolean
              description: A value of **true** indicates that the stream target has been removed from Wowza Video.
            type:
              type: string
              description: The type of stream target. <br/> **Fastly** is a Wowza CDN target.
              example: ''
              enum:
              - fastly
            viewing_seconds:
              type: integer
              description: The total length of time, in seconds, that the stream was played at the target. May be longer than the duration of the stream.
              example: ''
              format: int32
            viewing_bytes:
              type: integer
              description: The amount of content, in bytes, that went through the stream target during the selected time frame.
              example: ''
              format: int32
        pagination:
          type: object
          description: Page information for the results generated by the query.
          properties:
            payload_version:
              type: integer
              description: The pagination object version.
            total_records:
              type: integer
              description: The total number of records in the database that match the query.
              example: ''
            next_page_key:
              type: string
              description: The key ID of the next page of results.
              example: ''
            per_page:
              type: integer
              description: The number of records included on each page of results.
              example: ''
            total_pages:
              type: integer
              description: The total number of pages generated by the query.
              example: ''
        limits:
          type: object
          description: The time frame represented in the response.
          properties:
            from:
              type: string
              description: The start of the range of time represented in the response.
              example: ''
              format: date-time
            to:
              type: string
              description: The end of the range of time represented in the response.
              example: ''
              format: date-time
      example:
        stream_targets:
        - id: tvctq36g
          name: My Stream Target
          archived: true
          type: fastly
          viewing_seconds: 44925498
          viewing_bytes: 22886
        - id: bac1256
          name: My Other Stream Target
          archived: false
          type: fastly
          viewing_seconds: 593275043
          viewing_bytes: 22886
        pagination:
          payload_version: '2.0'
          total_records: 269
          next_page_key: 2jj8syfl
          per_page: 10
          total_pages: 27
        limits:
          from: '2019-11-07T00:00:00.000Z'
          to: '2019-12-05T00:00:00.000Z'
    Error404:
      type: object
      description: ''
      required:
      - meta
      properties:
        meta:
          type: object
          title: meta
          description: ''
          properties:
            status:
              type: integer
              description: ''
              example: ''
              format: int32
            code:
              type: string
              description: ''
              example: ''
            title:
              type: string
              description: ''
              example: ''
            message:
              type: string
              description: ''
              example: ''
            description:
              type: string
              description: ''
              example: ''
            links:
              type: array
              description: ''
              example: ''
              items: {}
      example:
        Example Response 1:
          meta:
            status: 404
            code: ERR-404-RecordNotFound
            title: Record Not Found Error
            message: The requested resource couldn't be found.
            description: ''
            links: []
  parameters:
    per_page_2.0:
      name: per_page
      in: query
      description: For use with the *

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