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

# Revisar y editar tu archivo

> Sube un documento y deja que Doconda lo arregle o lo cambie como le pidas.

## Subir el fichero

<CodeGroup>
  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  import { readFile } from "node:fs/promises"

  const file = await doconda.files.upload(await readFile("contrato.docx"), "contrato.docx")
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  file = doconda.files.upload("contrato.docx")
  ```
</CodeGroup>

Acepta Word, PDF, PowerPoint, Excel (también `.doc`, `.ppt` y `.xls`), TXT, Markdown e imágenes, hasta 20 MB. En un
servidor que ya recibe ficheros (de un formulario, por ejemplo), puedes pasar directamente un `Blob` o un `File`, con su
nombre como segundo argumento. En Python acepta una ruta, `bytes` (con `filename`) o un fichero abierto.

## Revisar

Sin IA: Doconda busca problemas en tu Word, PowerPoint, Excel o PDF (tablas que se salen, firmas partidas, textos
que no caben, fórmulas con errores, páginas escaneadas sin texto…) y arregla los seguros sin tocar el contenido. La
lista completa está en [Revisar](/es/guides/review).

<CodeGroup>
  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  const reviewed = await doconda.documents.create({ operation: "review", file: file.id })
  const report = await doconda.documents.report(reviewed.id)

  for (const fix of report.ledger) console.log(fix) // cada arreglo: aplicado o rechazado, y por qué
  for (const issue of report.issues) console.log(issue.message) // lo que queda por mirar
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  reviewed = doconda.documents.create(operation="review", file=file["id"])
  report = doconda.documents.report(reviewed["id"])

  for fix in report["ledger"]:
      print(fix)  # cada arreglo: aplicado o rechazado, y por qué
  for issue in report["issues"]:
      print(issue["message"])  # lo que queda por mirar
  ```
</CodeGroup>

## Editar

Pide los cambios en una frase. Doconda cambia solo lo que pides y deja intacto el resto del documento.

<CodeGroup>
  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  const edited = await doconda.documents.create({
    operation: "edit",
    file: file.id,
    prompt: "Títulos en azul y añade una cláusula de confidencialidad",
  })
  const { edits } = await doconda.documents.report(edited.id)
  // cada cambio, con el texto de antes y el de después
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  edited = doconda.documents.create(
      operation="edit",
      file=file["id"],
      prompt="Títulos en azul y añade una cláusula de confidencialidad",
  )
  edits = doconda.documents.report(edited["id"])["edits"]
  # cada cambio, con el texto de antes y el de después
  ```
</CodeGroup>

Si algo de lo que pides no se puede hacer, aparece como `rejected` en `edits`, con el motivo.

## Borrar el fichero

<CodeGroup>
  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  await doconda.files.delete(file.id)
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  doconda.files.delete(file["id"])
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.