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

# Upload 3D models programmatically

> Learn how to upload multiple 3D models to Cognite Data Fusion (CDF) using the Cognite API and SDKs for automated updates.

From the Cognite Console, you can upload a single 3D model to CDF without writing any code.

## Before you start

To upload and process 3D models, you need an **account** with the `3d:create`, `files:write`, and `files:read` capabilities for your CDF project. See [Assign capabilities](/cdf/access/guides/capabilities#upload-3d-models) to learn more.

You also need:

* Your **CDF project name**. You will use this as the `[projectname]` below.
* The **file name(s)** of the model(s) you will be uploading. You will use this as the `[filename]` below.

## Upload 3D models

<Steps>
  <Step title="Create a model that can hold several revisions">
    ```bash wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    curl -H "Authorization: Bearer <YOUR_OpenID Connect or OAuth2 token_HERE>" -H "Content-type: application/json" -X POST "https://api.cognitedata.com/api/v1/projects/[projectname]/3d/models" -d '{"items": [{"name":"model name"}]}'
    ```

    API reference: [3D models](/api-reference/concepts/20230101/3d-models)
  </Step>

  <Step title="Copy and make a note of the id field">
    Copy and make a note of the `id` field in the response. You will use this as the `[modelId]` below.
  </Step>

  <Step title="Create a file placeholder to make the file available for processing later">
    ```bash wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    curl -H "Authorization: Bearer <YOUR_OpenID Connect or OAuth2 token_HERE>" -H "Content-type: application/json" -X POST "https://api.cognitedata.com/api/v1/projects/[projectname]/files" -d '{"name":"[filename]"}'
    ```

    API reference: [File content](/api-reference/concepts/20230101/file-content)
  </Step>

  <Step title="Copy and make a note of the id field and uploadUrl">
    Copy and note the response `id` and `uploadUrl`. You will use them as `[fileId]` and `[uploadUrl]` in the next steps.
  </Step>

  <Step title="Upload the file">
    ```bash wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    curl --upload-file [filename] [uploadUrl]
    ```

    Google API reference: [Perform resumable uploads](https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload#example_uploading_the_file)
  </Step>

  <Step title="Create a versioned model and link the file from the first step to the revision">
    This also starts the processing of the model.

    ```bash wrap theme={"languages":{"custom":["/_languages/kuiper.json","../_languages/kuiper.json"]}}
    curl -H "Authorization: Bearer <YOUR_OpenID Connect or OAuth2 token_HERE>" -H "Content-type: application/json" -X POST "https://api.cognitedata.com/api/v1/projects/[projectname]/3d/models/[modelId]/revisions" -d '{"items": [{"fileId":"[fileId]"}]}'
    ```

    API reference: [3D model revisions](/api-reference/concepts/20230101/3d-model-revisions)
  </Step>

  <Step title="Monitor the processing of the model">
    API reference: [3D model revisions](/api-reference/concepts/20230101/3d-model-revisions)
  </Step>
</Steps>

## Next steps

After uploading 3D models, you can [add them to a scene](/cdf/3d/guides/scene) to view and contextualize in CDF, or [upload a revision to an existing model](/cdf/3d/guides/3dmodels_upload#upload-a-revision-to-an-existing-3d-model).
