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

# Create usage event

> Create a new usage event



## OpenAPI

````yaml /openAPI/openapi-20240301.json post /rawmetrics
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /rawmetrics:
    post:
      tags:
        - Usage Events
      summary: Create usage event
      description: Create a new usage event
      operationId: Create-usage-event
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRawMetricRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RawMetricResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateRawMetricRequestSchema:
      properties:
        name:
          type: string
          title: Name
          description: name of the rawmetric
        api_slug:
          type: string
          title: Api Slug
          description: rawmetric slug name
        dataschema:
          additionalProperties: true
          type: object
          title: Dataschema
          description: Data schema of raw metric
        column_order:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Column Order
          description: Order of the columns in the raw metric table
      type: object
      required:
        - name
        - api_slug
        - dataschema
      title: CreateRawMetricRequestSchema
      description: Create RawMetric Request Schema
    RawMetricResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: RawMetric Id
        name:
          type: string
          title: Name
          description: name of the raw metric
        api_slug:
          type: string
          title: Api Slug
          description: api slug raw metric name
        dataschema:
          additionalProperties: true
          type: object
          title: Dataschema
          description: Data schema raw metric
        column_order:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Column Order
          description: Order of the columns in the raw metric table
        usage_upload_enabled:
          type: boolean
          title: Usage Upload Enabled
          description: Whether S3 usage upload is enabled
          default: false
        s3_path:
          anyOf:
            - type: string
            - type: 'null'
          title: S3 Path
          description: Combined S3 bucket and directory path
        error_log_s3_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Log S3 Path
          description: Combined error log S3 bucket and directory path
        allow_partial_upload:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Partial Upload
          description: Whether partial upload is allowed
      type: object
      required:
        - id
        - name
        - api_slug
        - dataschema
      title: RawMetricResponseSchema
      description: RawMetric Response Schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````