Rework

The rework resource.

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

List reworks

Retrieve a paginated list of reworks. 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/rework
curl --request GET \
  --url 'https://rest.carbon.ms/rework?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "jobId": "xyz789",
    "triggeredAtJobOperationId": "xyz789",
    "targetJobOperationId": "xyz789",
    "reason": "string",
    "quantity": 10,
    "requestedById": "xyz789",
    "companyId": "xyz789"
  }
]
GET/rework

Retrieve a rework

Fetch a single rework by filtering on `id`.

Query parameters

idstring

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

GEThttps://rest.carbon.ms/rework
curl --request GET \
  --url 'https://rest.carbon.ms/rework?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "jobId": "xyz789",
  "triggeredAtJobOperationId": "xyz789",
  "targetJobOperationId": "xyz789",
  "reason": "string",
  "quantity": 10,
  "requestedById": "xyz789",
  "companyId": "xyz789"
}
POST/rework

Create a rework

Create a new rework.

Body parameters

jobIdstringrequired

References job.id

triggeredAtJobOperationIdstringrequired

References jobOperation.id

targetJobOperationIdstringrequired

References jobOperation.id

reasonstringrequired
quantitynumberrequired
requestedByIdstringrequired

References user.id

completedAttimestamp
companyIdstringrequired

References company.id

POSThttps://rest.carbon.ms/rework
curl --request POST \
  --url https://rest.carbon.ms/rework \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"jobId":"xyz789","triggeredAtJobOperationId":"xyz789","targetJobOperationId":"xyz789","reason":"string","quantity":10,"requestedById":"xyz789","companyId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "jobId": "xyz789",
  "triggeredAtJobOperationId": "xyz789",
  "targetJobOperationId": "xyz789",
  "reason": "string",
  "quantity": 10,
  "requestedById": "xyz789",
  "companyId": "xyz789"
}
PATCH/rework

Update a rework

Update an existing rework, matched on `id`.

Body parameters

jobIdstringrequired

References job.id

triggeredAtJobOperationIdstringrequired

References jobOperation.id

targetJobOperationIdstringrequired

References jobOperation.id

reasonstringrequired
quantitynumberrequired
requestedByIdstringrequired

References user.id

completedAttimestamp
companyIdstringrequired

References company.id

PATCHhttps://rest.carbon.ms/rework
curl --request PATCH \
  --url 'https://rest.carbon.ms/rework?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"jobId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "jobId": "xyz789",
  "triggeredAtJobOperationId": "xyz789",
  "targetJobOperationId": "xyz789",
  "reason": "string",
  "quantity": 10,
  "requestedById": "xyz789",
  "companyId": "xyz789"
}
DELETE/rework

Delete a rework

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

Query parameters

idstring

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

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