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

# List All Dataset Deliveries

> Lists of [Deliveries](/core-resources/dataset-delivery) from datasets.

<Accordion title="Authentication" icon="key">
  Every request sent to Scale's API requires authentication. In short, your API Key is the Bearer token. See the [Authentication](/get-started/authentication) section for more details.
</Accordion>

<Tip>
  ### Required query parameters

  You are expected to provide the following to find deliveries:

  * `dataset_id` - The ID of the Scale dataset.
</Tip>


## OpenAPI

````yaml GET /v2/datasets/deliveries
openapi: 3.1.0
info:
  title: GenAI API Spec
  description: 'Data Engine: Generative AI API Specification'
  version: 0.0.1
servers:
  - url: https://api.scale.com
security:
  - bearerAuth: []
  - basicAuth: []
paths:
  /v2/datasets/deliveries:
    get:
      tags:
        - v2
      summary: List All Dataset Deliveries
      description: Lists of [Deliveries](/core-resources/dataset-delivery) from datasets.
      operationId: getDatasetDeliveries
      parameters:
        - $ref: '#/components/parameters/dataset_id'
        - $ref: '#/components/parameters/delivered_after'
        - $ref: '#/components/parameters/delivered_before'
        - $ref: '#/components/parameters/datasets_expand_deliveries'
      responses:
        '200':
          description: List of deliveries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDatasetDeliveriesResponse'
              examples:
                Sample Dataset Deliveries:
                  value:
                    deliveries:
                      - id: delivery_abc123
                        name: My Delivery - 2024-01-15
                        delivered_at: '2024-01-15T10:30:00Z'
                        metadata:
                          task_count: 100
                          turn_count: 100
                        dataset: dataset_abc123
                      - id: delivery_def456
                        name: My Delivery - 2024-01-16
                        delivered_at: '2024-01-16T10:30:00Z'
                        metadata:
                          task_count: 100
                          turn_count: 100
                        dataset: dataset_def456
        '500':
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status_code:
                    type: number
                    example: 500
                  error:
                    type: string
                    example: An error has occurred.
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            API_KEY='live_...'
            curl --request GET \
                --url "https://api.scale.com/v2/datasets/deliveries" \
                --header "Authorization: Bearer $API_KEY"
        - lang: python
          label: Python SDK
          source: |
            import scaleapi

            API_KEY = 'live_...'
            client = scaleapi.ScaleClient(API_KEY)

            response = client.v2.get_dataset_deliveries()
            print(response.to_json())
        - lang: python
          label: Python
          source: |
            import requests

            API_KEY = 'live_...'

            response = requests.request(
              "GET",
              url="https://api.scale.com/v2/datasets/deliveries",
              headers={
                "Accept": "application/json",
                "Authorization": f"Bearer {API_KEY}",
              },
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >
            const API_KEY = 'live_...';


            const response = await
            fetch('https://api.scale.com/v2/datasets/deliveries', {
              method: 'GET',
              headers: {
                'Accept': 'application/json',
                'Authorization': `Bearer ${API_KEY}`,
              },
            });

            console.log(await response.json());
        - lang: go
          label: Go
          source: |
            package main

            import (
              "fmt"
              "net/http"
              "io/ioutil"
            )

            func main() {
              apiKey := "live_..."

              url := "https://api.scale.com/v2/datasets/deliveries"

              req, _ := http.NewRequest("GET", url, nil)

              req.Header.Add("Accept", "application/json")
              req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", apiKey))

              res, _ := http.DefaultClient.Do(req)

              defer res.Body.Close()
              body, _ := ioutil.ReadAll(res.Body)

              fmt.Println(string(body))
            }
        - lang: java
          label: Java
          source: |
            import com.mashape.unirest.http.*;
            import com.mashape.unirest.http.exceptions.*;

            public class Main {
                public static void main(String[] args) throws UnirestException {
                    String apiKey = "live_...";

                    String url = "https://api.scale.com/v2/datasets/deliveries";

                    HttpResponse<String> response = Unirest.get(url)
                      .header("Accept", "application/json")
                      .header("Authorization", String.format("Bearer %s", apiKey))
                      .asString();

                    System.out.println(response.getBody());
                }
            }
components:
  parameters:
    dataset_id:
      name: dataset_id
      in: query
      required: false
      description: Scale's unique identifier for the dataset.
      schema:
        $ref: '#/components/schemas/DatasetId'
    delivered_after:
      name: delivered_after
      in: query
      required: false
      description: >-
        Deliveries with a `delivered_at` after the given date will be returned.
        A timestamp formatted as an ISO 8601 date-time string.
      schema:
        $ref: '#/components/schemas/DateString'
    delivered_before:
      name: delivered_before
      in: query
      required: false
      description: >-
        Deliveries with a `delivered_at` before the given date will be returned.
        A timestamp formatted as an ISO 8601 date-time string.
      schema:
        $ref: '#/components/schemas/DateString'
    datasets_expand_deliveries:
      name: expand
      in: query
      required: false
      description: >-
        List of fields to [expand](/api-reference/expanding-entities) in the
        response.
      schema:
        $ref: '#/components/schemas/ExpandDatasetsDeliveries'
  schemas:
    GetDatasetDeliveriesResponse:
      type: object
      required:
        - deliveries
      properties:
        deliveries:
          type: array
          items:
            $ref: '#/components/schemas/DatasetDelivery'
    DatasetId:
      type: string
      description: Unique identifier for a dataset
      example: dataset_abc123
    DateString:
      type: string
      format: date-time
      description: A timestamp formatted as an ISO 8601 date-time string.
    ExpandDatasetsDeliveries:
      type: array
      description: >-
        Entities that can be [expanded](/api-reference/expanding-entities) from
        an ID to an object.
      items:
        $ref: '#/components/schemas/ExpandableEnumDatasetsDeliveries'
    DatasetDelivery:
      type: object
      required:
        - id
        - name
        - delivered_at
        - metadata
      properties:
        id:
          $ref: '#/components/schemas/DatasetDeliveryId'
        name:
          type: string
          description: The name of the delivery
          example: My Delivery - 2024-01-15
        delivered_at:
          $ref: '#/components/schemas/DateString'
          description: UTC timestamp when the delivery was created.
        dataset:
          $ref: '#/components/schemas/ExpandableDataset'
        metadata:
          $ref: '#/components/schemas/DatasetDeliveryMetadata'
    ExpandableEnumDatasetsDeliveries:
      type: string
      description: Entities that can be expanded from an ID to an object.
      enum:
        - dataset
    DatasetDeliveryId:
      type: string
      description: Unique identifier for a delivery
      example: delivery_abc123
    ExpandableDataset:
      description: >-
        Dataset ID or [Dataset](/core-resources/dataset) associated with the
        task.
      oneOf:
        - $ref: '#/components/schemas/DatasetId'
        - $ref: '#/components/schemas/Dataset'
    DatasetDeliveryMetadata:
      type: object
      properties:
        task_count:
          type: integer
          description: The number of tasks in the delivery
          example: 1000
        turn_count:
          type: integer
          description: The number of turns in the delivery
          example: 1000
    Dataset:
      type: object
      required:
        - id
        - name
      properties:
        id:
          $ref: '#/components/schemas/DatasetId'
        name:
          $ref: '#/components/schemas/DatasetName'
    DatasetName:
      type: string
      description: The name of the dataset
      example: My Scale Dataset
  securitySchemes:
    bearerAuth:
      description: >-
        Your API Key is the Bearer token. See the
        [Authentication](/get-started/authentication) section to learn how to
        access your key.
      type: http
      scheme: bearer
    basicAuth:
      description: >-
        Basic HTTP Authentication. Your API Key is your username.  Learn more
        about setting up Authentication [here](/get-started/authentication).
      type: http
      scheme: basic

````