{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/songlinks-io/json-schema/songlinks-io-songwriters-response-schema.json",
  "title": "SongwritersResponse",
  "description": "The writers behind a list of recordings, by ISRC, in the order sent.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/songlinks-io-openapi.json#/components/schemas/SongwritersResponse",
  "properties": {
    "recordings": {
      "items": {
        "$ref": "#/$defs/RecordingAnswer"
      },
      "type": "array",
      "title": "Recordings",
      "description": "one entry per distinct ISRC, in the order first sent"
    },
    "rate_limit": {
      "anyOf": [
        {
          "$ref": "#/$defs/RateLimit"
        },
        {
          "type": "null"
        }
      ],
      "description": "your remaining allowance; null when no per-caller limit is in force"
    }
  },
  "type": "object",
  "required": [
    "recordings"
  ],
  "$defs": {
    "RateLimit": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit",
          "description": "requests allowed per window"
        },
        "remaining": {
          "type": "integer",
          "title": "Remaining",
          "description": "requests left in the current window"
        },
        "window_seconds": {
          "type": "integer",
          "title": "Window Seconds",
          "description": "the length of the window, in seconds"
        }
      },
      "type": "object",
      "required": [
        "limit",
        "remaining",
        "window_seconds"
      ],
      "title": "RateLimit",
      "description": "Your remaining allowance under a per-caller limit."
    },
    "RecordingAnswer": {
      "properties": {
        "isrc": {
          "type": "string",
          "title": "Isrc",
          "description": "the ISRC as 12 characters, upper case, without dashes. For an `invalid` entry, the text as sent, cut to 32 characters"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "description": "`registered`: the recording is registered to at least one work. `unregistered`: it is registered to no work in this data. `invalid`: not an ISRC (two letters, three letters or digits, seven digits; dashes and spaces are ignored)"
        },
        "works": {
          "items": {
            "$ref": "#/$defs/RecordingWork"
          },
          "type": "array",
          "title": "Works",
          "description": "the works the recording is registered to, confirmed works first; empty unless `status` is `registered`"
        },
        "works_withheld": {
          "type": "integer",
          "title": "Works Withheld",
          "description": "how many more works the registration data links to this recording that are left out because they are judged to be other songs: a different title and no writer in common, or a different song with the same title",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "isrc",
        "status"
      ],
      "title": "RecordingAnswer",
      "description": "One ISRC from the list: the works it is registered to and their writers."
    },
    "RecordingWork": {
      "properties": {
        "song_code": {
          "type": "string",
          "title": "Song Code",
          "description": "the work's song code in the registration data"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "the registered title"
        },
        "iswc": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Iswc",
          "description": "the work's ISWC, or null when the work has none"
        },
        "writers": {
          "items": {
            "$ref": "#/$defs/RecordingWriter"
          },
          "type": "array",
          "title": "Writers",
          "description": "the writers registered on the work; publishers and administrators are left out"
        },
        "unconfirmed": {
          "type": "boolean",
          "title": "Unconfirmed",
          "description": "true when the registration data links the recording to this work but the link could not be confirmed, for example when several different songs share the title. Check it before relying on it",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "song_code",
        "writers"
      ],
      "title": "RecordingWork",
      "description": "One work (a song as a composition) the recording is registered to."
    },
    "RecordingWriter": {
      "properties": {
        "party_record_id": {
          "type": "integer",
          "title": "Party Record Id",
          "description": "identifies the writer's registration record, as in a lookup's records"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "the name as registered"
        },
        "ipi_name_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ipi Name Number",
          "description": "the record's IPI name number, or null when it has none"
        },
        "role": {
          "type": "string",
          "title": "Role",
          "description": "the writer's role on the work, such as `ComposerLyricist`, `Composer` or `Lyricist`"
        },
        "persistent_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Persistent Id",
          "description": "the person ID this record belongs to, `SLP-XXXX-XXXX-C`; null when the record is not part of a stored person yet"
        },
        "person_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Person Url",
          "description": "the person's page, relative to this site; null when `persistent_id` is"
        }
      },
      "type": "object",
      "required": [
        "party_record_id",
        "role"
      ],
      "title": "RecordingWriter",
      "description": "One writer registered on a work the recording is registered to, and the person whose record it is."
    }
  }
}