Skip to main content
PUT
/
boxes
/
{boxId}
/
files
Write a file in a Box
curl --request PUT \
  --url https://ascii.dev/api/box/v1/boxes/{boxId}/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": "<string>",
  "content": "<string>",
  "encoding": "utf8"
}
'
{
  "ok": true,
  "type": "<string>",
  "success": true,
  "path": "<string>",
  "size": 123
}

Authorizations

Authorization
string
header
required

Box API key in the form box_.... Create and rotate keys in the Box dashboard or through the v1 API key endpoints.

Path Parameters

boxId
string
required

Public Box id returned by create/list/get box calls.

Pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$

Body

application/json
path
string
required

Relative path inside the Box work directory.

content
string
required
encoding
enum<string>
default:utf8
Available options:
utf8,
base64

Response

200 - application/json

File written.

ok
boolean
required
Example:

true

type
string
required

Stable success envelope discriminator added by v1.

Allowed value: "file.written"
success
boolean
required
path
string
required
encoding
enum<string>
required
Available options:
utf8,
base64
size
integer
required