Skip to main content
POST
/
publishing-bootstrap
/
apply
curl --request POST \
  --url https://api.royalti.io/publishing-bootstrap/apply \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "batchId": "publishing-bootstrap-6f1d2c3b-9a8e-4f5d-b0c1-2d3e4f5a6b7c"
}
'
{
  "status": "success",
  "message": "Imported 12 item(s), 1 failed",
  "data": {
    "imported": 123,
    "failed": 123,
    "itemIds": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "errors": [
      {
        "itemId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "error": "unresolved conflict: set finalData.resolveConflict to \"link\" or \"create\""
      }
    ],
    "createdWorkIds": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ]
  }
}
{
"status": "error",
"message": "<string>"
}
{
"status": "error",
"message": "<string>",
"code": "<string>",
"details": {}
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

POST /publishing-bootstrap/apply Description: Imports the selected PENDING items into the CWR tables. Each item runs in its OWN transaction — a failing item is marked failed (with importError) without rolling back its siblings — and re-apply is idempotent (only pending items are picked up). Per item:
  • create items insert a skeleton CWRWork (title capped at 60 chars, canonical ISWC or null, seeded enums, metadata tagged source: publishing-bootstrap), find-or-create each writer (deduped by tenant-scoped IPI, then case-insensitive name), and link the work to its recordings.
  • link items only add work-recording links to the existing target work — no work or writer creation.
  • The asset’s iswc is backfilled ONLY when currently empty; an existing value is never overwritten.
  • Unresolved conflict items fail with an error instructing the reviewer to set finalData.resolveConflict first.
Share-free guarantee: writers are created with empty territories, and work-writer links carry no relative share, are uncontrolled, and have no territories. No publisher or agreement rows are ever touched. Ownership data is entered by a human after import. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

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

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

response = requests.post(
  'https://api.royalti.io/publishing-bootstrap/apply',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"ref":"#/components/schemas/PublishingApplyRequest"}
)

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

Authorizations

Authorization
string
header
required

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

Body

application/json

Provide batchId, itemIds, or both (intersection). At least one is required.

batchId
string

Apply every pending item in this batch.

itemIds
string<uuid>[]

Apply only these pending items.

Response

Apply finished — per-item outcomes in the payload (individual failures do not fail the request)

status
string
Example:

"success"

message
string
Example:

"Imported 12 item(s), 1 failed"

data
object