Skip to content

Act on a port

POST
/api/v1/port/{port}
curl --request POST \
--url http://pwrman.local/api/v1/port/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "action": "disable" }'

enable and disable switch the port on and off. A port set to last in port_boot comes back in the state set here after a restart. hard_reset sends a USB PD hard reset, src_cap announces the port’s power offers to the device again, and update writes the bundled firmware to the port’s blade now.

port
required
integer
>= 1 <= 6

Port number.

Media typeapplication/json
object
action
required
string
Allowed values: enable disable hard_reset src_cap update

Example

{
"action": "disable"
}

Done.

Media typeapplication/json
object
ok
required
boolean

Example

{
"ok": true
}

The action is not one of the above.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example

{
"error": "unknown action"
}

The token is missing or wrong, or no token is set yet.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Examples

{
"error": "bearer token required"
}

No such port or path.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example

{
"error": "no such endpoint"
}

The controller is busy with another request. Try again.

Media typeapplication/json
object
error
required

Why the request was refused, in words.

string

Example

{
"error": "busy, retry"
}

USB Type-C® and USB-C® are registered trademarks of USB Implementers Forum.