# import Radio Taste

Retained recommendation Worker adapter. Automatic retries are disabled. Maximum UTF-8 request body: 4096 bytes.

Operation: importRadioTaste
POST /api/recommendation/radio/taste/import

Access: radio-capability. Automatic retries: none. Redirects: manual. Request body limit: 4096 bytes.
Default timeout: 30 seconds. Response limit: 16 MiB. Pagination is opt-in and bounded; an exhausted bound reports incomplete execution.

[HTML reference](/developers/api/importRadioTaste) · [Authoritative schemas](/api/openapi.json)

## Wire contract

```json
{
  "operationId": "importRadioTaste",
  "summary": "import Radio Taste",
  "tags": [
    "recommendation"
  ],
  "description": "Retained recommendation Worker adapter. Automatic retries are disabled. Maximum UTF-8 request body: 4096 bytes.",
  "parameters": [
    {
      "name": "X-Radio-Session",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "security": [
    {
      "RadioCapability": []
    }
  ],
  "x-public-access": "radio-capability",
  "x-public-side-effect": "model",
  "x-public-body-limit": 4096,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "url": {
              "type": "string"
            }
          },
          "required": [
            "url"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Successful response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "profile": {
                "type": "object",
                "properties": {
                  "schemaVersion": {
                    "const": "1"
                  },
                  "subject": {
                    "type": "object",
                    "properties": {
                      "canonicalUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "displayName": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 160,
                        "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                      }
                    },
                    "additionalProperties": false
                  },
                  "music": {
                    "type": "object",
                    "properties": {
                      "artists": {
                        "maxItems": 50,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "stance": {
                              "type": "string",
                              "enum": [
                                "love",
                                "like",
                                "curious",
                                "avoid"
                              ]
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "externalIds": {
                              "type": "object",
                              "properties": {
                                "spotify-artist": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "name",
                            "stance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "recordings": {
                        "maxItems": 100,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 240,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "artist": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 240,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "stance": {
                              "type": "string",
                              "enum": [
                                "love",
                                "like",
                                "curious",
                                "avoid"
                              ]
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "externalIds": {
                              "type": "object",
                              "properties": {
                                "isrc": {
                                  "type": "string",
                                  "pattern": "^[A-Z]{2}[A-Z0-9]{3}\\d{7}$"
                                },
                                "spotify-track": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "title",
                            "artist",
                            "stance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "albums": {
                        "maxItems": 40,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 240,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "artist": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 240,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "stance": {
                              "type": "string",
                              "enum": [
                                "love",
                                "like",
                                "curious",
                                "avoid"
                              ]
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "externalIds": {
                              "type": "object",
                              "properties": {
                                "discogs-master": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                                },
                                "discogs-release": {
                                  "type": "string",
                                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "title",
                            "artist",
                            "stance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "genres": {
                        "maxItems": 30,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 100,
                              "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                            },
                            "stance": {
                              "type": "string",
                              "enum": [
                                "love",
                                "like",
                                "curious",
                                "avoid"
                              ]
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            }
                          },
                          "required": [
                            "name",
                            "stance"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "notes": {
                        "maxItems": 12,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 240,
                          "pattern": "^(?![\\s\\S]*(?:[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]|<\\/?[A-Za-z][^>]*>|```|(?:[Dd][Aa][Tt][Aa]|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]|[Vv][Bb][Ss][Cc][Rr][Ii][Pp][Tt]):))[\\s\\S]+$"
                        }
                      }
                    },
                    "required": [
                      "artists",
                      "recordings",
                      "albums",
                      "genres",
                      "notes"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "schemaVersion",
                  "music"
                ],
                "additionalProperties": false
              },
              "source": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string"
                  },
                  "retrievedAt": {
                    "type": "string"
                  },
                  "transport": {
                    "type": "string",
                    "enum": [
                      "direct-json",
                      "link-json",
                      "well-known-json",
                      "mcp",
                      "markdown"
                    ]
                  },
                  "interpreted": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "origin",
                  "retrievedAt",
                  "transport",
                  "interpreted"
                ],
                "additionalProperties": false
              },
              "truncated": {
                "type": "boolean"
              },
              "unsupported": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "profile",
              "source",
              "truncated",
              "unsupported"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "400": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "401": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "403": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "413": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "429": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "502": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    },
    "503": {
      "description": "Request failed",
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/ProblemDetails"
          }
        }
      }
    }
  }
}
```

## Synthetic examples

### curl

```bash
curl --fail-with-body --max-time 30 --max-filesize 16777216 --request POST 'https://irvinebroque.com/api/recommendation/radio/taste/import' --header 'X-Radio-Session: fixture' --header 'Accept: application/json' --header "Authorization: Bearer $RADIO_CAPABILITY" --header 'Content-Type: application/json' --data-binary @request.json
```

### TypeScript

```typescript
import { PublicApi } from '@irvinebroque/public-api';
const api = new PublicApi();
const capability = 'replace-with-scoped-radio-capability';
const result = await api.radio.import({
  "X-Radio-Session": "fixture",
  "body": {
    "url": "https://profile.fixture.example/"
  }
}, { capability });
console.log(result.status, result.headers.get('content-type')); // Keep transient capabilities in memory.
```

### CLI

```bash
irvinebroque radio import --x-radio-session 'fixture' --body-file request.json --capability "$RADIO_CAPABILITY"
```

### request.json

```json
{
  "url": "https://profile.fixture.example/"
}
```
