Skip to content

Minimal widgets

Widgets, the example resource.

This page is generated from the Minimal route table. Every operation carries the permission it needs and the anchor an agent can link to.

GETwidget:readtenant facemspitremotehostedNot fully resolved

From an MSP console, prefix the path with /api/v1/clients/{clientID} to reach one client.

What this page does not know
  • The sort parameter is validated in a helper the extractor does not follow, so its accepted values are not listed here.

These are parts of the route the extractor could not read from the source. Everything else on this page came straight from it.

Source: internal/api/widgets.go:mountWidgets handleWidgetList

List widgets

Returns one page of widgets. Results are ordered newest first.

NameInTypeRequiredDescription
pagequeryintegerNoOne based page number.
pageSizequeryintegerNoRows per page, up to 200.
statequerystring, one of active, retiredNoOnly widgets in this state.
StatusBodyDescription
200application/json, PagedResultWidgetOne page of widgets.
400application/problem+json, ProblemThe request was refused. The body says why.
403application/problem+json, ProblemThe request was refused. The body says why.

200 response body

FieldTypeDescription
itemsrequiredarray of Widget

This page of widgets.

items[].idrequiredstring (uuid)

The widget identifier.

read only.

items[].namerequiredstring

What the widget is called.

at most 200 characters.

items[].staterequiredstring, one of active, retired

Whether the widget is in use.

items[].labelsarray of string

Free form labels.

items[].ownerWidgetOwner

Who is responsible for the widget.

items[].owner.userIdrequiredstring (uuid)

The owning user.

items[].owner.emailstring (email)

Where to reach the owner.

items[].owner.notifyboolean

Whether the owner is told about changes.

default true.

items[].retiredAtstring (date-time) or null

When the widget was retired, or null while it is active.

items[].createdAtrequiredstring (date-time)

When the widget was created.

read only.

pagerequiredinteger

The page that was returned.

pageSizerequiredinteger

How many rows were asked for.

totalrequiredinteger

How many widgets match in total.

Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
curl -X GET 'https://depot.example.com/api/v1/widgets?page=1&pageSize=50&state=active' \
-H 'Accept: application/json' \
-b 'outpost_console=<console-session>'

POSTwidget:createmsp facemspitIdempotent

Source: internal/api/widgets.go:mountWidgets handleWidgetCreate

Create a widget

Creates a widget. Sending the same idempotency key twice creates one widget and returns it twice.

Required, sent as application/json.

FieldTypeDescription
namerequiredstring

What the widget is called.

at most 200 characters.

statestring, one of active, retired

The state to create it in.

default "active".

labelsarray of string

Free form labels.

ownerWidgetOwner

Who is responsible for the widget.

owner.userIdrequiredstring (uuid)

The owning user.

owner.emailstring (email)

Where to reach the owner.

owner.notifyboolean

Whether the owner is told about changes.

default true.

StatusBodyDescription
201application/json, WidgetThe widget that was created.
400application/problem+json, ProblemThe request was refused. The body says why.
409application/problem+json, ProblemThe request was refused. The body says why.

201 response body

FieldTypeDescription
idrequiredstring (uuid)

The widget identifier.

read only.

namerequiredstring

What the widget is called.

at most 200 characters.

staterequiredstring, one of active, retired

Whether the widget is in use.

labelsarray of string

Free form labels.

ownerWidgetOwner

Who is responsible for the widget.

owner.userIdrequiredstring (uuid)

The owning user.

owner.emailstring (email)

Where to reach the owner.

owner.notifyboolean

Whether the owner is told about changes.

default true.

retiredAtstring (date-time) or null

When the widget was retired, or null while it is active.

createdAtrequiredstring (date-time)

When the widget was created.

read only.

Terminal window
# Sign in first. outpost_console is a session cookie, so send it with every request.
# This operation also accepts provisionToken.
# This operation is idempotent. Repeating it does not repeat its effect.
curl -X POST 'https://depot.example.com/api/v1/widgets' \
-H 'X-Csrf-Token: <csrf-token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-b 'outpost_console=<console-session>' \
--data '{
"name": "string",
"state": "active",
"labels": [
"string"
],
"owner": {
"userId": "00000000-0000-0000-0000-000000000000",
"email": "[email protected]",
"notify": true
}
}'

Content is licensed CC BY 4.0. Code samples are MIT. Outpost and the Outpost mark are trademarks of Outpost Business Solutions, PBC and are not covered by either licence.