> ## Documentation Index
> Fetch the complete documentation index at: https://vectorly-783efd43.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update object.

> Update object of certain ID.

### Example

Update model:
```
POST /api/object/M1234567

{
    "payload": {
        "object_type": "model",
        "name": "model name",
        "content": {
            "meta": {"entrance_file": "main.jl"},
            "tree": [],
        }
    }
}
```

Update experiment:
```
POST /api/object/X1234567

{
    "payload": {
        "object_type": "experiment",
        "name": "experiment name",
    }
}
```



## OpenAPI

````yaml post /api/object/{objid}
openapi: 3.1.0
info:
  title: Coinfer Server API
  version: 0.0.1776236533+0db4b8c
  description: |+

    This part of document describes the HTTP APIs of the Coinfer cloud.

servers:
  - url: https://api.coinfer.ai
    description: The production environment
  - url: https://dev.coinfer.ai
    description: The development environment
security: []
tags:
  - name: Object
    description: APIs related to object CRUD operations.
  - name: Invoke
    description: APIs used to invoke CloudFunction or run workflow.
  - name: Notification
    description: APIs related to notification.
  - name: Authorization
    description: >-
      APIs related to user, token, login, etc.


      Normally APIs in this group should not be used. You should get API token
      from our website and then use the token to call other APIs.
paths:
  /api/object/{objid}:
    post:
      tags:
        - Object
      summary: Update object.
      description: |-
        Update object of certain ID.

        ### Example

        Update model:
        ```
        POST /api/object/M1234567

        {
            "payload": {
                "object_type": "model",
                "name": "model name",
                "content": {
                    "meta": {"entrance_file": "main.jl"},
                    "tree": [],
                }
            }
        }
        ```

        Update experiment:
        ```
        POST /api/object/X1234567

        {
            "payload": {
                "object_type": "experiment",
                "name": "experiment name",
            }
        }
        ```
      operationId: coinfer_apis_unified_api_update_object
      parameters:
        - in: path
          name: objid
          schema:
            title: Objid
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateObject'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/SuccRsp_Annotated_Union_ExperimentRsp__ViewModelsRsp__WorkflowRunRsp__ModelRunScriptRsp__NoneType___FieldInfo_annotation_NoneType__required_True__discriminator__object_type____
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrRsp'
      security:
        - GlobalAuth: []
components:
  schemas:
    UpdateObject:
      properties:
        payload:
          discriminator:
            mapping:
              data:
                $ref: '#/components/schemas/UpdateDataReq'
              event:
                $ref: '#/components/schemas/UpdateEventReq'
              experiment:
                $ref: '#/components/schemas/UpdateExperiment'
              experiment.nsample_stat:
                $ref: '#/components/schemas/CreateNSampleStatReq'
              experiment.protobuf_message:
                $ref: '#/components/schemas/CreateProtobufMessageReq'
              experiment.text_message:
                $ref: '#/components/schemas/CreateTextMessageReq'
              model:
                $ref: '#/components/schemas/UpdateModel'
              workflow:
                $ref: '#/components/schemas/UpdateWorkflowReq'
              workflow.analyzer_result:
                $ref: '#/components/schemas/SaveAnalyzerResultReq'
            propertyName: object_type
          oneOf:
            - $ref: '#/components/schemas/CreateNSampleStatReq'
            - $ref: '#/components/schemas/UpdateModel'
            - $ref: '#/components/schemas/UpdateExperiment'
            - $ref: '#/components/schemas/UpdateEventReq'
            - $ref: '#/components/schemas/CreateTextMessageReq'
            - $ref: '#/components/schemas/CreateProtobufMessageReq'
            - $ref: '#/components/schemas/UpdateWorkflowReq'
            - $ref: '#/components/schemas/UpdateDataReq'
            - $ref: '#/components/schemas/SaveAnalyzerResultReq'
          title: Payload
      required:
        - payload
      title: UpdateObject
      type: object
    SuccRsp_Annotated_Union_ExperimentRsp__ViewModelsRsp__WorkflowRunRsp__ModelRunScriptRsp__NoneType___FieldInfo_annotation_NoneType__required_True__discriminator__object_type____:
      properties:
        status:
          const: ok
          title: Status
          type: string
        data:
          anyOf:
            - discriminator:
                mapping:
                  experiment:
                    $ref: '#/components/schemas/ExperimentRsp'
                  model:
                    $ref: '#/components/schemas/ViewModelsRsp'
                  model.run_response:
                    $ref: '#/components/schemas/ModelRunScriptRsp'
                  workflow.run:
                    $ref: '#/components/schemas/WorkflowRunRsp'
                propertyName: object_type
              oneOf:
                - $ref: '#/components/schemas/ExperimentRsp'
                - $ref: '#/components/schemas/ViewModelsRsp'
                - $ref: '#/components/schemas/WorkflowRunRsp'
                - $ref: '#/components/schemas/ModelRunScriptRsp'
            - type: 'null'
          title: Data
      required:
        - status
        - data
      title: >-
        SuccRsp[Annotated[Union[ExperimentRsp, ViewModelsRsp, WorkflowRunRsp,
        ModelRunScriptRsp, NoneType], FieldInfo(annotation=NoneType,
        required=True, discriminator='object_type')]]
      type: object
    ErrRsp:
      properties:
        status:
          const: error
          title: Status
          type: string
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
      required:
        - status
        - code
        - message
      title: ErrRsp
      type: object
    UpdateDataReq:
      properties:
        object_type:
          const: data
          title: Object Type
          type: string
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          description: Data name
          title: Name
        description:
          anyOf:
            - maxLength: 2048
              type: string
            - type: 'null'
          description: Data description
          title: Description
        base64_encoded:
          default: false
          description: Whether the data in `data` is base64 encoded
          title: Base64 Encoded
          type: boolean
        data:
          anyOf:
            - type: string
            - type: 'null'
          description: File data in text format
          title: Data
        data_uri:
          anyOf:
            - type: string
            - type: 'null'
          description: File data URI
          title: Data Uri
      required:
        - object_type
      title: UpdateDataReq
      type: object
    UpdateEventReq:
      properties:
        object_type:
          const: event
          title: Object Type
          type: string
        params:
          default: ''
          title: Params
          type: string
        engine:
          default: lambda
          enum:
            - lambda
            - fargate
          title: Engine
          type: string
        lock_key:
          default: ''
          description: >-
            lock key provided by user. It is combined with the cloudfunction_id
            to form the real lock key

            when running cloudfunction triggered by this event.


            Sometimes, users may want CloudFunctions to run exclusively, but not
            just one

            instance globally. For example, when running a CloudFunction
            specific to an

            experiment, users may want only one instance of that CloudFunction
            to run

            simultaneously for that experiment. In this case, users can specify
            the lock_key

            as the experiment_id.
          title: Lock Key
          type: string
      required:
        - object_type
      title: UpdateEventReq
      type: object
    UpdateExperiment:
      properties:
        object_type:
          const: experiment
          title: Object Type
          type: string
        action:
          anyOf:
            - type: string
            - type: 'null'
          title: Action
        meta:
          additionalProperties: true
          title: Meta
          type: object
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        n_chains:
          default: 0
          title: N Chains
          type: integer
        n_variables:
          default: 0
          title: N Variables
          type: integer
        n_samples:
          default: 0
          title: N Samples
          type: integer
        sample_update_time:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Sample Update Time
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      required:
        - object_type
      title: UpdateExperiment
      type: object
    CreateNSampleStatReq:
      properties:
        object_type:
          const: experiment.nsample_stat
          title: Object Type
          type: string
        batch_id:
          title: Batch Id
          type: string
        run_id:
          title: Run Id
          type: string
        chain_name:
          title: Chain Name
          type: string
        n_sample:
          title: N Sample
          type: integer
        stat:
          additionalProperties:
            maxItems: 2
            minItems: 2
            prefixItems:
              - type: string
              - type: number
            type: array
          title: Stat
          type: object
      required:
        - object_type
        - batch_id
        - run_id
        - chain_name
        - n_sample
        - stat
      title: CreateNSampleStatReq
      type: object
    CreateProtobufMessageReq:
      properties:
        object_type:
          const: experiment.protobuf_message
          title: Object Type
          type: string
        batch_id:
          title: Batch Id
          type: string
        run_id:
          title: Run Id
          type: string
        logs:
          $ref: '#/components/schemas/DataTyping'
      required:
        - object_type
        - batch_id
        - run_id
        - logs
      title: CreateProtobufMessageReq
      type: object
    CreateTextMessageReq:
      properties:
        object_type:
          const: experiment.text_message
          title: Object Type
          type: string
        datas:
          description: list of messages
          items:
            additionalProperties: true
            type: object
          title: Datas
          type: array
        batch_id:
          title: Batch Id
          type: string
        run_id:
          title: Run Id
          type: string
      required:
        - object_type
        - datas
        - batch_id
        - run_id
      title: CreateTextMessageReq
      type: object
    UpdateModel:
      properties:
        object_type:
          const: model
          title: Object Type
          type: string
        content:
          anyOf:
            - $ref: '#/components/schemas/ModelContent'
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        lambda_image:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Lambda Image
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
      required:
        - object_type
      title: UpdateModel
      type: object
    UpdateWorkflowReq:
      properties:
        object_type:
          const: workflow
          title: Object Type
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: workflow name
          title: Name
        description:
          anyOf:
            - maxLength: 2048
              type: string
            - type: 'null'
          description: workflow description
          title: Description
        data_id:
          anyOf:
            - maxLength: 9
              type: string
            - type: 'null'
          description: data ID
          title: Data Id
        experiment_id:
          anyOf:
            - maxLength: 9
              type: string
            - type: 'null'
          description: experiment ID
          title: Experiment Id
        analyzer_id:
          anyOf:
            - maxLength: 20
              type: string
            - type: 'null'
          description: analyzer ID
          title: Analyzer Id
        analyzer_result:
          anyOf:
            - type: string
            - type: 'null'
          description: analyzer result(Internal use)
          title: Analyzer Result
        startup_script:
          anyOf:
            - type: string
            - type: 'null'
          description: workflow startup script
          title: Startup Script
        settings:
          anyOf:
            - type: string
            - type: 'null'
          description: workflow settings
          title: Settings
        data_script:
          anyOf:
            - type: string
            - type: 'null'
          description: data script
          title: Data Script
      required:
        - object_type
      title: UpdateWorkflowReq
      type: object
    SaveAnalyzerResultReq:
      properties:
        object_type:
          const: workflow.analyzer_result
          title: Object Type
          type: string
        return_code:
          title: Return Code
          type: integer
        errlines:
          items:
            type: string
          title: Errlines
          type: array
        result:
          title: Result
          type: string
      required:
        - object_type
        - return_code
        - errlines
        - result
      title: SaveAnalyzerResultReq
      type: object
    ExperimentRsp:
      properties:
        object_type:
          const: experiment
          title: Object Type
          type: string
        short_id:
          default: ''
          title: Short Id
          type: string
        name:
          default: ''
          title: Name
          type: string
        model_id:
          default: ''
          title: Model Id
          type: string
        status:
          default: ''
          title: Status
          type: string
        meta:
          title: Meta
        n_chains:
          default: 0
          title: N Chains
          type: integer
        n_variables:
          default: 0
          title: N Variables
          type: integer
        n_samples:
          default: 0
          title: N Samples
          type: integer
        sample_update_time:
          default: ''
          format: date-time
          title: Sample Update Time
          type: string
        run_on:
          default: ''
          title: Run On
          type: string
        input:
          anyOf:
            - type: string
            - type: 'null'
          title: Input
        output:
          anyOf:
            - type: string
            - type: 'null'
          title: Output
        model_name:
          title: Model Name
          type: string
        workflow_id:
          default: ''
          title: Workflow Id
          type: string
        workflow_name:
          default: ''
          title: Workflow Name
          type: string
      required:
        - object_type
        - model_name
      title: ExperimentRsp
      type: object
    ViewModelsRsp:
      properties:
        object_type:
          const: model
          title: Object Type
          type: string
        id:
          title: Id
          type: integer
        short_id:
          title: Short Id
          type: string
        name:
          title: Name
          type: string
        content:
          title: Content
        meta:
          $ref: '#/components/schemas/_ModelMetaInRsp'
        tags:
          items:
            type: string
          title: Tags
          type: array
        lambda_image_url:
          anyOf:
            - type: string
            - type: 'null'
          default: ''
          title: Lambda Image Url
        lambda_image_name:
          anyOf:
            - type: string
            - type: 'null'
          default: ''
          title: Lambda Image Name
      required:
        - object_type
        - id
        - short_id
        - name
        - meta
        - tags
      title: ViewModelsRsp
      type: object
    ModelRunScriptRsp:
      properties:
        object_type:
          const: model.run_response
          title: Object Type
          type: string
        data:
          title: Data
      required:
        - object_type
        - data
      title: ModelRunScriptRsp
      type: object
    WorkflowRunRsp:
      properties:
        object_type:
          const: workflow.run
          title: Object Type
          type: string
        experiment_id:
          title: Experiment Id
          type: string
        experiment_name:
          title: Experiment Name
          type: string
      required:
        - object_type
        - experiment_id
        - experiment_name
      title: WorkflowRunRsp
      type: object
    DataTyping:
      properties:
        iteration:
          additionalProperties:
            maxItems: 2
            minItems: 2
            prefixItems:
              - type: integer
              - type: integer
            type: array
          title: Iteration
          type: object
        vars:
          additionalProperties:
            additionalProperties:
              items: {}
              type: array
            type: object
          title: Vars
          type: object
      required:
        - iteration
        - vars
      title: DataTyping
      type: object
    ModelContent:
      properties:
        meta:
          allOf:
            - $ref: '#/components/schemas/ModelMeta'
          default:
            project_file: Project.toml
            entrance_file: main.jl
            entrance_func: model
            manifest: Manifest.toml
        tree:
          items:
            $ref: '#/components/schemas/ModelTreeNode'
          title: Tree
          type: array
      title: ModelContent
      type: object
    _ModelMetaInRsp:
      properties:
        github:
          anyOf:
            - type: string
            - type: 'null'
          title: Github
        commit_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Commit Id
        origin_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Origin Url
        fixed_version_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Fixed Version Url
      title: _ModelMetaInRsp
      type: object
    ModelMeta:
      properties:
        project_file:
          default: Project.toml
          title: Project File
          type: string
        entrance_file:
          default: main.jl
          title: Entrance File
          type: string
        entrance_func:
          default: model
          title: Entrance Func
          type: string
        manifest:
          default: Manifest.toml
          title: Manifest
          type: string
      title: ModelMeta
      type: object
    ModelTreeNode:
      properties:
        name:
          title: Name
          type: string
        type:
          enum:
            - file
            - folder
          title: Type
          type: string
        content:
          default: ''
          title: Content
          type: string
        children:
          default: []
          items:
            $ref: '#/components/schemas/ModelTreeNode'
          title: Children
          type: array
      required:
        - name
        - type
      title: ModelTreeNode
      type: object
  securitySchemes:
    GlobalAuth:
      type: http
      scheme: bearer

````