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

# Create an Inventory

> this operation creates a new inventory



## OpenAPI

````yaml POST /inventory
openapi: 3.1.0
info:
  title: Lumos API
  version: 1.0.0
  description: Lumos RESTful API
  x-logo:
    url: >-
      https://zorp.zeetco.com/static/media/mark-white.8c3b78e3c878db1859b6319c98dc38b6.svg
    altText: Zeet Logo
  contact:
    email: support@zeet.co
servers:
  - url: https://api.alerty.ai
security: []
paths:
  /inventory:
    post:
      summary: Create an Inventory
      description: this operation creates a new inventory
      operationId: newInventory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Inventory'
      responses:
        '201':
          description: inventory created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Inventory'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    Inventory:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          properties:
            name:
              type: string
              description: the inventory name
            description:
              type: string
              description: the inventory description
            default:
              type: boolean
              description: flag if the inventory is the default one
            resources:
              type: array
              description: the inventory resources list
              items:
                $ref: '#/components/schemas/Resource'
          required:
            - name
            - default
            - resources
    BaseEntity:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUID'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - createdAt
        - updatedAt
    Resource:
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          properties:
            name:
              type: string
              description: the inventory resource name
            type:
              $ref: '#/components/schemas/ResourceType'
            configuration:
              $ref: '#/components/schemas/ResourceConfiguration'
          required:
            - name
            - type
            - configuration
    ApiError:
      type: object
      properties:
        code:
          type: integer
          description: a custom Lumos error code
          format: uint64
          example: 1400
        field:
          type: string
          description: the field that this error is associated with, if applicable
          example: name
        description:
          type: string
          description: a description for this error
          example: A descriptive error message
      required:
        - description
    UUID:
      description: Unique identifier for the entity
      type: string
      format: uuid
      example: 5df33a85-2b9c-40e3-8854-760ee3b8efc7
      x-go-name: ID
    ResourceType:
      type: string
      description: the inventory resource type
      enum:
        - WEBSITE
        - DATABASE
        - COMPUTE
        - STRIPE
        - AWS_CLOUDFRONT
        - CLOUDFLARE
        - STATUS_PAGE
        - RDS_DATABASE
      x-enumNames:
        - WebsiteResource
        - DatabaseResource
        - ComputeResource
        - StripeResource
        - CloudFrontResource
        - CloudflareResource
        - StatusPageResource
        - RDSDatabaseResource
    ResourceConfiguration:
      oneOf:
        - $ref: '#/components/schemas/WebsiteResourceConfiguration'
        - $ref: '#/components/schemas/DatabaseResourceConfiguration'
        - $ref: '#/components/schemas/ComputeResourceConfiguration'
        - $ref: '#/components/schemas/StripeResourceConfiguration'
        - $ref: '#/components/schemas/CloudFrontResourceConfiguration'
        - $ref: '#/components/schemas/CloudflareResourceConfiguration'
        - $ref: '#/components/schemas/StatusPageResourceConfiguration'
        - $ref: '#/components/schemas/RDSDatabaseResourceConfiguration'
    WebsiteResourceConfiguration:
      type: object
      properties:
        url:
          type: string
          description: the website resource URL
          x-go-name: URL
      required:
        - url
    DatabaseResourceConfiguration:
      type: object
      properties:
        engine:
          type: string
          description: the database engine
          enum:
            - MONGO_DB
            - POSTGRES
            - MYSQL
            - SUPABASE
          x-enumNames:
            - MongoDBEngine
            - PostgresEngine
            - MySQLEngine
            - SupabaseEngine
      required:
        - engine
    ComputeResourceConfiguration:
      type: object
      properties:
        provider:
          type: string
          description: the compute solution provider
          enum:
            - AWS_LAMBDA
            - GCP_CLOUD_RUN
          x-enumNames:
            - AWSLambdaProvider
            - GCPCloudRunProvider
      required:
        - provider
    StripeResourceConfiguration:
      type: object
      properties:
        accessToken:
          type: string
          description: the Stripe account access token
      required:
        - accessToken
    CloudFrontResourceConfiguration:
      type: object
      properties:
        distributionId:
          type: string
          description: the CloudFront distribution ID
        awsAccessKeyId:
          type: string
          description: the AWS access key ID
        awsSecretAccessKey:
          type: string
          description: the AWS secret access key
      required:
        - distributionId
        - awsAccessKeyId
        - awsSecretAccessKey
    CloudflareResourceConfiguration:
      type: object
      properties:
        zoneId:
          type: string
          description: the Cloudflare zone ID
        apiToken:
          type: string
          description: the Cloudflare API Token
      required:
        - zoneId
        - apiToken
    StatusPageResourceConfiguration:
      type: object
      properties:
        slug:
          type: string
          description: used to create a resource for a pre-configured status page
    RDSDatabaseResourceConfiguration:
      type: object
      properties:
        instanceId:
          type: string
          description: the rds instance identifier
          x-go-name: InstanceID
        awsAccessKeyId:
          type: string
          description: the AWS access key ID
          x-go-name: AWSAccessKeyID
        awsSecretAccessKey:
          type: string
          description: the AWS secret access key
          x-go-name: AWSSecretAccessKey
        region:
          type: string
          description: the rds instance region
      required:
        - instanceId
        - awsAccessKeyId
        - awsSecretAccessKey
  responses:
    BadRequest:
      description: The request is malformed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: The request is forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    cookieAuth:
      type: apiKey
      in: cookie
      name: __lumos_session

````