---
title: "Register File"
method: POST
path: "/document/extraction/register_file"
tags: ["Extraction"]
---

# Register File

`POST /document/extraction/register_file`

## Endpoint to Register a File for Extraction
This endpoint registers a file for extraction and returns a presigned URL for the file upload.

***

## Request Body

| Field               | Type   | Description                      |
|---------------------|--------|----------------------------------|
| extraction_job_id   | str    | The ID of the extraction job.    |
| file_name           | str    | The name of the file to register. |

***

## Response Body

 | Field               | Type   | Description                      |
|---------------------|--------|----------------------------------|
| extraction_job_id   | str    | The ID of the extraction job.    |
| file_name           | str    | The name of the registered file. |
| file_id             | str    | The ID of the registered file.   |
| upload_url          | str    | The presigned URL for file upload. |

***

#### Errors

- **400 Bad Request**: If the file name is invalid or already registered for the job.
- **500 Internal Server Error**: If there is an unexpected error during the registration of the file.

## Request body

- RegisterFileRequest
  - `extraction_job_id` string, required
  - `file_name` string, required

## Response `200`

Successful Response

- RegisterFileResponse
  - `extraction_job_id` string, required
  - `file_name` string, required
  - `file_id` string, required
  - `upload_url` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/aws-samples/apis/generative-ai-foundational-platform-api.md) · [All operations](https://skmtc.dev/aws-samples/apis/generative-ai-foundational-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aws-samples/generative-ai-foundational-platform-api/revisions/8831d08902e9/schema)
