Skip to main content
POST
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /publisher-writer/agreements Description: Creates a new agreement inside a DB transaction. Verifies the publisher and writer both exist for the tenant, validates territories (if supplied) against CISAC rules, and checks for territory conflicts against any of this publisher/writer pair’s other currently-active agreements — a conflicting territory rolls back the transaction and returns 400. Defaults status to draft and isActive to true when not supplied. The response object does NOT include the nested publisher/writer relations (those only get attached on scoped reads, not on the raw .create() result). 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}"

Body

application/json
publisherId
string<uuid>
required

Must reference an existing Publisher on this tenant.

writerId
string<uuid>
required

Must reference an existing CWRWriter on this tenant.

name
string

Required by the model (allowNull:false); omitting it fails Sequelize validation.

description
string
territories
object[]

Validated against CISAC territory rules, and checked for conflicts against this publisher/writer pair's other ACTIVE agreements.

contractNumber
string
contractDate
string<date-time>
startDate
string<date-time>
endDate
string<date-time>
status
enum<string>
default:draft
Available options:
draft,
pending,
active,
expired,
terminated
isActive
boolean
default:true

Response

Agreement created

id
string<uuid>
tenantId
integer
publisherId
string<uuid>
writerId
string<uuid>
name
string
description
string | null
territories
object[]
contractNumber
string | null
contractDate
string<date-time> | null
startDate
string<date-time> | null
endDate
string<date-time> | null
status
enum<string>
Available options:
draft,
pending,
active,
expired,
terminated
isActive
boolean
default:true
publisher
object

Only present when the record was loaded via the model's default scope (all reads; NOT present on the POST /agreements create response).

writer
object

Only present when the record was loaded via the model's default scope (all reads; NOT present on the POST /agreements create response).

createdAt
string<date-time>
updatedAt
string<date-time>