# Finish an upload

Source: https://deeperesearch.com/docs/api/reference/operations/completefile/

POST

/v1/files/{id}/complete

```js
const url = 'https://deeperesearch.com/v1/files/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request POST \
  --url https://deeperesearch.com/v1/files/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete \
  --header 'Authorization: Bearer <token>'
```

Step 3: tells Deeper Research the bytes are uploaded. The text is then read in the background; poll GET /v1/files/{id} until status is ready.

## Authorizations

- **[apiKey](https://deeperesearch.com/docs/api/reference/#apikey)**

## Parameters

### Path Parameters

**id**

required

string format: uuid

## Responses

### 202

The file, now processing

application/json

object

**id**

required

string format: uuid

**object**

required

string

Allowed value: file

**filename**

required

string

**mime_type**

required

string

**size_bytes**

required

integer

\>= -9007199254740991 <= 9007199254740991

**status**

required

string

Allowed values: awaiting_upload processing ready failed

**text_chars**

required

Characters of text read from the file

Any of:

- integer

  integer

  \>= -9007199254740991 <= 9007199254740991

- null

  null

**note**

required

string | null

**created_at**

required

ISO 8601 timestamp, UTC

string

#### Example

```json
{
  "object": "file",
  "status": "awaiting_upload"
}
```

### 401

Missing or invalid API key (unauthorized)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 403

The key lacks the scope this needs (forbidden)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 404

Not found in this organization (not_found)

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```

### 429

Rate limit, spending limit or quota reached (rate_limited, limit_reached, quota_exceeded). See Retry-After.

application/json

object

**error**

required

object

**code**

required

Stable, machine-readable error code. See Errors in the docs.

string

**message**

required

What went wrong, written for people

string

#### Example generated

```json
{
  "error": {
    "code": "example",
    "message": "example"
  }
}
```
