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

# Update batch metadata

> Updates user-defined metadata fields for the batch with provided id. This includes the webhook_url. Explicitly passing an empty string for webhook_url to the request body will remove/clear any webhook url from the batch.



## OpenAPI

````yaml openapi-v0.1.json put /v0.1/batches/{id}
openapi: 3.0.0
info:
  title: API Documentation
  description: API description
  version: '0.1'
  contact: {}
servers:
  - url: https://api.promptloop.com/
    description: Production API v0.1
security: []
tags: []
paths:
  /v0.1/batches/{id}:
    put:
      tags:
        - Batches
      summary: Update batch metadata
      description: >-
        Updates user-defined metadata fields for the batch with provided id.
        This includes the webhook_url. Explicitly passing an empty string for
        webhook_url to the request body will remove/clear any webhook url from
        the batch.
      operationId: BatchesController_updateBatchById
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchUpdateBodyDataDto'
      responses:
        '200':
          description: Successfully updated batch with provided id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBatchDataWithStatusResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    BatchUpdateBodyDataDto:
      type: object
      properties:
        webhook_url:
          type: string
          description: >-
            Webhook url to send data to upon batch completion. Provide an empty
            string to clear any existing webhook url assigned to the batch
            execution.
          example: https://api.example.com/updated-webhook/batch-results
    GetBatchDataWithStatusResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: success
        data:
          $ref: '#/components/schemas/BatchDataWithStatusResponseDto'
        message:
          type: string
        error:
          $ref: '#/components/schemas/ErrorDetailsDto'
      required:
        - status
        - data
        - message
    ErrorResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: error
        data:
          type: object
        message:
          type: string
        error:
          $ref: '#/components/schemas/ErrorDetailsDto'
      required:
        - status
        - data
        - message
    BatchDataWithStatusResponseDto:
      type: object
      properties:
        batch_id:
          type: string
        task_id:
          type: string
        task_version:
          type: string
        batch_name:
          type: string
        created_at:
          format: date-time
          type: string
        completed:
          type: boolean
        cancelled:
          type: boolean
        jobs_submitted:
          type: number
        jobs_completed:
          type: number
        job_status:
          type: string
      required:
        - batch_id
        - task_id
        - task_version
        - batch_name
        - created_at
        - completed
        - cancelled
        - jobs_submitted
        - jobs_completed
        - job_status
    ErrorDetailsDto:
      type: object
      properties:
        code:
          type: number
        details:
          type: string
      required:
        - code
        - details
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````