Teams
Endpoints for creating and managing teams within your organization.
List All Teams
Returns all teams in your organization.
GET /organization/teams
Request
curl -X GET "https://server.headshotpro.com/api/v2/organization/teams" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"teams": [
{
"id": "team_xyz789",
"name": "Marketing"
},
{
"id": "team_abc123",
"name": "Engineering"
},
{
"id": "team_def456",
"name": "Sales"
}
]
}
Create Team
Creates a new team in your organization.
POST /organization/teams
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Team name (must be unique) |
Request
curl -X POST "https://server.headshotpro.com/api/v2/organization/teams" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Product"
}'
Response
{
"success": true,
"organization": {
"uid": "org_abc123def456",
"name": "Acme Corporation",
"website": "https://acme.com",
"teams": [
{
"id": "team_xyz789",
"name": "Marketing"
},
{
"id": "team_new123",
"name": "Product"
}
]
}
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_REQUEST | Team name is required |
| 400 | INVALID_REQUEST | Team with this name already exists |
Update Team
Updates a team's name.
PUT /organization/teams/:teamId
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New team name |
Request
curl -X PUT "https://server.headshotpro.com/api/v2/organization/teams/team_xyz789" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing & Brand"
}'
Response
{
"success": true,
"organization": {
"uid": "org_abc123def456",
"name": "Acme Corporation",
"website": "https://acme.com",
"teams": [
{
"id": "team_xyz789",
"name": "Marketing & Brand"
}
]
}
}
Delete Team
Deletes a team from your organization.
DELETE /organization/teams/:teamId
Request
curl -X DELETE "https://server.headshotpro.com/api/v2/organization/teams/team_xyz789" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"organization": {
"uid": "org_abc123def456",
"name": "Acme Corporation",
"website": "https://acme.com",
"teams": [
{
"id": "team_abc123",
"name": "Engineering"
}
]
}
}
Important Notes
- Users are not deleted when a team is deleted - they remain in the organization but become unassigned
- Pending invites for the deleted team are cancelled
- This action cannot be undone