Skip to main content
POST
Associate a writer with a work
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /writer/writers//works/ Description: Creates (or, if one already exists for this writer/work/role, updates) a CWRWorkWriter association. Validates each territory entry’s code, I/E flag, and PR/MR/SR share ranges; validates writerRole against the narrower work-association enum (CA/AR/AD/TR, default CA), capacity (SW/OW/AC, default SW), and sourceType (AGR/CWR/REG) if supplied. Response includes shareTotals — summed PR/MR/SR shares per territory code across ALL writers currently on the work. Returns 201 when a new association was created, 200 when an existing one (same writerId/workId/writerRole) was updated. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Path Parameters

writerId
string<uuid>
required
workId
string<uuid>
required

Body

application/json
writerRole
enum<string>
default:CA

Note this is a narrower enum than the writer's own writerRole field — only these 4 codes are valid for a work association.

Available options:
CA,
AR,
AD,
TR
territories
object[]

Each entry is validated (territory code, I/E, and PR/MR/SR share ranges); invalid entries fail the whole request with 400.

capacity
enum<string>
default:SW
Available options:
SW,
OW,
AC
sourceType
enum<string>
Available options:
AGR,
CWR,
REG
sourceLineNumber
integer

Response

Existing association updated

Association record linking a writer to a work, with per-writer territory/share overrides.

id
string<uuid>
workId
string<uuid>
writerId
string<uuid>
writerRole
enum<string>
Available options:
CA,
AR,
AD,
TR
territories
object[]
capacity
enum<string>
Available options:
SW,
OW,
AC
sourceType
enum<string> | null
Available options:
AGR,
CWR,
REG
sourceLineNumber
integer | null
createdAt
string<date-time>
updatedAt
string<date-time>
shareTotals
object

Sum of PR/MR/SR shares across all writers on the work, keyed by territory code.

writer
object