curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/2001 \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
{
"teamId": "2001"
}
{ "code": 16, "message": "unauthenticated" }
API
Enable or disable a team
Enable or disable one GitHub team in Macroscope
curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/2001 \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
{
"teamId": "2001"
}
{ "code": 16, "message": "unauthenticated" }
Enables or disables one GitHub team in Macroscope, as the Teams setting does on the settings page. Disabled teams are left out of team statistics and team selections. Read each team’s current state in
See Errors for the rest.
enabled from List team memberships.
Setting a team to its current state succeeds. Each attempt, including a refused or invalid one, is recorded in the workspace audit log with its outcome and the API key, or the person and connected app, that made it. Requests rejected before they reach the operation, such as malformed requests, invalid credentials and rate-limited requests, may have no entry.
Authorization
Requires an Admin API key, or an OAuth sign-in with Admin access by a person who is a workspace admin. Read and Write keys get403, and a sign-in with Read or Write access gets an insufficient_scope challenge for macroscope:admin. To enable or disable a secret GitHub team with OAuth sign-in, you must also be a current member of that team. A secret team returns 404 to a nonmember or an API key.
Bearer <key>. See Authentication.How your client identifies the source of the request in the workspace audit log. Use
human or agent. Macroscope records the client’s value without verifying it. Other values are treated as unspecified.Path parameters
Team ID, as returned in
id by List team memberships: a decimal number with no leading zero, up to 19 digits.Body
Response
Errors
| HTTP | Meaning |
|---|---|
400 | Invalid request, such as a missing enabled or a teamId that is not a decimal team ID |
403 | Your credential or your permissions do not allow changing teams |
404 | The team does not exist, or you cannot see it |
curl -X PATCH https://api.macroscope.com/api/v1/workspaces/GITHUB_ORGANIZATION/12345678/teams/2001 \
-H "Authorization: Bearer $MACROSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
{
"teamId": "2001"
}
{ "code": 16, "message": "unauthenticated" }