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

# Get Project Setup Task Status

> Monitor the progress and completion status of your project setup tasks. This endpoint provides real-time insights into the preparation process, helping you understand when your project becomes ready for editing in CAMB.AI Studio.

Understanding the status of your project setup process is crucial for coordinating workflows between technical teams and creative editors. This endpoint transforms the uncertainty of background processing into clear, actionable information about your project's readiness for Studio editing. Think of it as your project's progress dashboard, providing the visibility needed to plan next steps and coordinate team handoffs effectively.

When you initiate a project setup through the API, the system begins a sophisticated analysis and preparation process that happens behind the scenes. Rather than leaving you wondering about progress, this status endpoint provides detailed insights into each stage of preparation, helping you understand not just whether your project is ready, but what specific work has been completed and what remains in progress.

## Understanding Project Setup Progress

Project setup involves multiple complex operations that must complete successfully before your project becomes available in CAMB.AI Studio. Each operation contributes essential components to the final project workspace, and understanding this progression helps you better coordinate your content workflows.

The setup process begins with comprehensive media analysis, where our system examines your source content to understand its characteristics, audio structure, and optimal processing parameters. This analysis phase determines how the system will approach transcription, translation, and voice synthesis for your specific content. The status endpoint reveals insights from this analysis, helping you understand what the system discovered about your media and how it plans to optimize the dubbing process.

## The Task ID Connection

The task ID serves as your unique identifier for tracking project setup progress from initiation through completion. This identifier creates a direct link between your API-initiated project and the resulting Studio workspace, enabling seamless coordination between technical and creative workflows.

When you submit a project setup request, the system immediately returns a task ID that becomes your tracking reference throughout the preparation process. This ID remains constant and unique, allowing you to query status information at any time without ambiguity about which project you're monitoring. The same task ID that tracks setup progress will also identify your project within CAMB.AI Studio once preparation complete

## Monitoring Implementation

Let's examine how to effectively monitor project setup progress using Python. This implementation demonstrates both basic status checking and more sophisticated monitoring patterns that integrate well with broader workflow automation.

```python [expandable] theme={null}
import requests
import json
import time

# Your API authentication
headers = {
    "x-api-key": "your-api-key",  # Replace with your actual API key
    "Content-Type": "application/json"
}

def check_project_setup_status(task_id):
    """
    Polls the status endpoint to track a project setup task's progress.
    Continues checking until the task reaches a terminal state.
    """
    if not task_id:
        print("Error: No task ID provided")
        return None

    terminal_states = ["SUCCESS", "ERROR"]
    current_status = None

    while current_status not in terminal_states:
        try:
            # Make the status request
            response = requests.get(
                f"https://client.camb.ai/apis/project-setup/{task_id}",
                headers=headers
            )

            # Verify the request was successful
            response.raise_for_status()

            # Extract the status information
            status_data = response.json()
            current_status = status_data.get("status")

            # Display current progress information
            print(f"Status: {current_status}")
            if current_status == "PENDING":
                time.sleep(15)
                continue

            # Handle completed state
            if current_status == "SUCCESS":
                print("Project setup completed successfully!")
                return status_data

            # Handle failed state
            if current_status == "ERROR":
                print(f"Project setup task failed: {status_data.get('message')}")
                return status_data

            # Wait before next check to avoid excessive requests
            time.sleep(30)  # Poll every 30 seconds

        except requests.exceptions.RequestException as e:
            print(f"Error checking project setup status: {e}")
            if hasattr(e, 'response') and e.response is not None:
                print(f"Response content: {e.response.text}")
            return None

    return None

# Example usage with a task_id from a previous dubbing request
task_id = "your_task_id"  # Replace with your actual task ID
final_status = check_project_setup_status(task_id)
print(f"Project Setup Task Status: {final_status}")
```

## Best Practices for Status Monitoring

To efficiently track your project setup tasks, consider these professional recommendations:

1. Implement Exponential Backoff: Start with frequent checks that gradually increase in interval to avoid overloading the API.
2. Handle Terminal States: Always implement proper handling for both successful completion and failure cases.

By properly integrating status checking into your application, you can create a seamless dubbing experience that keeps your users informed throughout the entire process.


## OpenAPI

````yaml get /project-setup/{task_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /project-setup/{task_id}:
    get:
      tags:
        - Apis
        - Project Setup
      summary: Create Project Setup Task Status
      operationId: create_project_setup_task_status_project_setup__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/TaskIDParam'
          description: >-
            A unique identifier for the task. This is used to query the status
            of the project setup task that is running. It is returned when a
            request is made to setup a project.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrchestratorPipelineResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    TaskIDParam:
      type: string
      title: Task ID
      description: >-
        This parameter represents a unique identifier for a task. It is used in
        various API endpoints to query the status or result of a specific task.
        The `task_id` is typically returned when a task is created.
    OrchestratorPipelineResult:
      properties:
        status:
          $ref: '#/components/schemas/TaskStatus'
        run_id:
          type:
            - integer
            - 'null'
          title: Run ID
      type: object
      title: OrchestratorPipelineResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - SUCCESS
        - PENDING
        - TIMEOUT
        - ERROR
        - PAYMENT_REQUIRED
      title: TaskStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        The `x-api-key` is a custom header required for authenticating requests
        to our API. Include this header in your request with the appropriate API
        key value to securely access our endpoints. You can find your API key(s)
        in the 'API' section of our studio website.

````