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

# Create an Object.

> Create a new Object with content and metadata. The Object will be assigned a unique ID.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json post /v1/objects
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/objects:
    post:
      tags:
        - objects
      summary: Create an Object.
      description: >-
        Create a new Object with content and metadata. The Object will be
        assigned a unique ID.
      operationId: createObject
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ObjectCreateParameters'
      responses:
        '200':
          description: Object created successfully. Returns the Object with metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectView'
        '400':
          description: Bad request. Invalid content or parameters.
        '401':
          description: Unauthorized. Invalid or missing authentication.
        '403':
          description: Forbidden. Account does not have devbox capability.
        '500':
          description: Internal server error.
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Runloop from '@runloop/api-client';


            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });


            const objectView = await client.objects.create({ content_type:
            'unspecified', name: 'name' });


            console.log(objectView.id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            object_view = client.objects.create(
                content_type="unspecified",
                name="name",
            )
            print(object_view.id)
components:
  schemas:
    ObjectCreateParameters:
      type: object
      description: Parameters required to create a new Object.
      properties:
        name:
          type: string
          description: The name of the Object.
        content_type:
          $ref: '#/components/schemas/ContentType'
          description: The content type of the Object.
        metadata:
          additionalProperties:
            type: string
          description: User defined metadata to attach to the object for organization.
          type:
            - object
            - 'null'
        ttl_ms:
          format: int64
          description: >-
            Optional lifetime of the object in milliseconds, after which the
            object is automatically deleted. Time starts ticking after the
            object is created.
          type:
            - integer
            - 'null'
      required:
        - name
        - content_type
    ObjectView:
      type: object
      description: An Object represents a stored data entity with metadata.
      properties:
        id:
          type: string
          description: The unique identifier of the Object.
        name:
          type: string
          description: The name of the Object.
        state:
          $ref: '#/components/schemas/ObjectState'
          description: The current state of the Object.
        size_bytes:
          format: int64
          description: The size of the Object content in bytes (null until uploaded).
          type:
            - integer
            - 'null'
        content_type:
          $ref: '#/components/schemas/ContentType'
          description: The content type of the Object.
        create_time_ms:
          type: integer
          format: int64
          description: The creation time of the Object in milliseconds since epoch.
        delete_after_time_ms:
          format: int64
          description: >-
            The time after which the Object will be deleted in milliseconds
            since epoch.
          type:
            - integer
            - 'null'
        metadata:
          additionalProperties:
            type: string
          description: User defined metadata to attach to the Object for organization.
          type:
            - object
            - 'null'
        upload_url:
          description: Presigned URL for uploading content to S3 (only present on create).
          type:
            - string
            - 'null'
      required:
        - id
        - name
        - state
        - content_type
        - create_time_ms
    ContentType:
      type: string
      enum:
        - unspecified
        - text
        - binary
        - gzip
        - tar
        - tgz
    ObjectState:
      type: string
      enum:
        - UPLOADING
        - READ_ONLY
        - DELETED
        - ERROR
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````