Create File
POST/api/workspaces/:workspace_id/files/
Create a new file object in the scope of an entity or session. Subsequently, the temp_upload_url and temp_upload_data from the response need to be used to upload the file itself.
Request
Path Parameters
- application/json
Body
required
Possible values: [entity, session]
Scope of the file. Can be one of: entity, session.
Id of entity which the file is bound. This field can be provided when in tree or simple app types only.
Editor session to be scoped under. This field should be provided on editor app type only.
Possible values: non-empty and <= 512 characters
Name of the file to be uploaded.
Responses
- 201
- 400
- 401
- 403
- application/json
- Schema
- Example (from schema)
Schema
Possible values: [entity, session]
Scope of the file. Can be one of: entity, session.
Id of entity which the file is bound. This field can be provided when in tree or simple app types only.
Editor session to be scoped under. This field should be provided on editor app type only.
Possible values: non-empty and <= 512 characters
Name of the file to be uploaded.
Creation date and time of the file.
Possible values: non-empty
Temporary S3 upload url of the object. See :ref:Using S3 Presigned Post Payloads <s3 presigned post target> for details.
Temporary S3 upload fields which will be used when sending the object to S3 with file. See :ref:Using S3 Presigned Post Payloads <s3 presigned post target> for details.
{
"id": 0,
"scope": "entity",
"entity_id": 0,
"editor_session": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"filename": "string",
"created_at": "2025-11-07T16:05:09.057Z",
"temp_upload_url": "string",
"temp_upload_data": {}
}
Validation error response.
It produces a validation error schema like below.
{
"field1": ["Validation error"],
"non_field_errors": ["Sample non field validation error"]
}
No authentication found or authentication is not correct.
Specified path is not allowed
Permission evaluation:
((Is Authenticated Organization Admin OR Workspace Context Permission) OR Public Permission) AND Is Not App
Descriptions:
Public Permission : Checks corresponding workspace is used public.
Is Authenticated Organization Admin : User must be an Organization Admin.
Workspace Context Permission : Checks whether the user has access rights to the context workspace.
Is Not App : Client must not be a VIKTOR app.