---
title: "Attach a file to a project"
method: POST
path: "/projects/{id}/files"
tags: ["Projects"]
---

# Attach a file to a project

`POST /projects/{id}/files`

## Request

- Base URL: `https://app.gc.ai/api/external/v1`
- URL: `https://app.gc.ai/api/external/v1/projects/{id}/files`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/gc-ai/apis/gc-ai-external-api/docs/projects/:id/files/post.ts> (a function with typed inputs; its response is checked against the schema)

Attach an already-uploaded file to a project. The file remains in its current folder; this only records the project link.

Requires write access to the project and read access to the file. Org-scoped keys can attach non-access-controlled files to non-access-controlled projects.

## Path parameters

- `id` string, uuid, required: The project ID

## Request body

- AttachFileRequest
  - `file_id` string, uuid, required: ID of an already-uploaded file to attach to the project

## Response `204`

File attached (idempotent, repeat calls are no-ops)

## Other responses

- `400`: Invalid request body
- `401`: Missing or malformed API key
- `403`: Invalid API key
- `404`: Project not found, file not found, or insufficient write access
- `429`: Rate limit exceeded. See [Rate Limits](https://docs.gc.ai/api-reference/concepts/rate-limits) for the tiers, limits, and how to back off.
- `500`: Internal server error
- `503`: Service temporarily unavailable

---

[API](https://skmtc.dev/gc-ai/apis/gc-ai-external-api.md) - [All operations](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gc-ai/apis/gc-ai-external-api/revisions/2bbdfddf7107?raw)
