Skip to content
Developer docsFlags and copies

Guide

Flags and copies

Every library programme has two settings that decide what customers may do with it. Both start off. Changing them publishes no new revision: they are settings, not content.

Details
FlagOff, the defaultOn
customerCanEditThe customer cannot change the programme. Their save gets 403 FORBIDDEN, reason customer_cannot_edit.The customer’s save publishes a new revision of your programme. Everyone it is assigned to gets it, and you see it.
customerCanCopyThe customer cannot copy it: 403, reason customer_cannot_copy.The customer can copy it under a new name. The copy is theirs.

Setting the flags

Set them in the body when you create a programme, or later with PATCH /v1/orgs/{orgId}/programmes/{programmeId} and one or both flags:

Shell
curl -X PATCH \
  https://api.wristworkout.com/v1/orgs/org_id/programmes/programme_id \
  -H "Authorization: Bearer $WW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "customerCanCopy": true }'

The flags of every library programme are in GET /v1/orgs/{orgId}/programmes, with how many customers have each one (assignees).

When customers can edit

  • A customer’s save works like yours: the whole programme with If-Match, and a new revision for everyone the programme is assigned to. You get programme.updated with "by": "customer".
  • Their save can use built-in exercises and your organisation’s own exercises and machines, never their private ones (UNKNOWN_REFERENCE). That keeps the programme usable for everyone else who has it.
  • When several customers have the programme, any of them changes it for all of them, and the portal warns about this. For a version per customer, duplicate the programme and assign each copy to one customer.

When customers can copy

  • The customer names the copy. It belongs to them, starts at its own first revision, and counts towards their 30 active programmes and their plan’s programme allowance.
  • Your organisation’s own exercises and machines that the programme uses are copied into the customer’s list of exercises and machines, once, so they can keep editing the copy. A later copy reuses them.
  • You get programme.copied with your programme’s ID and the customer’s ID. The copy belongs to the customer: you never see it.
  • The copy does not follow your programme: later revisions of yours do not change it.

What customers can always do

  • See who owns each programme they have, and what its flags allow.
  • Remove an assigned programme from their own list. You get programme.unassigned with "by": "customer".
  • They cannot archive your programme: that gets 403, reason not_owner.

Duplicating inside the library

POST /v1/orgs/{orgId}/programmes/{programmeId}/duplicate copies a library programme within the library. The copy has both flags off and the name you send, or “Copy of” and the original name. Its author is the member who duplicated it, or null when a key did.