task_id: task_create_api_update_artist entity_id: api_update_artist generated_at: '2025-12-18T15:16:50.238503' workflow_version: v001 target: type: api definition: id: api_update_artist method: PUT path: /api/artists/:id description: Update artist profile request_body: stage_name: string bio: string cover_image_url: string social_links: object responses: - status: 200 description: Artist updated schema: id: uuid stage_name: string bio: string - status: 403 description: Unauthorized schema: error: string auth: required: true owner_only: true depends_on_models: - model_artist related: models: - id: model_artist definition: &id001 id: model_artist name: Artist table_name: artists description: Extended profile for musicians fields: - name: id type: uuid constraints: - primary_key - name: user_id type: uuid constraints: - not_null - foreign_key references: users.id - name: stage_name type: string constraints: - not_null - name: bio type: text constraints: - nullable - name: cover_image_url type: string constraints: - nullable - name: social_links type: jsonb description: JSON object with {twitter, instagram, facebook, website} constraints: - nullable - name: verified type: boolean default: false - name: created_at type: timestamp constraints: - not_null - name: updated_at type: timestamp constraints: - not_null relations: - type: belongs_to to: model_user foreign_key: user_id - type: has_many to: model_song foreign_key: artist_id - type: has_many to: model_album foreign_key: artist_id - type: belongs_to to: model_label foreign_key: label_id optional: true indexes: - fields: - user_id unique: true - fields: - stage_name timestamps: true apis: [] components: [] dependencies: entity_ids: - model_artist definitions: - id: model_artist type: model definition: *id001 files: to_create: - app/api/artists/id/route.ts reference: [] acceptance: - criterion: PUT /api/artists/:id returns success response verification: curl -X PUT /api/artists/:id - criterion: Request validation implemented verification: Test with invalid data - criterion: Error responses match contract verification: Test error scenarios