{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/letta/json-schema/letta-approval-response-message-schema.json",
  "title": "ApprovalResponseMessage",
  "description": "A message representing a response form the user indicating whether a tool has been approved to run.\n\nArgs:\n    id (str): The ID of the message\n    date (datetime): The date the message was created in ISO format\n    name (Optional[str]): The name of the sender of the message\n    approve: (bool) Whether the tool has been approved\n    approval_request_id: The ID of the approval request\n    reason: (Optional[str]) An optional explanation for the provided approval status",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/letta-conversations-api-openapi.yml#/components/schemas/ApprovalResponseMessage",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "date": {
      "type": "string",
      "format": "date-time",
      "title": "Date"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "message_type": {
      "type": "string",
      "const": "approval_response_message",
      "title": "Message Type",
      "description": "The type of the message.",
      "default": "approval_response_message"
    },
    "otid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Otid",
      "description": "The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs."
    },
    "sender_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sender Id"
    },
    "step_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Step Id"
    },
    "is_err": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Err"
    },
    "seq_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Seq Id"
    },
    "run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Run Id"
    },
    "approvals": {
      "anyOf": [
        {
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/ApprovalReturn"
              },
              {
                "$ref": "#/$defs/letta__schemas__letta_message__ToolReturn"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Approvals",
      "description": "The list of approval responses"
    },
    "approve": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Approve",
      "description": "Whether the tool has been approved",
      "deprecated": true
    },
    "approval_request_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Approval Request Id",
      "description": "The message ID of the approval request",
      "deprecated": true
    },
    "reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Reason",
      "description": "An optional explanation for the provided approval status",
      "deprecated": true
    }
  },
  "type": "object",
  "required": [
    "id",
    "date"
  ],
  "$defs": {
    "ApprovalReturn": {
      "properties": {
        "type": {
          "type": "string",
          "const": "approval",
          "title": "Type",
          "description": "The message type to be created.",
          "default": "approval"
        },
        "tool_call_id": {
          "type": "string",
          "title": "Tool Call Id",
          "description": "The ID of the tool call that corresponds to this approval"
        },
        "approve": {
          "type": "boolean",
          "title": "Approve",
          "description": "Whether the tool has been approved"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason",
          "description": "An optional explanation for the provided approval status"
        }
      },
      "type": "object",
      "required": [
        "tool_call_id",
        "approve"
      ],
      "title": "ApprovalReturn"
    },
    "Base64Image": {
      "properties": {
        "type": {
          "type": "string",
          "const": "base64",
          "title": "Type",
          "description": "The source type for the image.",
          "default": "base64"
        },
        "media_type": {
          "type": "string",
          "title": "Media Type",
          "description": "The media type for the image."
        },
        "data": {
          "type": "string",
          "title": "Data",
          "description": "The base64 encoded image data."
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "description": "What level of detail to use when processing and understanding the image (low, high, or auto to let the model decide)"
        }
      },
      "type": "object",
      "required": [
        "media_type",
        "data"
      ],
      "title": "Base64Image"
    },
    "ImageContent": {
      "properties": {
        "type": {
          "type": "string",
          "const": "image",
          "title": "Type",
          "description": "The type of the message.",
          "default": "image"
        },
        "source": {
          "oneOf": [
            {
              "$ref": "#/$defs/UrlImage"
            },
            {
              "$ref": "#/$defs/Base64Image"
            },
            {
              "$ref": "#/$defs/LettaImage"
            }
          ],
          "title": "Source",
          "description": "The source of the image."
        }
      },
      "type": "object",
      "required": [
        "source"
      ],
      "title": "ImageContent"
    },
    "LettaImage": {
      "properties": {
        "type": {
          "type": "string",
          "const": "letta",
          "title": "Type",
          "description": "The source type for the image.",
          "default": "letta"
        },
        "file_id": {
          "type": "string",
          "title": "File Id",
          "description": "The unique identifier of the image file persisted in storage."
        },
        "media_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Media Type",
          "description": "The media type for the image."
        },
        "data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data",
          "description": "The base64 encoded image data."
        },
        "detail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Detail",
          "description": "What level of detail to use when processing and understanding the image (low, high, or auto to let the model decide)"
        }
      },
      "type": "object",
      "required": [
        "file_id"
      ],
      "title": "LettaImage"
    },
    "LettaToolReturnContentUnion": {
      "oneOf": [
        {
          "$ref": "#/$defs/TextContent"
        },
        {
          "$ref": "#/$defs/ImageContent"
        }
      ]
    },
    "TextContent": {
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "title": "Type",
          "description": "The type of the message.",
          "default": "text"
        },
        "text": {
          "type": "string",
          "title": "Text",
          "description": "The text content of the message."
        },
        "signature": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Signature",
          "description": "Stores a unique identifier for any reasoning associated with this text content."
        }
      },
      "type": "object",
      "required": [
        "text"
      ],
      "title": "TextContent"
    },
    "UrlImage": {
      "properties": {
        "type": {
          "type": "string",
          "const": "url",
          "title": "Type",
          "description": "The source type for the image.",
          "default": "url"
        },
        "url": {
          "type": "string",
          "title": "Url",
          "description": "The URL of the image."
        }
      },
      "type": "object",
      "required": [
        "url"
      ],
      "title": "UrlImage"
    },
    "letta__schemas__letta_message__ToolReturn": {
      "properties": {
        "type": {
          "type": "string",
          "const": "tool",
          "title": "Type",
          "description": "The message type to be created.",
          "default": "tool"
        },
        "tool_return": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LettaToolReturnContentUnion"
              },
              "type": "array"
            },
            {
              "type": "string"
            }
          ],
          "title": "Tool Return",
          "description": "The tool return value - either a string or list of content parts (text/image)"
        },
        "status": {
          "type": "string",
          "enum": [
            "success",
            "error"
          ],
          "title": "Status"
        },
        "tool_call_id": {
          "type": "string",
          "title": "Tool Call Id"
        },
        "stdout": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stdout"
        },
        "stderr": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stderr"
        }
      },
      "type": "object",
      "required": [
        "tool_return",
        "status",
        "tool_call_id"
      ],
      "title": "ToolReturn"
    }
  }
}