Skip to content

Equipos

Los equipos agrupan miembros de la organización para check-ins, mensajería y gestión de flujos de trabajo. Usa estos endpoints para listar equipos, ver miembros y gestionar la membresía de equipos.

Método Endpoint Descripción
GET /v1/teams/ Listar todos los equipos
GET /v1/teams/{team-uuid}/ Obtener un equipo específico
GET /v1/teams/{team-uuid}/members/ Obtener miembros del equipo
POST /v1/teams/{team-uuid}/member/ Agregar un miembro al equipo
DELETE /v1/teams/{team-uuid}/member/{user-uuid}/ Remover un miembro del equipo
GET /v1/teams/{team-uuid}/member/{user-uuid}/ Obtener un miembro del equipo
PATCH /v1/teams/{team-uuid}/member/{user-uuid}/ Actualizar un miembro del equipo

Listar Equipos

GET /v1/teams/

Devuelve todos los equipos de la organización.

Petición
curl -X GET "https://api.dailybot.com/v1/teams/" \
  -H "X-API-KEY: tu_api_key"
Response 200 OK
json
[
  {
    "uuid": "team-uuid",
    "name": "Ingeniería",
    "active": true,
    "is_default": false
  }
]

Obtener Equipo

GET /v1/teams/{team-uuid}/

Devuelve un equipo por UUID.

Petición
curl -X GET "https://api.dailybot.com/v1/teams/team-uuid/" \
  -H "X-API-KEY: tu_api_key"
Response 200 OK
json
{
  "uuid": "team-uuid",
  "name": "Ingeniería",
  "active": true,
  "is_default": false
}
Response 404 Not Found
json
{
  "detail": "Not found.",
  "code": "not_found"
}

Obtener Miembros del Equipo

GET /v1/teams/{team-uuid}/members/

Devuelve la lista de miembros del equipo.

Petición
curl -X GET "https://api.dailybot.com/v1/teams/team-uuid/members/" \
  -H "X-API-KEY: tu_api_key"
Response 200 OK
json
[
  {
    "uuid": "user-uuid",
    "full_name": "María García",
    "image": "https://...",
    "role": "admin",
    "is_active": true,
    "bot_enabled": true,
    "timezone": "America/New_York",
    "occupation": "Diseñadora",
    "birth_date": "02-08",
    "chat_platform_data": {},
    "work_days": [
      0,
      1,
      2,
      3,
      4
    ],
    "timeoff_start": null,
    "timeoff_end": null,
    "hour_init_work": "09:00",
    "anniversary": null,
    "organization": {
      "uuid": "org-uuid",
      "name": "Acme Corp"
    }
  }
]

Agregar Miembro al Equipo

POST /v1/teams/{team-uuid}/member/

Añade miembros a un equipo.

Parámetros del Cuerpo

Name Type Required Description
members array Required Lista de objetos de miembro a añadir (estructura definida por la API).
Petición
curl -X POST "https://api.dailybot.com/v1/teams/team-uuid/member/" \
  -H "X-API-KEY: tu_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "members": [
      { "uuid": "user-uuid" }
    ]
  }'
Response 200 OK
json
{
  "detail": "Users added to team successfully!"
}
Response 400 Bad Request
json
{
  "detail": "This team does not belong to your organization"
}

Remover Miembro del Equipo

DELETE /v1/teams/{team-uuid}/member/{user-uuid}/

Remueve un miembro del equipo. Debe quedar al menos un miembro. Permitido para administradores de organización o administradores del equipo.

Petición
curl -X DELETE "https://api.dailybot.com/v1/teams/team-uuid/member/user-uuid/" \
  -H "X-API-KEY: tu_api_key"
Response 204 No Content
json
Response 400 Bad Request
json
{
  "detail": "This action is only allowed for organization admins or team admins"
}
Response 400 Bad Request (ejemplo 2)
json
{
  "detail": "There must be at least one team member"
}
Response 404 Not Found
json
{
  "detail": "Not found.",
  "code": "not_found"
}

Obtener Miembro del Equipo

GET /v1/teams/{team-uuid}/member/{user-uuid}/

Devuelve una membresía de equipo (role, user, team) por UUID de equipo y UUID de usuario. Usa este endpoint cuando necesites el rol de membresía; usa GET /v1/teams/{team-uuid}/members/{user-uuid}/ para el perfil completo del usuario.

Petición
curl -X GET "https://api.dailybot.com/v1/teams/team-uuid/member/user-uuid/" \
  -H "X-API-KEY: tu_api_key"
Response 200 OK
json
{
  "team": {
    "uuid": "team-uuid",
    "name": "Ingeniería",
    "active": true,
    "is_default": false
  },
  "user": {
    "uuid": "user-uuid",
    "full_name": "María García",
    "image": "...",
    "role": "member",
    "is_active": true
  },
  "role": "member"
}
Response 404 Not Found
json
{
  "detail": "Not found.",
  "code": "not_found"
}

Actualizar Miembro del Equipo

PATCH /v1/teams/{team-uuid}/member/{user-uuid}/

Actualiza el rol de un miembro del equipo (ej. establecer como admin del equipo). Permitido para administradores de organización o administradores del equipo.

Parámetros del Cuerpo

Name Type Required Description
role string Optional Nuevo rol. Valores permitidos: MEMBER, ADMIN_ORG, MANAGER.
Petición
curl -X PATCH "https://api.dailybot.com/v1/teams/team-uuid/member/user-uuid/" \
  -H "X-API-KEY: tu_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'
Response 200 OK
json
{
  "team": {
    "uuid": "team-uuid",
    "name": "Ingeniería",
    "active": true,
    "is_default": false
  },
  "user": {
    "uuid": "user-uuid",
    "full_name": "María García",
    "image": "...",
    "role": "admin",
    "is_active": true
  },
  "role": "admin"
}
Response 400 Bad Request
json
{
  "detail": "This action is only allowed for organization admins or team admins"
}
Response 404 Not Found
json
{
  "detail": "Not found.",
  "code": "not_found"
}