Skip to content

Add GET /api/v1/sites/teams endpoint and make related adjustments#5220

Merged
zoldar merged 6 commits intomasterfrom
add-sites-api-teams
Mar 20, 2025
Merged

Add GET /api/v1/sites/teams endpoint and make related adjustments#5220
zoldar merged 6 commits intomasterfrom
add-sites-api-teams

Conversation

@zoldar
Copy link
Contributor

@zoldar zoldar commented Mar 19, 2025

Changes

This PR adds a Sites API endpoint for listing teams the user is a member in. The team identifier from that endpoint can be used when either creating sites via POST /api/v1/sites to create a site under a particular team or scope the list of sites to a particular team with GET /api/v1/sites?team_id=....

The team identifier input was removed from Team Settings to avoid confusing users who don't actively use the API, which is the only place where identifier is explicitly used so far.

The endpoint is under scope which is implicitly available to all API keys. The api_available field on team entry determines if the team has Stats API feature enabled. If it's disabled, it's not possible to create sites under it (or, for that matter, run other API queries against its sites).

The GET /api/v1/sites endpoint was adjusted to scope sites to a team exclusively, if an identifier is provided.

TODO

Tests

  • Automated tests have been added

@zoldar zoldar force-pushed the add-sites-api-teams branch from 44af061 to be8642c Compare March 20, 2025 08:19
@zoldar zoldar requested a review from ukutaht March 20, 2025 10:22
@zoldar zoldar force-pushed the add-sites-api-teams branch from e1bd567 to de3fd76 Compare March 20, 2025 13:09
@zoldar zoldar added this pull request to the merge queue Mar 20, 2025
Merged via the queue into master with commit bc143d4 Mar 20, 2025
9 of 12 checks passed
@zoldar zoldar deleted the add-sites-api-teams branch March 20, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants