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

# Elementi del Batch

> Recupera l’elenco degli elementi elaborati per un batch. Puoi quindi utilizzare il `retrieve_id` per ottenere il contenuto con l’Endpoint Retrieve

<Tip>
  **Metadati:** Se hai allegato `metadata` a singoli elementi durante la [creazione del batch](/api-reference/batches/create), verranno restituiti con ciascun elemento nella risposta.
</Tip>


## OpenAPI

````yaml it/openapi/batches.json GET /v1/batches/{batch_id}/items
openapi: 3.0.3
info:
  title: API dei Batch
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/batches/{batch_id}/items:
    get:
      summary: >-
        Recupera l'elenco degli elementi completati o falliti opzionalmente con
        contenuto per un batch specifico
      description: >-
        Recupera l'elenco degli elementi e del contenuto secondo lo stato
        richiesto per un ID batch specifico.
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
          description: L'ID del batch per cui recuperare gli elementi.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - completed
              - failed
          description: Stato degli URL da recuperare (completed o failed).
        - name: cursor
          in: query
          required: false
          schema:
            type: integer
          description: >-
            Cursore di paginazione. Ometti questo parametro alla prima
            richiesta. Per le richieste successive, usa il valore `cursor` dalla
            risposta precedente. Vedi
            [Paginazione](/api-reference/common/pagination) per i dettagli.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: Numero di risultati da restituire (consigliato 10-50).
      responses:
        '200':
          description: Risposta riuscita con elementi batch.
          content:
            application/json:
              schema:
                type: object
                properties:
                  batch_id:
                    type: string
                  object:
                    type: string
                  status:
                    type: string
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        custom_id:
                          type: string
                        retrieve_id:
                          type: string
                        url:
                          type: string
                        metadata:
                          allOf:
                            - $ref: '#/components/schemas/Metadata'
                          description: >-
                            Metadati a livello di elemento se forniti durante la
                            creazione del batch.
                        links_on_page:
                          type: array
                          items:
                            type: string
                  items_count:
                    type: integer
                  cursor:
                    type: integer
                    description: >-
                      Cursore di paginazione. Presente quando ci sono più
                      risultati disponibili. Usa questo valore nel parametro
                      `cursor` della prossima richiesta. Vedi
                      [Paginazione](/api-reference/common/pagination) per i
                      dettagli.
              example:
                batch_id: batch_abc123def456
                object: list
                status: completed
                items:
                  - custom_id: product-123
                    retrieve_id: ret_xyz789
                    url: https://example.com/product/123
                    metadata:
                      source: catalog_sync
                      priority: high
                  - custom_id: product-456
                    retrieve_id: ret_abc456
                    url: https://example.com/product/456
                items_count: 2
        '400':
          description: >-
            Richiesta errata a causa di parametri non corretti. Vedi [Richiesta
            Errata](/api-reference/errors/bad_request) per i dettagli.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: validation_error
                type: https://docs.olostep.com/api-reference/errors/bad_request
                status: 400
                title: Richiesta Errata
                detail: Status must be either 'completed' or 'failed'
                created: 1704067200
                metadata: {}
        '401':
          description: >-
            Le credenziali di autenticazione sono mancanti o non valide. Vedi
            [Unauthorized](/api-reference/errors/unauthorized) per i dettagli.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: invalid_api_key
                type: https://docs.olostep.com/api-reference/errors/unauthorized
                status: 401
                title: Non autorizzato
                detail: Your API key is invalid
                created: 1704067200
                metadata: {}
        '404':
          description: >-
            Batch non trovato per l'ID fornito. Vedi [Non
            Trovato](/api-reference/errors/not_found) per i dettagli.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: batch_not_found
                type: https://docs.olostep.com/api-reference/errors/not_found
                status: 404
                title: Non Trovato
                detail: Batch not found
                created: 1704067200
                metadata: {}
        '500':
          description: >-
            Errore interno del server. Vedi [Internal
            Error](/api-reference/errors/internal_error) per i dettagli.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                id: error_abc123
                object: error
                code: internal_server_error
                type: https://docs.olostep.com/api-reference/errors/internal_error
                status: 500
                title: Errore Interno del Server
                detail: An unexpected error occurred
                created: 1704067200
                metadata: {}
      security:
        - Authorization: []
components:
  schemas:
    Metadata:
      type: object
      description: >-
        Insieme di coppie chiave-valore per memorizzare informazioni aggiuntive
        su un oggetto. Segue l'approccio di Stripe con regole di validazione:
        massimo 50 chiavi, chiave massimo 40 caratteri (senza parentesi quadre),
        valore massimo 500 caratteri, tutti i valori memorizzati come stringhe.
      additionalProperties:
        type: string
        maxLength: 500
        description: >-
          Valore dei metadati (max 500 caratteri). Numeri e booleani sono
          automaticamente convertiti in stringhe.
      maxProperties: 50
      example:
        order_id: '12345'
        customer_name: John Doe
        priority: high
        processed: 'true'
      x-validation-rules:
        max_keys: 50
        key_max_length: 40
        key_forbidden_chars:
          - '['
          - ']'
        value_max_length: 500
        value_types:
          - string
          - number (coerced)
          - boolean (coerced)
    Error:
      type: object
      description: Risposta di errore Dettagli Problema RFC 7807
      properties:
        id:
          type: string
          description: Identificatore univoco dell'errore
        object:
          type: string
          enum:
            - error
          description: Sempre 'error'
        code:
          type: string
          description: Codice di errore leggibile dalla macchina
        type:
          type: string
          format: uri
          description: Riferimento URI che identifica il tipo di problema
        status:
          type: integer
          description: Codice di stato HTTP
        title:
          type: string
          description: Breve riassunto leggibile dall'uomo
        detail:
          type: string
          description: Spiegazione leggibile dall'uomo
        created:
          type: integer
          description: Timestamp Unix
        metadata:
          $ref: '#/components/schemas/Metadata'
        errors:
          type: array
          description: Array opzionale di dettagli aggiuntivi sull'errore
          items: {}
      required:
        - id
        - object
        - code
        - type
        - status
        - title
        - detail
        - created
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: >-
        Intestazione di autenticazione Bearer del tipo Bearer <token>, dove
        <token> è il tuo token di autenticazione.

````