Skip to content

Unit

Allowed query parameters

None

Create a unit

post
/unit
Attribute (* required)TypeDescription
name *StringShort name (eg. l)
descriptionString?Descriptive name (eg. liters)

Example response

json
// HTTP 201 Created
{
    // a unit object
}

Update a unit

put
/unit/{id}
Attribute (* required)TypeDescription
nameStringShort name (eg. l)
descriptionString?Descriptive name (eg. liters)

Example response

json
// HTTP 200 OK
{
    // a unit object
}

Retrieve a unit

get
/unit/{id}

Example response

json
// HTTP 200 OK
{
	"id": "8y3AdBxwPL",
	"name": "l",
	"description": "Liter"
}

Delete a unit

delete
/unit/{id}

Example response

json
// HTTP 204 No Content

List units

get
/unit

The list endpoint accepts the same parameters as in Retrieve a unit and returns a paginated array of the same unit object in the data property.

Read more about Pagination, Filtering, Sorting and Includes on the Introduction page.