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

# Ingest Tyk Gateway analytics records

> Machine-to-machine endpoint for Tyk Pump (the http pump, or the stdout pump through a log shipper). The body is a JSON array of Tyk AnalyticsRecord, optionally gzip-encoded (Content-Encoding: gzip). Only MCP records are kept. Authenticated with the connection's ingest token (Authorization: Bearer). A bad or revoked token gets 401 so the pump drops the batch. Enterprise Edition; 404 in Community Edition.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml post /ingest/tyk-analytics
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /ingest/tyk-analytics:
    post:
      tags:
        - TykMCP
      summary: Ingest Tyk Gateway analytics records
      description: >-
        Machine-to-machine endpoint for Tyk Pump (the http pump, or the stdout
        pump through a log shipper). The body is a JSON array of Tyk
        AnalyticsRecord, optionally gzip-encoded (Content-Encoding: gzip). Only
        MCP records are kept. Authenticated with the connection's ingest token
        (Authorization: Bearer). A bad or revoked token gets 401 so the pump
        drops the batch. Enterprise Edition; 404 in Community Edition.
      parameters:
        - name: Authorization
          in: header
          description: Bearer ingest token
          required: true
          schema:
            type: string
      requestBody:
        description: Analytics records
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/tykmcp.TykAnalyticsRecord'
        required: true
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tykmcp.IngestResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
components:
  schemas:
    tykmcp.TykAnalyticsRecord:
      type: object
      properties:
        alias:
          type: string
        api_id:
          type: string
        api_key:
          type: string
          description: >-
            APIKey is the key's hash when the Gateway runs with hash_keys (the

            default), and the raw key otherwise. It is used to attribute the
            call

            and never persisted.
        api_name:
          type: string
        latency:
          $ref: '#/components/schemas/tykmcp.TykLatency'
        mcp_stats:
          $ref: '#/components/schemas/tykmcp.TykMCPStats'
        method:
          type: string
        network:
          $ref: '#/components/schemas/tykmcp.TykNetworkStats'
        org_id:
          type: string
        path:
          type: string
        response_code:
          type: integer
        tags:
          type: array
          items:
            type: string
        timestamp:
          type: string
    tykmcp.IngestResult:
      type: object
      properties:
        accepted:
          type: integer
          description: Accepted is how many records the batch held.
        skipped_non_mcp:
          type: integer
          description: SkippedNonMCP records were not MCP traffic.
        stored:
          type: integer
          description: Stored is how many were recorded as MCP calls.
        unattributed:
          type: integer
          description: |-
            Unattributed records were stored without an App: the key is not a
            brokered credential and the alias names no App.
        unknown_api:
          type: integer
          description: |-
            UnknownAPI records were MCP traffic for an API that is not an MCP
            server on the token's connection; they are not stored.
    models.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
    tykmcp.TykLatency:
      type: object
      properties:
        gateway:
          type: integer
        total:
          type: integer
        upstream:
          type: integer
    tykmcp.TykMCPStats:
      type: object
      properties:
        declared_protocol_version:
          type: string
        effective_protocol_version:
          type: string
        is_mcp:
          type: boolean
        jsonrpc_error_code:
          type: integer
        jsonrpc_method:
          type: string
        primitive_name:
          type: string
        primitive_type:
          type: string
        protocol_version_source:
          type: string
    tykmcp.TykNetworkStats:
      type: object
      properties:
        bytes_in:
          type: integer
        bytes_out:
          type: integer
        closed_connections:
          type: integer
        open_connections:
          type: integer

````