Skip to content

PatchCollaboration

Walter Lara edited this page May 16, 2023 · 3 revisions

Patch Collaboration

Allows to update an existing Song Collaboration. This operation is only allowed when the requestor is the Collaboration owner and the status is Editing.

Request

URL: /v1/collaorations/{collaorationId}

Method: PATCH

Path Parameters: None

Query Parameters: None

Headers:

Authorization: Bearer {accessToken}

Content-Type: application/json

Content:

Field Type Description Requirement Type
email string Email of the Collaborator. Optional
role string Collaborator role. Optional
royaltyRate decimal Percentage of total royalties owned to the Collaborator. Optional
credited boolean Indicates whether or not the Collaboration should be credited to the Collaborator. Optional
featured boolean Indicates whether or this Collaboration is for a featured Collaborator. Optional

Content example:

{
    "email": "[email protected]",
    "role": "Composer",
    "royaltyRate": 10.5,
    "credited": true,
    "featured": true
}

✅ Success Response

Code: 204 NO CONTENT

Headers: None

❌ Error Responses

1. Unauthorized

Code: 401 UNAUTHORIZED

Condition: If {accessToken} is invalid or expired.

2. Forbidden

Code: 403 FORBIDDEN

Condition: If the requestor is not the Collaboration owner.

Headers:

Content-Type: application/json

Content example:

{
    "code": 403,
    "description": "Forbidden",
    "cause": "Operation allowed only by owner"
}

3. Not Found

Code: 404 NOT FOUND

Condition: If the specified Collaboration is not found.

Headers:

Content-Type: application/json

Content example:

{
    "code": 404,
    "description": "Not Found",
    "cause": "Entity CollaborationEntity, id=d0907e3d-a9a7-43b1-93dc-f3b0ee929021 not found in the database"
}

4. Conflict

Code: 409 CONFLICT

Condition: If email was already used in another collaboration on the same song.

Headers:

Content-Type: application/json

Content example:

{
    "code": 409,
    "description": "Conflict",
    "cause": "Collaboration already exists: songId = a1031b4b-144e-4b97-93aa-d58e2c5c245f, email = [email protected]"
}

5. Unprocessable Entity

Code: 422 UNPROCESSABLE ENTITY

Condition: If any field is malformed, exceeds maximum length allowed or operation attempted when status is other thanEditing .

Headers:

Content-Type: application/json

Content example:

{
    "code": 422,
    "description": "Unprocessable Entity",
    "cause": "Operation only allowed when status = Editing"
}

See Also

Post Collaboration (Add New Collaboration)

Get Collaboration

Get Collaborations

Get Collaboration Count

Delete Collaboration

Reply Collaboration

Get Collaborators

Get Collaborator Count

Clone this wiki locally