cURL
curl --request POST \ --url https://api.openfiles.ai/functions/v1/api/files \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "path": "src/app.py", "content": "print('\''Hello World'\'')", "contentType": "text/x-python", "isBase64": false }'
{ "success": true, "data": { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "path": "<string>", "version": 2, "mimeType": "<string>", "size": 1, "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z" }, "operation": "write_file", "message": "File created successfully, version 1" }
Create a new file or new version of existing file
API key for authentication. Get your API key from the console.
Success
The response is of type object.
object