Material

The material resource.

Basehttps://rest.carbon.ms/material
GET/material

List materials

Retrieve a paginated list of materials. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/material
curl --request GET \
  --url 'https://rest.carbon.ms/material?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "companyId": "xyz789",
    "approved": true,
    "createdBy": "string",
    "createdAt": "2026-01-01T00:00:00Z",
    "materialFormId": "xyz789",
    "materialSubstanceId": "xyz789",
    "approvedBy": "string"
  }
]
GET/material

Retrieve a material

Fetch a single material by filtering on `id`.

Query parameters

idstring

Match on the material's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/material
curl --request GET \
  --url 'https://rest.carbon.ms/material?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "approved": true,
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "materialFormId": "xyz789",
  "materialSubstanceId": "xyz789",
  "approvedBy": "string"
}
POST/material

Create a material

Create a new material.

Body parameters

materialFormIdstring

References materialForm.id

materialSubstanceIdstring

References materialSubstance.id

approvedbooleanrequired
approvedBystring

References user.id

customFieldsobject
tagsarray
dimensionIdstring

References materialDimension.id

finishIdstring

References materialFinish.id

gradeIdstring

References materialGrade.id

materialTypeIdstring

References materialType.id

POSThttps://rest.carbon.ms/material
curl --request POST \
  --url https://rest.carbon.ms/material \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"approved":true}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "approved": true,
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "materialFormId": "xyz789",
  "materialSubstanceId": "xyz789",
  "approvedBy": "string"
}
PATCH/material

Update a material

Update an existing material, matched on `id`.

Body parameters

materialFormIdstring

References materialForm.id

materialSubstanceIdstring

References materialSubstance.id

approvedbooleanrequired
approvedBystring

References user.id

customFieldsobject
tagsarray
dimensionIdstring

References materialDimension.id

finishIdstring

References materialFinish.id

gradeIdstring

References materialGrade.id

materialTypeIdstring

References materialType.id

PATCHhttps://rest.carbon.ms/material
curl --request PATCH \
  --url 'https://rest.carbon.ms/material?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"materialFormId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "approved": true,
  "createdBy": "string",
  "createdAt": "2026-01-01T00:00:00Z",
  "materialFormId": "xyz789",
  "materialSubstanceId": "xyz789",
  "approvedBy": "string"
}
DELETE/material

Delete a material

Delete a material, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the material to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/material
curl --request DELETE \
  --url 'https://rest.carbon.ms/material?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content