---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/files"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/files"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/files

`POST /v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/files`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/publishers/{publishersId}/files`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Uploads a file that can be referenced by ID from subsequent Claude model requests.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `publishersId` string, required

## Request body

- GoogleCloudAiplatformV1CreateFileRequest: Request message for ClaudeFileService.CreateFile.

## Response `200`

Successful response

- GoogleCloudAiplatformV1ClaudeFile: A file that can be referenced by ID from subsequent Claude model requests. The JSON representation of this message matches the Claude Files API File object field-for-field, so that code written against that API parses these responses unchanged.
  - `created_at` string, google-datetime: Output only. The time at which the file was created.
  - `downloadable` boolean: Output only. Whether the contents of this file can be retrieved with `DownloadFile`. False for user-uploaded files, true for tool-generated ones.
  - `expires_at` string, google-datetime: Output only. The time at which the file expires and is deleted, set from the `expires_in_seconds` upload form field. Unset for files that do not expire, which is serialised as `null`.
  - `filename` string: Output only. The original name of the uploaded file, taken from the `Content-Disposition` header on upload. Between 1 and 255 characters. Control characters and the characters `<>:"|?*\/` are not accepted.
  - `id` string: Output only. The server-assigned identifier of the file, for example `file_abc123`. This is the ID to pass in subsequent model requests.
  - `mime_type` string: Output only. The media type of the file, taken from the `Content-Type` header of the file part on upload.
  - `size_bytes` integer: Output only. The size of the file in bytes.
  - `type` string: Output only. The object type. Always `file`.

---

[API](https://skmtc.dev/google/apis/aiplatform.md) - [All operations](https://skmtc.dev/google/apis/aiplatform/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/aiplatform/revisions/3aca3b348f0c?raw)
