Automating Bulk Wrap-Up Code Assignment to Multiple Queues

I am currently helping a client reorganize their wrap-up codes for their new Agent Assist deployment. We have over one hundred wrap-up codes that need to be assigned to fifty different queues. I see that I can do this manually in the UI, but it is extremely tedious. Is there a Platform API endpoint that allows for bulk assignment of wrap-up codes to multiple queues at once, or should I be looking at a script that iterates through every queue individually?

1 Like

Greetings. I am a Performance dashboard power user and I have seen these configuration tasks eat up many hours for our admins. Unfortunately, there is no single ‘Bulk Assign’ endpoint for wrap-up codes across multiple queues. You must use the /api/v2/routing/queues/{queueId}/wrapupcodes endpoint for each queue. I recommend writing a small Python script that uses a nested loop to iterate through your queue list and apply the desired wrap-up code list to each one. It is the only way to avoid the manual labor!

1 Like

I deal with the backend provisioning for our global sites. To follow up on Sop61, when you run your script, please make sure you are not ‘Overwriting’ the existing wrap-up codes on those queues. The endpoint is a POST, but if you want to replace the whole list, you have to be careful. Also, keep an eye on the rate limits! Sending fifty requests in a few seconds might trigger a 429 error from the platform. A small delay between each queue update will ensure your script finishes successfully.

Hello everyone! I am a Microsoft Teams integrator and I love seeing these automation scripts! Kaz85, if you want to make your script even more powerful, you should store your queue-to-code mappings in a CSV file. Your script can then read the CSV and apply the changes dynamically. This makes it very easy to ‘Rollback’ the changes if you make a mistake, or to apply the same configuration to a ‘Staging’ org before you move to production. It is a very professional way to handle large-scale configuration changes!

1 Like

glad to hear the CSV approach is working for you. we’re doing something similar for our ServiceNow sync, but instead of just a static list, we pull the queue IDs dynamically. saves a lot of headaches when queues get renamed or deleted.

for the actual payload, make sure you’re sending the full list of wrap-up codes you want on that queue, not just the new ones. the API replaces the entire list on POST. if you miss one, it’s gone. also, wrap-up codes are scoped to the org, so the IDs should be consistent across queues, but double-check that you’re not mixing up different wrap-up code sets if your org has multiple.

here’s a quick snippet for the payload structure:

{
 "wrapUpCodes": [
 {
 "id": "wrap-up-code-id-1",
 "name": "Call Successful"
 },
 {
 "id": "wrap-up-code-id-2",
 "name": "Callback Needed"
 }
 ]
}

we hit a snag last month where a queue had a custom wrap-up code that wasn’t in our master list. the script wiped it out. added a quick GET call before the POST to merge the existing codes with our new ones. looks like this:

  1. GET /api/v2/routing/queues/{queueId}/wrapupcodes
  2. Merge the response with your desired codes (dedup by ID).
  3. POST the merged list back.

takes a bit longer, but safer. rate limiting is real too. we add a 200ms delay between requests. fifty queues won’t trigger a 429, but if you scale to hundreds, it will. also, make sure your auth token has the routing:queue:update scope. we got burned by a token with only read access once.

if you’re using Python, requests library handles the retries nicely. just set up a simple exponential backoff for 429s. saves you from having to manually restart the script halfway through.

1 Like