Update a distribution list
const url = 'https://calendar.work.optidata.cloud/api/groups/distribution-list/update';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"zid":"5a1c1f7e-9f2d-4a6b-8a30-1c0d9d2f4b11","email":"engineering-team@acme.example","users":[{"uuid":"9e926fb1-e1ff-4fc9-81a1-5740f10ba57f","email":"jane.doe@acme.example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://calendar.work.optidata.cloud/api/groups/distribution-list/update \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "zid": "5a1c1f7e-9f2d-4a6b-8a30-1c0d9d2f4b11", "email": "engineering-team@acme.example", "users": [ { "uuid": "9e926fb1-e1ff-4fc9-81a1-5740f10ba57f", "email": "jane.doe@acme.example" } ] }'Renames a distribution list and replaces its membership.
users is the complete list of who should be on it afterwards: the
server compares it with the current membership and adds or removes people
so the two match. Sending an empty users empties the list.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Identifier of the list to update.
Address the list should answer at after the update.
The complete membership after the update.
object
Optiwork UUID of the user.
Examples
{ "zid": "5a1c1f7e-9f2d-4a6b-8a30-1c0d9d2f4b11", "email": "engineering-team@acme.example", "users": [ { "uuid": "9e926fb1-e1ff-4fc9-81a1-5740f10ba57f", "email": "jane.doe@acme.example" } ]}Responses
Section titled “ Responses ”The distribution list was updated.
Acknowledgement returned by several write operations.
object
Examples
{ "message": "Distribution list updated successfully"}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}No distribution list has that identifier.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Distribution list not found"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The event title field is required.", "errors": { "title": [ "The event title field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}