Skip to main content
POST
/
work
/
registrations
Create or update a CWR registration
curl --request POST \
  --url https://api.royalti.io/work/registrations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "societyCode": "<string>",
  "societyName": "<string>",
  "workId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "confirmationNumber": "<string>",
  "registrationId": "<string>",
  "notes": "<string>",
  "metadata": {}
}
'
import requests

url = "https://api.royalti.io/work/registrations"

payload = {
"societyCode": "<string>",
"societyName": "<string>",
"workId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"confirmationNumber": "<string>",
"registrationId": "<string>",
"notes": "<string>",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
societyCode: '<string>',
societyName: '<string>',
workId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
confirmationNumber: '<string>',
registrationId: '<string>',
notes: '<string>',
metadata: {}
})
};

fetch('https://api.royalti.io/work/registrations', 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/work/registrations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'societyCode' => '<string>',
'societyName' => '<string>',
'workId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'confirmationNumber' => '<string>',
'registrationId' => '<string>',
'notes' => '<string>',
'metadata' => [

]
]),
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/work/registrations"

payload := strings.NewReader("{\n \"societyCode\": \"<string>\",\n \"societyName\": \"<string>\",\n \"workId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmationNumber\": \"<string>\",\n \"registrationId\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {}\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.royalti.io/work/registrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"societyCode\": \"<string>\",\n \"societyName\": \"<string>\",\n \"workId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmationNumber\": \"<string>\",\n \"registrationId\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.royalti.io/work/registrations")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"societyCode\": \"<string>\",\n \"societyName\": \"<string>\",\n \"workId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"confirmationNumber\": \"<string>\",\n \"registrationId\": \"<string>\",\n \"notes\": \"<string>\",\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "workId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "tenantId": 123,
  "societyCode": "<string>",
  "societyName": "<string>",
  "registrationStatus": "pending",
  "statusDate": "2023-11-07T05:31:56Z",
  "confirmationNumber": "<string>",
  "registrationId": "<string>",
  "notes": "<string>",
  "metadata": {},
  "queuedAt": "2023-11-07T05:31:56Z",
  "submittedAt": "2023-11-07T05:31:56Z",
  "submissionFileId": "<string>",
  "submissionFileHash": "<string>",
  "attempts": 0,
  "lastAttemptAt": "2023-11-07T05:31:56Z",
  "lastErrorMessage": "<string>",
  "isDeadLettered": true,
  "work": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workTitle": "<string>",
    "iswc": "<string>",
    "submitterWorkNumber": "<string>"
  }
}
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenantId": 123,
"societyCode": "<string>",
"societyName": "<string>",
"registrationStatus": "pending",
"statusDate": "2023-11-07T05:31:56Z",
"confirmationNumber": "<string>",
"registrationId": "<string>",
"notes": "<string>",
"metadata": {},
"queuedAt": "2023-11-07T05:31:56Z",
"submittedAt": "2023-11-07T05:31:56Z",
"submissionFileId": "<string>",
"submissionFileHash": "<string>",
"attempts": 0,
"lastAttemptAt": "2023-11-07T05:31:56Z",
"lastErrorMessage": "<string>",
"isDeadLettered": true,
"work": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workTitle": "<string>",
"iswc": "<string>",
"submitterWorkNumber": "<string>"
}
}
{
"status": "error",
"message": "<string>",
"code": "<string>",
"details": {}
}
{
"status": "error",
"message": "<string>",
"code": "<string>",
"details": {}
}
{
"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

POST /work/registrations Description: Upserts a WorkRegistration keyed on (tenantId, societyCode, workId). workId may be omitted/null for a society-level registration not tied to a specific work. queuedAt is never set by this endpoint — creation always leaves the row un-queued (registrationStatus: pending unless another status is given); use POST .../queue to opt in to PRO submission. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

const response = await fetch('https://api.royalti.io/work/registrations', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "ref": "#/components/schemas/CreateOrUpdateRegistrationRequest"
  })
});

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

response = requests.post(
  'https://api.royalti.io/work/registrations',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/CreateOrUpdateRegistrationRequest"}
)

data = response.json()
print(data)
curl -X POST https://api.royalti.io/work/registrations \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ref":"#/components/schemas/CreateOrUpdateRegistrationRequest"}'

Authorizations

Authorization
string
header
required

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

Body

application/json

Upsert keyed on (tenantId, societyCode, workId) — an existing row for the same work/society pair is updated (200) rather than duplicated; otherwise a new row is created (201). metadata is shallow-merged into the existing value on update.

societyCode
string
required
Required string length: 2 - 3
societyName
string
required
registrationStatus
enum<string>
required
Available options:
pending,
submitted,
registered,
rejected,
conflict,
cancelled
workId
string<uuid> | null

Omit/null for a society-level registration not tied to a specific work

confirmationNumber
string
registrationId
string
notes
string
metadata
object

Response

Existing registration for this work/society updated

id
string<uuid>
workId
string<uuid> | null
tenantId
integer
societyCode
string

2-3 character society code (e.g. ASCAP, BMI, PRS)

societyName
string
registrationStatus
enum<string>
default:pending
Available options:
pending,
submitted,
registered,
rejected,
conflict,
cancelled
statusDate
string<date-time>
confirmationNumber
string | null
registrationId
string | null

External/society-assigned registration identifier (distinct from the row's own id)

notes
string | null
metadata
object
queuedAt
string<date-time> | null

Set when the row is explicitly queued for PRO submission; null on creation

submittedAt
string<date-time> | null
submissionFileId
string | null
submissionFileHash
string | null
attempts
integer
default:0
lastAttemptAt
string<date-time> | null
lastErrorMessage
string | null
isDeadLettered
boolean
work
object | null

Present when eager-loaded