---
title: "Add file to graph"
method: POST
path: "/v1/graphs/{graph_id}/file"
tags: ["KG API"]
---

# Add file to graph

`POST /v1/graphs/{graph_id}/file`

Add a file to a Knowledge Graph.

## Path parameters

- `graph_id` string, uuid, required

## Request body

- GraphFileRequest
  - `file_id` string, required — The unique identifier of the file.

## Response `200`

- FileResponse
  - `id` string, required — A unique identifier of the file.
  - `created_at` string, date-time, required — The timestamp when the file was uploaded.
  - `name` string, required — The name of the file.
  - `graph_ids` string[], required — A list of Knowledge Graph IDs that the file is associated with. If you provided a `graphId` during upload, the file is associated with that Knowledge Graph. However, the `graph_ids` field in the upload response is an empty list. The association will be visible in the `graph_ids` list when you retrieve the file using the file retrieval endpoint.
  - `status` string, required — The processing status of the file.

## Changes

- **2024-09-20** `149f74d46fcb` — 1 info
  - added the required property `status` to the response with the `200` status

[Change history](https://skmtc.dev/writer/apis/api/changes/v1/graphs/:graph_id/file/post.md)

---

[API](https://skmtc.dev/writer/apis/api.md) · [All operations](https://skmtc.dev/writer/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/writer/api/revisions/ae230e1d8c09/schema)
