# Teams

Read more about teams from [Teams documentation](https://prompteasy.eu/docs/features/teams).

## Get a list of teams

`GET /v1/teams`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Responses:

- 200: A list of teams

Content type: application/json

Type: array

Items:
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/teams' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/teams',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Create a new team

`POST /v1/teams`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Request body: application/json (required)

Type: object

Schema: [TeamRequest](https://api.prompteasy.eu/docs/api/models/teamrequest/index.md)

- `name` (optional)
  Type: string
  
  Team name
  
  Example:
  
  ```json
  "Tech Team"
  ```

- `user_id` (optional)
  Type: integer
  
  User id to be added as admin
  
  Example:
  
  ```json
  1
  ```

Responses:

- 201: Team object

Content type: application/json

Type: object

Schema: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md)

- `id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Tech Team"
  ```

- `tenant_id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/teams' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Tech Team",
  "user_id": 1
}'
```

### JavaScript

```javascript
const body = `{
  "name": "Tech Team",
  "user_id": 1
}`;

const response = await fetch('https://api.prompteasy.eu/v1/teams', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "Tech Team",
  "user_id": 1
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/teams',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Get a single team

`GET /v1/teams/{team}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Responses:

- 200: Team object with users

Content type: application/json

Type: TeamWithUsers

Represents a team entity along with its assigned member details and permission scopes.

Schema: [TeamWithUsers](https://api.prompteasy.eu/docs/api/models/teamwithusers/index.md)

allOf:
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

  Type: object
  
  - `users` (optional)
    Type: array
    
    Items:
      Reference: [User](https://api.prompteasy.eu/docs/api/models/user/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/teams/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams/0', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/teams/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Update a team

`PUT /v1/teams/{team}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [TeamRequest](https://api.prompteasy.eu/docs/api/models/teamrequest/index.md)

- `name` (optional)
  Type: string
  
  Team name
  
  Example:
  
  ```json
  "Tech Team"
  ```

- `user_id` (optional)
  Type: integer
  
  User id to be added as admin
  
  Example:
  
  ```json
  1
  ```

Responses:

- 200: Team object

Content type: application/json

Type: object

Schema: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md)

- `id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `name` (optional)
  Type: string
  
  Example:
  
  ```json
  "Tech Team"
  ```

- `tenant_id` (optional)
  Type: integer
  
  Example:
  
  ```json
  1
  ```

- `created_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- `updated_at` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2025-11-25T13:12:29+00:00"
  ```

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'https://api.prompteasy.eu/v1/teams/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "Tech Team",
  "user_id": 1
}'
```

### JavaScript

```javascript
const body = `{
  "name": "Tech Team",
  "user_id": 1
}`;

const response = await fetch('https://api.prompteasy.eu/v1/teams/0', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "Tech Team",
  "user_id": 1
}'''

response = requests.put(
    'https://api.prompteasy.eu/v1/teams/0',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Delete a team

`DELETE /v1/teams/{team}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Responses:

- 204: No Content

- 403: Forbidden

## Examples

### cURL

```bash
curl -X DELETE 'https://api.prompteasy.eu/v1/teams/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams/0', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://api.prompteasy.eu/v1/teams/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Get a list of users in a team

`GET /v1/teams/{team}/members`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Responses:

- 200: Team object with users

Content type: application/json

Type: TeamWithUsers

Represents a team entity along with its assigned member details and permission scopes.

Schema: [TeamWithUsers](https://api.prompteasy.eu/docs/api/models/teamwithusers/index.md)

allOf:
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

  Type: object
  
  - `users` (optional)
    Type: array
    
    Items:
      Reference: [User](https://api.prompteasy.eu/docs/api/models/user/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/teams/0/members' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams/0/members', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/teams/0/members',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Add a member to a team

`POST /v1/teams/{team}/members`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [AddMemberToTeamRequest](https://api.prompteasy.eu/docs/api/models/addmembertoteamrequest/index.md)

- `id` (optional)
  Type: integer
  
  User id
  
  Example:
  
  ```json
  1
  ```

- `role` (optional)
  Type: string
  
  Example:
  
  ```json
  "viewer"
  ```

Responses:

- 200: Team object with users

Content type: application/json

Type: TeamWithUsers

Represents a team entity along with its assigned member details and permission scopes.

Schema: [TeamWithUsers](https://api.prompteasy.eu/docs/api/models/teamwithusers/index.md)

allOf:
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

  Type: object
  
  - `users` (optional)
    Type: array
    
    Items:
      Reference: [User](https://api.prompteasy.eu/docs/api/models/user/index.md); Type: object

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X POST 'https://api.prompteasy.eu/v1/teams/0/members' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 1,
  "role": "viewer"
}'
```

### JavaScript

```javascript
const body = `{
  "id": 1,
  "role": "viewer"
}`;

const response = await fetch('https://api.prompteasy.eu/v1/teams/0/members', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "id": 1,
  "role": "viewer"
}'''

response = requests.post(
    'https://api.prompteasy.eu/v1/teams/0/members',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Get a list of vaults in a team

`GET /v1/teams/{team}/vaults`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

Responses:

- 200: A list of vaults

Content type: application/json

Type: array

Items:
  Reference: [Vault](https://api.prompteasy.eu/docs/api/models/vault/index.md); Type: object

- 403: Forbidden

## Examples

### cURL

```bash
curl -X GET 'https://api.prompteasy.eu/v1/teams/0/vaults' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams/0/vaults', {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get(
    'https://api.prompteasy.eu/v1/teams/0/vaults',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```


## Edit a member's role in a team

`PUT /v1/teams/{team}/members/{user}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

- `user` (path, integer, required)
  Type: integer

Request body: application/json (required)

Type: object

Schema: [EditMemberRoleInTeamRequest](https://api.prompteasy.eu/docs/api/models/editmemberroleinteamrequest/index.md)

- `role` (optional)
  Type: string
  
  Example:
  
  ```json
  "viewer"
  ```

Responses:

- 200: Team object with users

Content type: application/json

Type: TeamWithUsers

Represents a team entity along with its assigned member details and permission scopes.

Schema: [TeamWithUsers](https://api.prompteasy.eu/docs/api/models/teamwithusers/index.md)

allOf:
  Reference: [Team](https://api.prompteasy.eu/docs/api/models/team/index.md); Type: object

  Type: object
  
  - `users` (optional)
    Type: array
    
    Items:
      Reference: [User](https://api.prompteasy.eu/docs/api/models/user/index.md); Type: object

- 403: Forbidden

- 422: Unprocessable Entity

Content type: application/json

Type: object

Schema: [ValidationError](https://api.prompteasy.eu/docs/api/models/validationerror/index.md)

- `message` (optional)
  Type: string
  
  Example:
  
  ```json
  "Validation failed"
  ```

- `errors` (optional)
  Reference: [ValidationErrorErrors](https://api.prompteasy.eu/docs/api/models/validationerrorerrors/index.md); Type: object

## Examples

### cURL

```bash
curl -X PUT 'https://api.prompteasy.eu/v1/teams/0/members/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "role": "viewer"
}'
```

### JavaScript

```javascript
const body = `{
  "role": "viewer"
}`;

const response = await fetch('https://api.prompteasy.eu/v1/teams/0/members/0', {
  method: 'PUT',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "role": "viewer"
}'''

response = requests.put(
    'https://api.prompteasy.eu/v1/teams/0/members/0',
    data=body.encode('utf-8'),
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```


## Remove a member from a team

`DELETE /v1/teams/{team}/members/{user}`

Authentication (security requirement alternatives):

```json
[
  {
    "ApiKeyAuth": [],
    "BearerAuth": []
  }
]
```

- ApiKeyAuth: apiKey, header X-Api-Key
- BearerAuth: http (bearer)

Parameters:

- `team` (path, integer, required)
  Type: integer

- `user` (path, integer, required)
  Type: integer

Responses:

- 204: No Content

- 403: Forbidden

## Examples

### cURL

```bash
curl -X DELETE 'https://api.prompteasy.eu/v1/teams/0/members/0' \
  -H 'X-Api-Key: YOUR_TOKEN' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### JavaScript

```javascript
const response = await fetch('https://api.prompteasy.eu/v1/teams/0/members/0', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_TOKEN',
    'Authorization': 'Bearer YOUR_TOKEN',
  },
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.delete(
    'https://api.prompteasy.eu/v1/teams/0/members/0',
    headers={
        'X-Api-Key': 'YOUR_TOKEN',
        'Authorization': 'Bearer YOUR_TOKEN',
    },
)
print(response.text)
```
