Skip to main content
PUT
/
writer
/
writers
/
{id}
Update a writer
curl --request PUT \
  --url https://api.royalti.io/writer/writers/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "firstName": "<string>",
  "lastName": "<string>",
  "ipiNameNumber": "<string>",
  "ipiBaseNumber": "<string>",
  "isrCode": "<string>",
  "territories": [
    {
      "territoryCode": "WW",
      "prShare": 50,
      "mrShare": 50,
      "srShare": 50,
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z"
    }
  ],
  "tenantUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "affiliatedPRO": "<string>"
}
'
import requests

url = "https://api.royalti.io/writer/writers/{id}"

payload = {
    "firstName": "<string>",
    "lastName": "<string>",
    "ipiNameNumber": "<string>",
    "ipiBaseNumber": "<string>",
    "isrCode": "<string>",
    "territories": [
        {
            "territoryCode": "WW",
            "prShare": 50,
            "mrShare": 50,
            "srShare": 50,
            "startDate": "2023-11-07T05:31:56Z",
            "endDate": "2023-11-07T05:31:56Z"
        }
    ],
    "tenantUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "affiliatedPRO": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    firstName: '<string>',
    lastName: '<string>',
    ipiNameNumber: '<string>',
    ipiBaseNumber: '<string>',
    isrCode: '<string>',
    territories: [
      {
        territoryCode: 'WW',
        prShare: 50,
        mrShare: 50,
        srShare: 50,
        startDate: '2023-11-07T05:31:56Z',
        endDate: '2023-11-07T05:31:56Z'
      }
    ],
    tenantUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    affiliatedPRO: '<string>'
  })
};

fetch('https://api.royalti.io/writer/writers/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.royalti.io/writer/writers/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'firstName' => '<string>',
    'lastName' => '<string>',
    'ipiNameNumber' => '<string>',
    'ipiBaseNumber' => '<string>',
    'isrCode' => '<string>',
    'territories' => [
        [
                'territoryCode' => 'WW',
                'prShare' => 50,
                'mrShare' => 50,
                'srShare' => 50,
                'startDate' => '2023-11-07T05:31:56Z',
                'endDate' => '2023-11-07T05:31:56Z'
        ]
    ],
    'tenantUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'affiliatedPRO' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.royalti.io/writer/writers/{id}"

	payload := strings.NewReader("{\n  \"firstName\": \"<string>\",\n  \"lastName\": \"<string>\",\n  \"ipiNameNumber\": \"<string>\",\n  \"ipiBaseNumber\": \"<string>\",\n  \"isrCode\": \"<string>\",\n  \"territories\": [\n    {\n      \"territoryCode\": \"WW\",\n      \"prShare\": 50,\n      \"mrShare\": 50,\n      \"srShare\": 50,\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\"\n    }\n  ],\n  \"tenantUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"affiliatedPRO\": \"<string>\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.royalti.io/writer/writers/{id}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"firstName\": \"<string>\",\n  \"lastName\": \"<string>\",\n  \"ipiNameNumber\": \"<string>\",\n  \"ipiBaseNumber\": \"<string>\",\n  \"isrCode\": \"<string>\",\n  \"territories\": [\n    {\n      \"territoryCode\": \"WW\",\n      \"prShare\": 50,\n      \"mrShare\": 50,\n      \"srShare\": 50,\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\"\n    }\n  ],\n  \"tenantUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"affiliatedPRO\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.royalti.io/writer/writers/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"firstName\": \"<string>\",\n  \"lastName\": \"<string>\",\n  \"ipiNameNumber\": \"<string>\",\n  \"ipiBaseNumber\": \"<string>\",\n  \"isrCode\": \"<string>\",\n  \"territories\": [\n    {\n      \"territoryCode\": \"WW\",\n      \"prShare\": 50,\n      \"mrShare\": 50,\n      \"srShare\": 50,\n      \"startDate\": \"2023-11-07T05:31:56Z\",\n      \"endDate\": \"2023-11-07T05:31:56Z\"\n    }\n  ],\n  \"tenantUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"affiliatedPRO\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "tenantId": 123,
  "firstName": "<string>",
  "lastName": "<string>",
  "ipiNameNumber": "<string>",
  "ipiBaseNumber": "<string>",
  "affiliatedPRO": "<string>",
  "mrSociety": "<string>",
  "srSociety": "<string>",
  "generallyControlled": false,
  "canBeControlled": false,
  "publisherFee": 50,
  "saan": "<string>",
  "territories": [
    {
      "territoryCode": "WW",
      "prShare": 50,
      "mrShare": 50,
      "srShare": 50,
      "startDate": "2023-11-07T05:31:56Z",
      "endDate": "2023-11-07T05:31:56Z"
    }
  ],
  "settings": {},
  "tenantUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userData": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "firstName": "<string>",
    "lastName": "<string>",
    "email": "jsmith@example.com",
    "ipi": "<string>"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}
{
  "status": "error",
  "message": "<string>",
  "code": "<string>",
  "details": {}
}
{
  "status": "error",
  "message": "<string>",
  "code": "<string>",
  "details": {}
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

PUT /writer/writers/ Description: Partial update — only supplied fields are changed. If any writer-identity field (anything other than tenantUserId / affiliatedPRO) is included, the full merged record is re-validated through WriterValidator. Changing tenantUserId re-checks it belongs to an existing TenantUser on this tenant. Authorization:
  • Required role: admin or higher
Method: PUT

Code Examples

const response = await fetch('https://api.royalti.io/writer/writers/example-id', {
  method: 'PUT',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "ref": "#/components/schemas/WriterUpdateRequest"
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.put(
  'https://api.royalti.io/writer/writers/example-id',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/WriterUpdateRequest"}
)

data = response.json()
print(data)
curl -X PUT https://api.royalti.io/writer/writers/example-id \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref":"#/components/schemas/WriterUpdateRequest"}'

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string<uuid>
required

Body

application/json

All fields optional; only supplied fields are validated and persisted.

firstName
string
lastName
string
ipiNameNumber
string
ipiBaseNumber
string
isrCode
string
writerRole
enum<string>
Available options:
CA,
C,
A,
AR,
AD,
TR,
SR,
LY,
CO,
PA
territories
object[]
tenantUserId
string<uuid>
affiliatedPRO
string

Response

Writer updated

id
string<uuid>
tenantId
integer
firstName
string
lastName
string
ipiNameNumber
string | null

11-digit CISAC IPI name number. Unique per tenant when set.

ipiBaseNumber
string | null

13-character CISAC IPI base number. Unique per tenant when set.

writerRole
enum<string>

CWR writer designation code. One of: CA (Composer & Author), C (Composer), A (Author/Lyricist), AR (Arranger), AD (Adaptor), TR (Translator), SR (Sub-Arranger), LY (Lyricist), CO (Composer), PA (Performer).

Available options:
CA,
C,
A,
AR,
AD,
TR,
SR,
LY,
CO,
PA
affiliatedPRO
string | null

Performing rights organization the writer is affiliated with (e.g. ASCAP, BMI). Free text — not enum-validated.

mrSociety
string | null
Maximum string length: 3
srSociety
string | null
Maximum string length: 3
generallyControlled
boolean
default:false
canBeControlled
boolean
default:false
publisherFee
number | null
Required range: 0 <= x <= 100
saan
string | null

Society-Assigned Agreement Number.

Maximum string length: 14
territories
object[]

Defaults to a single worldwide (WW) entry at 100% PR/MR/SR if omitted on create.

settings
object

Free-form writer settings (e.g. defaultTerritory, defaultShares). Not accepted via the create/update request bodies — set separately or defaulted to {}.

tenantUserId
string<uuid> | null
userData
object

Linked TenantUser account, included when the writer has a tenantUserId.

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