---
docId: doc_474833151a794df993ca1f187735d41a
title: Reprocess a file
description: Re-read a web file's page or the original document that was uploaded, without changing it. Use it to refresh a page now and to retry a processing that failed.
api:
  group: archivos
  auth: bearer
  operations:
    - operationId: reprocessFile
      method: POST
      path: '/v1/files/{fileId}/reprocess'
      postmanName: Reprocess a file
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Reprocess a file

Read a file’s source again or retry failed processing. Send its `fileId`, with no body or with `{}`:

- On a **`url`** file, it re-reads the page now (in the platform, **Update now**).
- On a **`file`** or **`text`** file, it reprocesses the original that was stored (**Reprocess**).
- On a file whose last processing **failed**, it tries again (**Retry**).

While it is processing, agents keep using the previous content. If the resulting text is the same as the one already in use, it ends in `ready` with `result: "unchanged"` and nothing changes.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST "https://api.platic.ai/v1/files/$FILE_ID/reprocess" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.files.reprocess("file_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `fileId` | string | The file | ✓ |

## Request body

Empty. You can send no body or an empty object:

```json
{}
```

## Response

`202 Accepted`:

```json
{
  "status": "success",
  "data": {
    "accepted": true,
    "fileId": "fH3kL9mQ2xR7",
    "uploadId": "up_3Hs8Kq1Vm5",
    "link": null,
    "statusUrl": "/v1/files/fH3kL9mQ2xR7/jobs/up_3Hs8Kq1Vm5"
  }
}
```

## Response fields

The response uses the fields from [Create a file](/api-reference/files/create#response-fields), with `link: null` because connections do not change. Poll the [processing job](/api-reference/files/processing) until `terminal` is `true`. Its `trigger` is `reprocess`; `result` shows whether the content changed. For a `url` file, completion updates `refresh.lastRunAt`, `lastResult` and `nextRunAt`.

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `403` | `RESOURCE_NOT_ACCESSIBLE` | You do not have Integrations nor can you edit all the agents that use it. |
| `409` | `FILE_JOB_IN_PROGRESS` | There is already an open processing on this file. Wait for it to finish. |
| `409` | `SOURCE_UNAVAILABLE` | There is no stored original or page to read (for example, an upload that never finished). Replace it with new content. |
| `410` | `FILE_DELETED` | The file was already deleted. |
| `429` | `QUOTA_EXCEEDED` | There are already 30 open processings in the workspace. |

The ones that apply to all operations are in [common errors](/api-reference/files#common-errors).

<Note type="note">

Reprocessing does not change the title, the description or the page. To change the source, use [replace the content](/api-reference/files/update#replace-the-content). To have a page read itself every so often, [keep it up to date](/api-reference/files/update#keep-a-page-up-to-date).

</Note>
