Skip to content

Approve a file

POST
/drives/{drive}/nodes/{node}/approvals/{approval}/approve
curl --request POST \
--url https://work.optidata.cloud/api/drives/1/nodes/300754/approvals/881/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "comment": "Figures check out." }'

Records the caller’s approval, optionally with a short comment. Requires view on the node; the caller must be the approver the request was addressed to.

drive
required
integer format: int64

Numeric id of the drive. Read it from GET /drives/config.json.

node
required
integer format: int64

Numeric id of the node (file or folder).

approval
required
integer format: int64

Numeric id of the approval request.

Media typeapplication/json
object
comment
string | null
<= 255 characters
Examples
Exampleapprove
{
"comment": "Figures check out."
}

The approval, now approved.

Media typeapplication/json

A request asking a specific user to approve or reject a file. Folders cannot carry approvals.

object
id
integer format: int64
node_id
integer format: int64
requester_user_id
integer format: int64
requested_user_id
integer | null format: int64
requested_user_email

Set when the approver is addressed by e-mail rather than by id.

string | null format: email
status
string
Allowed values: pending approved rejected
requester_user_note
string | null
<= 1000 characters
comment

Optional note left by the approver.

string | null
<= 255 characters
rejection_reason
string | null
<= 255 characters
is_download_allowed
boolean | null
is_rejection_reason_required
boolean | null
edit_mode
One of:

Whether the file stays editable while the approval is open (released) or is frozen until it is decided (blocked).

string
Allowed values: blocked released
expires_at
string | null format: date-time
created_at
string format: date-time
updated_at
string format: date-time
requesterUser
One of:

Compact representation of a user, embedded in other payloads.

object
id
integer format: int64
uuid

Tenant-wide identifier of the user. Use this, not id, on account endpoints.

string format: uuid
name
string
email
string format: email
status

Present where the payload includes it (for example audit entries).

string
Allowed values: active inactive blocked
deleted_at
string | null format: date-time
avatar_url
string | null format: uri
full_name
string
requestedUser
One of:

Compact representation of a user, embedded in other payloads.

object
id
integer format: int64
uuid

Tenant-wide identifier of the user. Use this, not id, on account endpoints.

string format: uuid
name
string
email
string format: email
status

Present where the payload includes it (for example audit entries).

string
Allowed values: active inactive blocked
deleted_at
string | null format: date-time
avatar_url
string | null format: uri
full_name
string
Example
{
"status": "pending",
"edit_mode": "blocked",
"requesterUser": {
"id": 15,
"uuid": "9c1f0e2a-4d31-4d8a-8c1a-1f0b6b1f9a10",
"name": "Jane Doe",
"email": "jane.doe@acme.example",
"status": "active"
},
"requestedUser": {
"id": 15,
"uuid": "9c1f0e2a-4d31-4d8a-8c1a-1f0b6b1f9a10",
"name": "Jane Doe",
"email": "jane.doe@acme.example",
"status": "active"
}
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The caller lacks the permission level the operation requires.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Exampledenied
{
"message": "This action is unauthorized."
}

The resource does not exist, or does not belong to the given drive.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplemissing
{
"message": "No query results for model [App\\Models\\Node] 99999999"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}