Link User File To Project
Link an existing user file to a specific project for the current user.
This page uses Nexus's generated request and response schema. Requests still require the correct account, workspace, and resource permissions.
/user/projects/{project_id}/files/{file_id}curl --request POST 'https://school.narb.cc/api/user/projects/{project_id}/files/{file_id}' \
--header 'Authorization: Bearer YOUR_TOKEN'This builds a request example. Fill in required query values, then replace path placeholders and YOUR_TOKEN in your own environment. Use a token for a user with access to this workspace. Responses and permissions depend on your account and deployment. Never paste a private token into documentation.
Download the Nexus OpenAPI schema ↗
Import the schema into your API client. It describes the backend source; enabled routes depend on your workspace.
Authentication and scope#
Send requests to the workspace that owns the resource. Authentication does not by itself grant a school membership, class assignment, or administrator permission. School endpoints apply their role and class checks on the server.
Use a credential issued for that workspace with only the permissions your integration needs. Keep it on your server. Do not place credentials in a public website or a shared skill.
Link an existing user file to a specific project for the current user.
Creates the association in the Project__UserFile join table if it does not exist. Returns the linked user file snapshot.
Parameters#
| Name | Location | Required | Type |
|---|---|---|---|
project_id | path | Yes | integer |
file_id | path | Yes | string |
tenant_id | query | No | string or null |
The tenant_id parameter is part of the engine schema. It does not authorize a caller to another school. Use the workspace and permissions assigned to your account.
Responses#
200#
Successful Response
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"temp_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Temp Id"
},
"name": {
"type": "string",
"title": "Name"
},
"project_id": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Project Id"
},
"user_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "User Id"
},
"file_id": {
"type": "string",
"title": "File Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"status": {
"$ref": "#/components/schemas/UserFileStatus"
},
"last_accessed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Last Accessed At"
},
"file_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "File Type"
},
"chat_file_type": {
"$ref": "#/components/schemas/ChatFileType"
},
"token_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Token Count"
},
"chunk_count": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Chunk Count"
}
},
"type": "object",
"required": [
"id",
"name",
"user_id",
"file_id",
"created_at",
"status",
"last_accessed_at",
"file_type",
"chat_file_type",
"token_count",
"chunk_count"
],
"title": "UserFileSnapshot"
}422#
Validation Error
{
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}Access and error handling#
A signed-out or expired session needs authentication. A denied request can mean the account lacks permission, class membership, an approved model, or an available allowance. Do not retry a write blindly after a network failure; first check whether it was recorded.
Treat validation errors as a request problem. Use the returned field details to correct the request. Resource identifiers do not confer access.
Schema version#
Generated from Nexus backend source fe1c3a07c793029d3d87191a68f89e481afd6bc8. Check your deployed version before integrating. Schema coverage is not a live acceptance test.