Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How do you remove a component from a group via the components/ API?

I'd like to remove a component from its group via the API. I'm trying to do this by using PATCH on the specific component's URL. Here's the cUrl I'm trying:

curl -v https://api.statuspage.io/v1/pages/$PAGE_ID/components/$COMPONENT_ID \
-H "Authorization: OAuth $STATUSPAGE_AUTH_TOKEN" \
-X PATCH \
-H "Content-Type: application/json" \
-d '{"component":{"group_id":null}}'

However, this gives the following error:

{"error":"Couldn't find GroupComponent"}

I also tried setting the `group_id` to `""` but that gave the same result. What do I actually need to do to achieve this?

I'd like to avoid using the component-groups/ API methods if possible as this way is more convenient. You can set a component's group in the UI page for that particular component so I don't see why the API should be any different.

1 answer

1 accepted

0 votes
Answer accepted
Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 19, 2022

Hi @Luke Murray ,

Happy to help!

The endpoint you've shown is for components, but you will need to the component-groups endpoint shown here https://developer.statuspage.io/#operation/patchPagesPageIdComponentGroupsId in order to remove the components. This command will essentially "overwrite" the original group contents so that it will contain the components you list in the command.

Please let me know if that was what you were looking for!

Thank you,
Shivam

Disappointing you can't do it that way but I can see why you can't.

Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 21, 2022

That's feedback I can pass along to our Engineering team; it is a bit confusing choosing the right endpoint for this particular task, but since this is related to Groups specifically vs individual components, that former endpoint will be the one to use as a means of changing the groups themselves.

Please let us know if you have any follow up questions!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events