> ## 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.

# Fetch Project Setup Results

> Retrieve comprehensive setup results for multiple localization projects in a single API call, streamlining project management in CAMB.AI Studio.

## Overview

he **Get Bulk Project Setup Results** endpoint is your go-to tool for managing multiple content localization projects with ease. By retrieving comprehensive setup results for multiple projects in a single API call, this endpoint empowers project managers, content creators, and automation workflows to stay on top of large-scale localization efforts in [CAMB.AI Studio](https://studio.camb.ai).

With this endpoint, you can:

* Retrieve detailed setup results for multiple projects simultaneously.
* Gain insights into project readiness, including status, duration, and language configurations.

<Info>
  **Why Use This Endpoint?**
  This endpoint is a game-changer for teams managing multiple localization projects. It provides a unified view of your project portfolio, helping you coordinate tasks, allocate resources efficiently, and make data-driven decisions to keep your content pipeline on track.
</Info>

```python [expandable] theme={null}
import requests
from typing import Any


def fetch_bulk_story_results(run_ids: list[int]) -> dict[str, Any] | None:
    """
    Retrieves multiple story conversion outputs in a single request

    Args:
        run_ids: List of unique run identifiers from story processing tasks

    Returns:
        List of story result dictionaries, or None if request fails
    """
    headers = {
        "x-api-key": "your-api-key-here",
        "Content-Type": "application/json",
    }

    payload = {"run_ids": run_ids}

    try:
        response = requests.post(
            "https://client.camb.ai/apis/stories-results",
            headers=headers,
            json=payload,
        )
        response.raise_for_status()

        results = response.json()
        print(f"Retrieved {len(results)} story results successfully")

        return results

    except requests.exceptions.HTTPError as e:
        print(f"Error {e.response.status_code}: {e.response.text}")
        return None
    except requests.exceptions.RequestException as e:
        print(f"Request failed: {e}")
        return None


def process_bulk_results(results: dict[str, Any]) -> None:
    """
    Process and display bulk story results

    Args:
        results: List of story result dictionaries
    """
    for i, run_id_key in enumerate(results, start=1):
        print(f"\n--- Story {i} ---")
        print(f"Main Audio: {results.get(run_id_key, {}).get('audio_url')}")
        print(f"Dialogue Track: {results.get(run_id_key, {}).get('dialogue_url')}")

        transcription = results.get(run_id_key, {}).get("transcription", {})
        if transcription:
            print(f"Transcript entries: {len(transcription)}")
            first_entry = transcription[0]
            print(
                f"First line: [{first_entry['start']}-{first_entry['end']}ms] "
                f"{first_entry['speaker']}: {first_entry['text'][:50]}..."
            )


# Example usage with multiple run IDs
run_ids_to_fetch = [9872, 9873, 9874, 9875, 9876]

bulk_results = fetch_bulk_story_results(run_ids_to_fetch)

if bulk_results:
    process_bulk_results(bulk_results)

    # Example: Save audio URLs for batch download
    audio_urls = [
        bulk_results.get(result, {}).get("audio_url") for result in bulk_results
    ]
    print(f"\nExtracted {len(audio_urls)} audio URLs for batch processing")
```

## Best Practices for Effective Use

To maximize the value of this endpoint, consider these strategies:

1. **Group Projects Strategically**: Organize `run_ids` by priority, language pairs, or deadlines to align with your team's workflow.
2. **Batch Efficiently**: Balance the number of `run_ids` in each request to ensure fast response times and manageable data processing.


## OpenAPI

````yaml post /project-setup-results
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://client.camb.ai/apis
security: []
paths:
  /project-setup-results:
    post:
      tags:
        - APIs
        - Project Setup
      summary: Get Project Setup Runs Results
      operationId: get_project_setup_runs_results_project_setup_results_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunIDsRequestPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkProjectSetupRunsResults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    RunIDsRequestPayload:
      properties:
        run_ids:
          items:
            type: integer
            exclusiveMinimum: 0
          type: array
          maxItems: 5
          minItems: 2
          uniqueItems: true
          title: Run IDs
          description: >-
            An array of unique positive integers, each representing the ID of a
            specific run. You must provide between 2 and 5 IDs, and all IDs must
            correspond to the same run type (e.g., all text-to-speech or all
            dubbing runs).
          example:
            - 12345
            - 6789
      type: object
      required:
        - run_ids
      title: RunIDsRequestPayload
    BulkProjectSetupRunsResults:
      type: array
      title: BulkProjectSetupRunsResults
      items:
        $ref: '#/components/schemas/GetCreateProjectSetupResponse'
      minItems: 1
      maxItems: 5
      description: >-
        An array containing the results of one to five project setup runs. Each
        item in the array is an object that contains the project details.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GetCreateProjectSetupResponse:
      properties:
        run_id:
          type: integer
          minimum: 0
          title: Run ID
          description: >-
            The unique identifier for the run, which was generated during the
            Project setup process and returned upon task completion.
        project_details:
          $ref: '#/components/schemas/RunDetails'
    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
    RunDetails:
      type: object
      properties:
        project_name:
          type: string
          title: Project Name
          minLength: 3
          maxLength: 255
          description: >-
            This represents the human-readable project identifier you provided
            when creating the project setup. Think of this as the project's
            display name that appears throughout CAMB.AI Studio, helping your
            team quickly identify which content piece they're working with.
        project_description:
          type: string
          title: Project Description
          minLength: 3
          maxLength: 5000
          nullable: true
          description: >-
            This field contains the detailed project context you provided during
            setup, serving as documentation that travels with your project
            throughout its lifecycle. The description becomes particularly
            valuable when projects move between team members or when you return
            to work after time has passed.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: >-
            This timestamp in UTC timezone marks the exact moment your project
            setup was initiated, providing crucial information for workflow
            coordination and project management.
        source_language:
          $ref: '#/components/schemas/SourceLanguages'
          description: >-
            This identifies the original language of your media content,
            representing one of the most critical configuration decisions that
            influences every subsequent processing step.
        target_languages:
          items:
            $ref: '#/components/schemas/Languages'
          type: array
          title: Target Languages
          description: >-
            This array contains all the languages you've requested for dubbing
            output, and each entry will be available in your CAMB.AI Studio
            project.
        folder_id:
          type: integer
          minimum: 0
          nullable: true
          description: >-
            This optional field indicates the organizational folder where your
            project resides within your team's workspace structure. Think of
            this as your project's filing location within CAMB.AI Studio,
            helping maintain organized project management as your content
            library grows.
          example: <number>
        studio_url:
          type: string
          description: >-
            This field contains the direct URL link to access your project
            within CAMB.AI Studio's web interface. Once your project setup is
            complete, this URL serves as the primary entry point for all
            creative work, allowing you and your team members to navigate
            directly to the project's workspace where you can review
            transcripts, adjust timing, refine translations, and manage the
            dubbing process. 
    SourceLanguages:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
        - 27
        - 28
        - 29
        - 30
        - 31
        - 32
        - 33
        - 34
        - 35
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
        - 45
        - 46
        - 47
        - 48
        - 49
        - 50
        - 51
        - 52
        - 53
        - 54
        - 55
        - 56
        - 57
        - 58
        - 59
        - 60
        - 61
        - 62
        - 63
        - 64
        - 65
        - 66
        - 67
        - 68
        - 69
        - 70
        - 71
        - 73
        - 74
        - 75
        - 76
        - 78
        - 79
        - 80
        - 81
        - 82
        - 83
        - 84
        - 85
        - 86
        - 87
        - 88
        - 90
        - 91
        - 92
        - 93
        - 94
        - 95
        - 96
        - 97
        - 98
        - 99
        - 100
        - 101
        - 102
        - 103
        - 104
        - 106
        - 107
        - 108
        - 109
        - 110
        - 111
        - 112
        - 113
        - 114
        - 115
        - 116
        - 117
        - 118
        - 119
        - 120
        - 121
        - 122
        - 123
        - 124
        - 125
        - 126
        - 127
        - 128
        - 129
        - 130
        - 131
        - 132
        - 133
        - 134
        - 135
        - 136
        - 139
        - 140
        - 141
        - 142
        - 143
        - 144
        - 145
        - 146
        - 148
      default: 1
    Languages:
      type: integer
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19
        - 20
        - 21
        - 22
        - 23
        - 24
        - 25
        - 26
        - 27
        - 28
        - 29
        - 30
        - 31
        - 32
        - 33
        - 34
        - 35
        - 36
        - 37
        - 38
        - 39
        - 40
        - 41
        - 42
        - 43
        - 44
        - 45
        - 46
        - 47
        - 48
        - 49
        - 50
        - 51
        - 52
        - 53
        - 54
        - 55
        - 56
        - 57
        - 58
        - 59
        - 60
        - 61
        - 62
        - 63
        - 64
        - 65
        - 66
        - 67
        - 68
        - 69
        - 70
        - 71
        - 72
        - 73
        - 74
        - 75
        - 76
        - 77
        - 78
        - 79
        - 80
        - 81
        - 82
        - 83
        - 84
        - 85
        - 86
        - 87
        - 88
        - 89
        - 90
        - 91
        - 92
        - 93
        - 94
        - 95
        - 96
        - 97
        - 98
        - 99
        - 100
        - 101
        - 102
        - 103
        - 104
        - 105
        - 106
        - 107
        - 108
        - 109
        - 110
        - 111
        - 112
        - 113
        - 114
        - 115
        - 116
        - 117
        - 118
        - 119
        - 120
        - 121
        - 122
        - 123
        - 124
        - 125
        - 126
        - 127
        - 128
        - 129
        - 130
        - 131
        - 132
        - 133
        - 134
        - 135
        - 136
        - 139
        - 140
        - 141
        - 142
        - 143
        - 144
        - 145
        - 146
        - 147
        - 148
        - 149
        - 150
      title: Languages
      default: 1
  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.

````