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

# Update Disposition

> Update an existing disposition

## Overview

Update an existing disposition. Only the fields you provide will be updated; all other fields remain unchanged.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication (e.g., `Bearer <your_token>`).
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the disposition to update
</ParamField>

## Request Body

<ParamField body="name" type="string">
  Disposition name (max 100 characters)
</ParamField>

<ParamField body="description" type="string">
  Disposition description (max 1000 characters)
</ParamField>

<ParamField body="priority" type="integer">
  Priority level from 0-1000
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  Response message
</ResponseField>

<ResponseField name="updatedFields" type="array">
  List of fields that were updated
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Disposition updated successfully",
    "updatedFields": ["name", "priority"]
  }
  ```

  ```json 400 Validation Error theme={null}
  {
    "success": false,
    "message": "Validation failed",
    "errors": [
      "priority must be between 0 and 1000"
    ]
  }
  ```

  ```json 400 No Fields theme={null}
  {
    "success": false,
    "message": "No valid fields provided for update"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "error": "Unauthorized",
    "message": "Missing or invalid authorization header"
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "success": false,
    "error": "Forbidden",
    "message": "You don't have the required permission to perform this action"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Disposition not found"
  }
  ```

  ```json 409 Duplicate theme={null}
  {
    "success": false,
    "message": "Disposition with name \"Pay in Coming Days\" already exists"
  }
  ```

  ```json 500 Server Error theme={null}
  {
    "success": false,
    "error": "InternalServerError",
    "message": "An unexpected error occurred"
  }
  ```
</ResponseExample>

## Error Codes

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `400`  | Validation error or no valid fields provided |
| `401`  | Unauthorized - Invalid or missing API key    |
| `403`  | Forbidden - Missing required permissions     |
| `404`  | Disposition not found                        |
| `409`  | A disposition with this name already exists  |
| `500`  | Internal server error                        |
