developer portal

Workplaces

Every call needs a service key. Create one in Proof under Settings, Service keys, then send it as Authorization: Bearer sk_.... Without the scope for the call you get a 403.

The workplaces in your environment, as Proof knows them. Workplaces are created inside Proof itself. Over the public API you list them, and you can update the name, description and internal code of one. Its identification, address and synchronisation settings are managed in Proof and do not change over the API.

The identification is the handle to use elsewhere. Setting the workplaces on a group takes identifications, not ids, and the update call has a by-identification variant for the same reason.

Get workplaces

Returns a paged list of the workplaces in the key's environment, 100 per page.

Use identification when you set the workplaces on a group. internalCode is your own code for the workplace, if one was set in Proof.

Query parameters

NameTypeRequiredExample
pageZero-based page index. Defaults to 0.integeroptional0

Responses

200OK
FieldType
itemsWorkplaces on this page.array
filterPaging state for this query.object
{
  "items": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "identification": "WP-0042",
      "name": "Antwerp North site",
      "address": "Noorderlaan 1, 2030 Antwerpen",
      "description": "Main northern construction site",
      "internalCode": "EQ-ANR-N"
    }
  ],
  "filter": {
    "page": 0,
    "pageSize": 100,
    "totalCount": 1,
    "sortAscending": true,
    "sortString": "",
    "searchString": ""
  }
}
401Unauthorized. Missing or invalid service key.
403Forbidden. The key lacks the required scope.

Update workplace

Changes the name, description or internal code of a workplace, and returns the workplace as it is stored afterwards.

This is a partial update. Send only the fields you want to change: a field you leave out keeps its stored value, and so does a field you send as null. An empty string is how you clear description or internalCode. A body of {}, or one that repeats the stored values, is accepted and answers 200 with the workplace unchanged. The rest of the workplace, its identification, its address and its synchronisation settings, is managed inside Proof and does not change.

internalCode is trimmed and has to be unique among the workplaces in your environment, compared case-sensitively. A code that another workplace already carries is rejected with 400 and nothing is changed. name cannot be blank, and spaces only count as blank.

Know the workplace by its identification rather than its id? Use Update workplace by identification below.

Path parameters

NameTypeRequiredExample
idId of the workplace, as `Get workplaces` returns it. A malformed id answers an empty 404, even without a key. stringrequired00000000-0000-0000-0000-000000000000

Request body (required)

object

FieldTypeRequired
nameNew display name, 500 characters at most and not blank. Left out or `null`, the stored name stays. stringoptional
descriptionNew description, 500 characters at most. Left out or `null`, it stays. An empty string clears it. stringoptional
internalCodeYour own code, 50 characters at most, unique in your environment. Left out or `null`, it stays. An empty string clears it. stringoptional
{
  "name": "Antwerp North site, phase 2",
  "internalCode": "EQ-ANR-N2"
}

Responses

200OK. The workplace as stored after the update.
FieldType
idId of the workplace.string
identificationIdentification of the workplace. Not changed by this call.string
nameDisplay name.string
descriptionFree-text description, empty when none is set.string
internalCodeYour own code for this workplace, null when none is set.string
{
  "id": "00000000-0000-0000-0000-000000000000",
  "identification": "WP-0042",
  "name": "Antwerp North site, phase 2",
  "description": "Main northern construction site",
  "internalCode": "EQ-ANR-N2"
}
400Validation failed. `errors` is keyed by field: `name` when it is blank or over 500 characters, `description` over 500 characters, `internalCode` over 50 characters or already in use by another workplace in your environment, `environmentId` with `OnlyOwnerCanModify` when the workplace belongs to another environment that shares it with you. The messages are Proof's own translation codes, so match on the field and on the part before the first `|`. A missing, empty or unparseable body gives `400` as well, with the reason in `detail` and no field keys in `errors`.
FieldType
titlestring
statusinteger
errorsField name to list of error codes.object
traceIdstring
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "instance": "/public/v1/workplace/00000000-0000-0000-0000-000000000000",
  "errors": {
    "internalCode": [
      "AlreadyExists|_p1=InternalCode|_p2=EQ-ANR-N2"
    ]
  },
  "traceId": "00-0000000000000000-0000000000-00"
}
401Unauthorized. Missing or invalid service key.
403Forbidden. The key lacks the required scope.
404No workplace with this id in the key's environment. A plain problem document: `title`, `status` and `traceId`, no `errors`.

Update workplace by identification

The same update as Update workplace, addressed by the workplace's identification instead of its id. Handy when your system knows the workplace by the handle you also use to set the workplaces on a group.

Same body, same rules, same response. Send only the fields you want to change, an empty internalCode clears the code, and the identification itself cannot be changed through this call. URL-encode it when it carries characters that are not safe in a path segment.

Path parameters

NameTypeRequiredExample
identificationIdentification of the workplace, as `Get workplaces` returns it. Matched without regard to case. stringrequiredWP-0042

Request body (required)

object

FieldTypeRequired
nameNew display name, 500 characters at most and not blank. Left out or `null`, the stored name stays. stringoptional
descriptionNew description, 500 characters at most. Left out or `null`, it stays. An empty string clears it. stringoptional
internalCodeYour own code, 50 characters at most, unique in your environment. Left out or `null`, it stays. An empty string clears it. stringoptional
{
  "description": "Main northern construction site, access via gate B"
}

Responses

200OK. The workplace as stored after the update.
FieldType
idId of the workplace.string
identificationIdentification of the workplace. Not changed by this call.string
nameDisplay name.string
descriptionFree-text description, empty when none is set.string
internalCodeYour own code for this workplace, null when none is set.string
{
  "id": "00000000-0000-0000-0000-000000000000",
  "identification": "WP-0042",
  "name": "Antwerp North site",
  "description": "Main northern construction site, access via gate B",
  "internalCode": "EQ-ANR-N"
}
400Validation failed. Same shape and same field rules as `Update workplace`: `errors` is keyed by field, the messages are Proof's translation codes.
FieldType
titlestring
statusinteger
errorsField name to list of error codes.object
traceIdstring
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "instance": "/public/v1/workplace/by-identification/WP-0042",
  "errors": {
    "internalCode": [
      "AlreadyExists|_p1=InternalCode|_p2=EQ-ANR-N"
    ]
  },
  "traceId": "00-0000000000000000-0000000000-00"
}
401Unauthorized. Missing or invalid service key.
403Forbidden. The key lacks the required scope.
404No active workplace with this identification in the key's environment. Archived workplaces are not matched here; address those by id. Same plain problem document as on `Update workplace`.