Update restrictions

Updates an existing restrictions record.

Tip

Check the Swagger page for more technical information on the endpoints.

Endpoint details

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/{structureVersionId}/levels/{level}/activity-definitions/{activityDefinitionReference}/restrictions

Headers: Authorization: Bearer {token}, User-Agent: {agent} Scope: connector-protimeapi-activity-definitions.write

URL parameters

These parameters need to be filled in when calling this endpoint.

Parameter Description
<structureVersionId> The ID of the activity structure. Can be found in the configuration in myProtime.
<level> Defines the level in the structure.
<activityDefinitionReference> The internal ID or an external reference.

Body properties

Field Type Required Writable Description
[].level integer Yes Yes The level in the activity structure to which the restriction applies.
[].activityDefinitions[].id string Yes Yes Unique identifier for an activity definition that is restricted at the specified level.

External references

The endpoint supports predefined and custom external references. See the external references page for details.

The following collections are supported for this endpoint:

Collection Predefined Custom
activity-definitions @data-entry-code, @external-reference Supported

Caution

There are some restrictions on the characters allowed in URL requests. See the fetching resources page for more information.

Success response

A successful update returns 200 OK.

Error responses

Status code Description
400 Bad request — validation failed (e.g., restriction IDs do not exist, bad external reference).
401 Unauthorized — missing or invalid bearer token.
404 Not found — the specified activity definition does not exist.

Examples

Update restrictions with single level

Example updating restrictions for activity definition with internal ID 38fc2206-b51f-434a-9c36-9e0esfc5e70e:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/3/activity-definitions/38fc2206-b51f-434a-9c36-9e0esfc5e70e/restrictions

[
  {
    "level": 1,
    "activityDefinitions": [
      {
        "id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
      },
      {
        "id": "22d320ed-f6ed-44bd-b7b1-fe58f518960c"
      }
    ]
  }
]

Update restrictions with multiple levels

Example updating restrictions across multiple levels:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/3/activity-definitions/38fc2206-b51f-434a-9c36-9e0esfc5e70e/restrictions

[
  {
    "level": 1,
    "activityDefinitions": [
      {
        "id": "a7d853ea-89eb-4735-83d1-b891c6fde398"
      },
      {
        "id": "22d320ed-f6ed-44bd-b7b1-fe58f518960c"
      }
    ]
  },
  {
    "level": 3,
    "activityDefinitions": [
      {
        "id": "b2593723-9574-4659-8367-706645454367"
      }
    ]
  }
]

Clear all restrictions

Example clearing all restrictions for activity definition with internal ID 22d320ed-f6ed-44bd-b7b1-fe58f518960c:

PUT
https://<tenant>.myprotime.eu/connector/protimeapi/api/v1/activity-structure-versions/b2347a7a-d60d-446f-b03b-7es2cc8c3281/levels/2/activity-definitions/22d320ed-f6ed-44bd-b7b1-fe58f518960c/restrictions

[]