POST/vector_stores/{vector_store_id}/files/{file_id}

Update vector store file attributes

Updates the attributes attached to a file in a vector store. Supply attributes to replace the file's attribute set, or use null to clear it.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 1 body field
vector_store_idstringrequired
The unique identifier of the vector store that contains the file.
file_idstringrequired
The unique identifier of the file whose attributes to update.

The replacement attribute set for the vector store file, or null to clear its attributes.

attributesobjectrequired
Key-value metadata to attach to the file. Supports up to 16 pairs, with keys no longer than 64 characters; set to `null` to clear the attributes.

6 status codes
200Returns the updated vector store file object, including its attributes.
idstringrequired
The identifier, which can be referenced in API endpoints.
objectstringrequired
The object type, which is always `vector_store.file`.
Allowed:vector_store.file
usage_bytesintegerrequired
The total vector store usage in bytes. Note that this may be different from the original file size.
created_atintegerrequired
The Unix timestamp (in seconds) for when the vector store file was created.
vector_store_idstringrequired
The ID of the [vector store](https://developers.openai.com/api/reference/resources/vector_stores) that the [File](https://developers.openai.com/api/reference/resources/files) is attached to.
statusstringrequired
The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use.
Allowed:in_progresscompletedcancelledfailed
last_errorobjectrequired
The last error associated with this vector store file. Will be `null` if there are no errors.
chunking_strategyobjectoptional
The strategy used to chunk the file.
attributesobjectoptional
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.
400Returned when the file attributes are invalid or the vector store has expired.
errorobjectrequired
404Returned when the vector store or file is not found.
errorobjectrequired
409Returned when the vector store is temporarily unavailable for the change or was modified concurrently.
errorobjectrequired
429Returned when the request exceeds a rate limit.
errorobjectrequired
500Returned when the vector store file attributes could not be updated.
errorobjectrequired

Error handling

A 400 is returned when the attributes are invalid or the vector store has expired. A 404 is returned when the vector store or file is not found; a 409 indicates the store is unavailable for the change or was modified concurrently; a 429 indicates a rate limit; and a 500 means the attributes could not be updated. The vector_store_id path parameter identifies the store, and the file_id path parameter identifies the attached file. attributes is required and can contain at most 16 key-value pairs with keys no longer than 64 characters.