---
title: "Set active team REST API | HitKeep"
description: "Reference for the HitKeep REST API operation Set active team, including request parameters, responses, and authentication notes."
canonical: "https://hitkeep.com/api/operations/apiuserteamsactive/"
---

# Set active team REST API

PUT

/api/user/teams/active

FetchcURL

```
const url = 'http://127.0.0.1:25737/api/user/teams/active';
const options = {
  method: 'PUT',
  headers: {cookie: 'hk_token=<hk_token>', 'Content-Type': 'application/json'},
  body: '{"team_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```
curl --request PUT \
  --url http://127.0.0.1:25737/api/user/teams/active \
  --header 'Content-Type: application/json' \
  --cookie hk_token=<hk_token> \
  --data '{ "team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'
```

-

Sets the current active team context for the authenticated user.

## Authorizations

- **[cookieAuth](https://hitkeep.com/api/#cookieauth)**

## Request Bodyrequired

application/json

object

**team_id**

required

string format: uuid

##### Examplegenerated

```
{
  "team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
```

## Responses

### 200

Active team response

application/json

object

**active_team_id**

string format: uuid

**recent_team_ids**

Array<string>

**status**

string

##### Examplegenerated

```
{
  "active_team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
  "recent_team_ids": [
    "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
  ],
  "status": "example"
}
```

### 403

Access denied

application/json

object

**message**

string

##### Examplegenerated

```
{
  "message": "example"
}
```

[Previous Create team](https://hitkeep.com/api/operations/apiuserteams/post/)[Next Update team (deprecated)](https://hitkeep.com/api/operations/apiuserteamsid/put/)
