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

# Create Dataset From Project

> [!NOTE]
>
> **[Click for Python SDK](https://docs.nucleus.scale.com/en/latest/api/nucleus/index.html#nucleus.NucleusClient.create_dataset_from_project)**
>
> ```
> NucleusClient.create_dataset_from_project(
>     project_id: str,
>     last_n_tasks: Optional[int] = None,
>     name: Optional[str] = None
> ) -> Dataset
> ```

If you already have `Annotation`, `SegmentAnnotation`, `VideoAnnotation`, `Categorization`, `PolygonAnnotation`, `ImageAnnotation`, `DocumentTranscription`, `LidarLinking`, or `LidarAnnotation` projects with Scale, use this endpoint to import your project directly into Nucleus.

You'll need to specify your Scale `project_id` and the number of tasks that you want to ingest.

By default, the name of your `Dataset` will be the same as your project's name, and will ingest all tasks (both pending and completed) into the resulting dataset. You can override these defaults by using the specified request parameters.

This endpoint is asynchronous because it is possible to have a delay when the number of tasks is larger than 1000. As a result, the endpoint returns the `job_id` of an `AsyncJob`, which you can use to check the job's status (and any errors) via the Check Async Job endpoint.


## OpenAPI

````yaml openapi/nucleus.json POST /dataset/create_from_project
openapi: 3.1.0
info:
  title: Nucleus API
  version: '1.1'
servers:
  - url: https://api.scale.com/v1/nucleus
security:
  - sec0: []
paths:
  /dataset/create_from_project:
    post:
      summary: Create Dataset From Project
      operationId: create-dataset-from-project
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - project_id
              properties:
                project_id:
                  type: string
                  description: The id of the Scale project.
                last_n_tasks:
                  type: integer
                  description: >-
                    An optional field specifying the number of tasks to ingest
                    from the project. If this value is not set, all tasks will
                    be imported.
                  format: int32
                name:
                  type: string
                  description: >-
                    An optional field of the name for your dataset. By default
                    it will be the same as the project name.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    dataset_id: ds_bwkezj6g5c4g05gqp1eg
                    job_id: job_c19xcf9mkws46gah00yg
                    job_last_known_status: Running
                    job_type: ingestTasks
                    job_creation_time: '2021-09-21T20:07:13.055Z'
                    message: >-
                      Importing tasks in the background.  You can use the job_id
                      field to asynchronously check the status of this job.
              schema:
                type: object
                properties:
                  dataset_id:
                    type: string
                    example: ds_bwkezj6g5c4g05gqp1eg
                  job_id:
                    type: string
                    example: job_c19xcf9mkws46gah00yg
                  job_last_known_status:
                    type: string
                    example: Running
                  job_type:
                    type: string
                    example: ingestTasks
                  job_creation_time:
                    type: string
                    example: '2021-09-21T20:07:13.055Z'
                  message:
                    type: string
                    example: >-
                      Importing tasks in the background.  You can use the job_id
                      field to asynchronously check the status of this job.
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````