# Create a file `POST /api/v1/files` Creates a file. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Files → Write**. ## Headers - `X-Sport-Id` (integer) — Sport context to associate with the new file. ## Body parameters - `name` (string, required) — Original filename or folder name, up to 160 characters. - `url` (string, required) — URL of an already-uploaded file. - `parent_id` (integer or null) — ID of the parent folder. Use null for the root. Alias folder_id on creation. - `friendly_name` (string or null) — Optional display name, up to 160 characters. Use null to clear it. - `description` (string or null) — Description, up to 160 characters. - `mime_type` (string or null) — Media type of the file. - `size` (integer or null) — File size in bytes. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/files" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"name":"welcome.pdf","url":"https://files.example.com/welcome.pdf","friendly_name":"Welcome guide","mime_type":"application/pdf"}' ``` ## Response **201 Created** The created file is returned in data. Example with fictional data and selected fields. ```json { "status": "success", "message_key": "entities.file.messages.created", "data": { "id": 16, "sport_id": 3, "parent_id": null, "is_folder": false, "name": "welcome.pdf", "friendly_name": "Welcome guide", "description": "Club information", "mime_type": "application/pdf", "size": 12345, "url": "https://files.example.com/welcome.pdf" } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `409` — The file is still processing. - `422` — One or more fields failed validation. - `500` — The file could not be registered.