/v1/societies/{code} (PUT)
PUT
/v1/societies/{code}
const url = 'https://api.emely.io/v1/societies/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","kind":"example","homeCountryCode":"example","cisacCode":"example","comment":"example","active":true,"roles":[{"role":"songwriter","societyType":"example"}],"rights":["pr"],"detailRights":[{"role":"songwriter","rightType":"pr","countryCode":"example","subRights":["example"]}],"links":[{"linkedAgencyCode":"example","rightType":"pr"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.emely.io/v1/societies/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "kind": "example", "homeCountryCode": "example", "cisacCode": "example", "comment": "example", "active": true, "roles": [ { "role": "songwriter", "societyType": "example" } ], "rights": [ "pr" ], "detailRights": [ { "role": "songwriter", "rightType": "pr", "countryCode": "example", "subRights": [ "example" ] } ], "links": [ { "linkedAgencyCode": "example", "rightType": "pr" } ] }'Create or update one society via the adminUpsertSociety Action. Absence rule: an omitted field or section is untouched upstream; an explicit [] clears that section; explicit null clears homeCountryCode, cisacCode and comment. There is no DELETE: deactivate with active=false.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”code
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
string
kind
string
homeCountryCode
string | null
cisacCode
string | null
comment
string | null
active
boolean
roles
Array<object>
object
role
required
string
societyType
required
string
rights
Array<string>
detailRights
Array<object>
object
role
required
string
rightType
required
string
countryCode
required
string
subRights
required
Array<string>
links
Array<object>
object
linkedAgencyCode
required
string
rightType
required
string
Responses
Section titled “ Responses ”The upserted society id and code
Media typeapplication/json
object
id
required
string
code
required
string
Examplegenerated
{ "id": "example", "code": "example"}Validation refused by the Action
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Missing or invalid bearer token
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Token role refused upstream
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Upstream error
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}