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

# Create a new Log

> Create a new Log

<Accordion title="Usage with the Drivly SDK" icon="code-simple">
  <Note>
    <span class="font-medium">Make sure you install our SDK first. You can find out how, and more [here](/commerce/sdk).</span>
  </Note>

  ```typescript theme={null}
  import { SDK } from '@drivly/commerce'
  import type { logs } from '@drivly/commerce'

  const sdk = new SDK(...)

  const logs = await sdk.logs.create(data: logs): Promise<logs>
  ```
</Accordion>


## OpenAPI

````yaml post /logs
openapi: 3.0.3
info:
  title: Drivly Commerce API
  version: 1.0.0
  description: API for the Driv.ly experience
  contact:
    name: Drivly
    url: https://driv.ly
    email: support@driv.ly
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://commerce.driv.ly/api
security: []
paths:
  /logs:
    post:
      tags:
        - logs
      summary: Create a new Log
      description: Create a new Log
      parameters:
        - name: depth
          in: query
          description: number of levels to automatically populate relationships and uploads
          schema:
            type: number
        - name: locale
          in: query
          description: retrieves document(s) in a specific locale
          schema:
            type: string
        - name: fallback-locale
          in: query
          description: specifies a fallback locale if no locale value exists
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/logsRequest'
      responses:
        '200':
          $ref: '#/components/responses/logsUpsertConfirmationResponse'
      security:
        - apiKeyAuth: []
components:
  requestBodies:
    logsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/logs'
  responses:
    logsUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/logsUpsertConfirmation'
  schemas:
    logs:
      additionalProperties: false
      title: Log
      type: object
      properties:
        title:
          type: string
          nullable: true
        method:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        path:
          type: string
          nullable: true
        ip:
          type: string
          nullable: true
        userAgent:
          type: string
          nullable: true
        trace:
          type: string
          nullable: true
        requestHeaders:
          nullable: true
          anyOf:
            - type: object
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        responseHeaders:
          nullable: true
          anyOf:
            - type: object
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        requestBody:
          nullable: true
          anyOf:
            - type: object
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        responseBody:
          nullable: true
          anyOf:
            - type: object
            - type: array
              items: {}
            - type: string
            - type: number
            - type: boolean
        updatedAt:
          type: string
        createdAt:
          type: string
      required:
        - id
        - updatedAt
        - createdAt
    logsUpsertConfirmation:
      type: object
      title: Log upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: Log
          type: object
          properties:
            title:
              type: string
              nullable: true
            method:
              type: string
              nullable: true
            status:
              type: string
              nullable: true
            path:
              type: string
              nullable: true
            ip:
              type: string
              nullable: true
            userAgent:
              type: string
              nullable: true
            trace:
              type: string
              nullable: true
            requestHeaders:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            responseHeaders:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            requestBody:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            responseBody:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            updatedAt:
              type: string
            createdAt:
              type: string
          required:
            - id
            - updatedAt
            - createdAt
        message:
          type: string
      required:
        - doc
        - message
  securitySchemes:
    apiKeyAuth:
      in: header
      type: apiKey
      name: Authorization

````