> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Colleagues API

> API for listing colleagues (potential invitees) for a user within a client organization.

## GET `/v1/colleagues-list`

This endpoint is used to retrieve a list of colleagues associated with a specific user.

When it is called, it will return all colleagues that have been created for the specified user and are available for invitation.

### Endpoint URL

The endpoint URL is `https://api.wazper.com/v1/colleagues-list`

### HTTP Method

`GET`

### Headers

| Header      | Type   | Required | Description                     |
| ----------- | ------ | -------- | ------------------------------- |
| `X-API-Key` | String | Yes      | Your Wazper API Key.            |
| `Accept`    | String | No       | Recommended `application/json`. |

### Query Parameters

| Parameter | Type   | Required | Description                                                          |
| --------- | ------ | -------- | -------------------------------------------------------------------- |
| `email`   | String | Yes      | The email address of the user whose colleagues you want to retrieve. |

### Example Request (cURL)

```bash theme={null}
curl -X GET 'https://api.wazper.com/v1/colleagues-list?email=current.user%40example.com' \
-H 'X-API-Key: YOUR_API_KEY'
```

### Success Response (200 OK)

The response contains an array of colleague objects, sorted with joined colleagues first, then by photo presence, and finally by creation date.

```json theme={null}
[
  {
    "id": "tbi_abc123",
    "name": "Jane Colleague",
    "email": "jane.colleague@example.com",
    "jobTitle": "Product Manager",
    "status": "pending",
    "createdAt": "2023-10-26T10:00:00.000Z",
    "companyName": "Example Inc.",
    "website": "https://example.com",
    "inviteLink": "https://app.wazper.com/invite/xyz789",
    "redirectionLink": "https://app.wazper.com/dashboard",
    "photo": null
  },
  {
    "id": "tbi_def456",
    "name": "John Teammate",
    "email": "john.teammate@example.com",
    "jobTitle": "Engineer",
    "status": "joined",
    "createdAt": "2023-10-25T10:00:00.000Z",
    "companyName": "Example Inc.",
    "website": null,
    "inviteLink": "https://app.wazper.com/invite/uvw456",
    "redirectionLink": "https://app.wazper.com/dashboard",
    "photo": "https://cdn.example.com/john.png"
  }
]
```

### Error Responses

* **400 Bad Request - Email Parameter Missing:**

  ```json theme={null}
  { "error": "Email parameter is required" }
  ```
* **400 Bad Request - API Key Not Linked:**

  ```json theme={null}
  { "error": "API Key is not linked to a valid organization." }
  ```
* **401 Unauthorized - API Key Required:**

  ```json theme={null}
  { "error": "API Key is required" }
  ```
* **401 Unauthorized - Invalid API Key:**

  ```json theme={null}
  { "error": "Invalid API Key or key not linked to an organization" }
  ```
* **403 Forbidden - Waz Disabled:**

  ```json theme={null}
  { "error": "Waz is currently disabled" }
  ```
* **500 Internal Server Error:**

  ```json theme={null}
  { "error": "Internal server error", "details": "The error message from the server." }
  ```

### Notes

* This API does not consume credits from your account.
* Results are limited to 50 colleagues maximum.
* Colleagues with "deleted" status are excluded from the results.
* The list is sorted to show joined colleagues first, then colleagues with photos, and finally by newest creation date.


## OpenAPI

````yaml GET /v1/colleagues-list
openapi: 3.0.1
info:
  title: Wazper API
  description: >-
    API for Wazper services, including user synchronization and colleague
    management.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.wazper.com
security:
  - ApiKeyAuth: []
paths:
  /v1/colleagues-list:
    get:
      tags:
        - V1 API
      summary: List Colleagues
      description: >-
        Retrieves a list of colleagues associated with a specific user within a
        client organization.
      operationId: getV1ColleaguesList
      parameters:
        - name: email
          in: query
          description: The email address of the user whose colleagues are to be listed.
          required: true
          schema:
            type: string
            format: email
      responses:
        '200':
          description: A list of colleagues.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/V1ColleagueRecord'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    V1ColleagueRecord:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the colleague entry (ToBeInvited table).
        name:
          type: string
          description: Name of the colleague.
        email:
          type: string
          format: email
          description: Email of the colleague.
        jobTitle:
          type: string
          nullable: true
          description: Job title.
        status:
          type: string
          description: Current status (e.g., pending, invited, joined).
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp.
        companyName:
          type: string
          description: Company name.
        website:
          type: string
          format: url
          nullable: true
          description: Website URL.
        inviteLink:
          type: string
          format: url
          nullable: true
          description: Invite link.
        redirectionLink:
          type: string
          format: url
          nullable: true
          description: Redirection link.
        photo:
          type: string
          format: url
          nullable: true
          description: Photo URL.
        team:
          type: integer
          nullable: true
          description: Team identifier.
        wazClientId:
          type: string
          description: Wazper Client ID.
        toBeInvitedById:
          type: string
          format: email
          description: Email of the user who created this entry.
        latestAction:
          type: string
          format: date-time
          description: Timestamp of the last action.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of last update.
    WazperError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    BadRequestError:
      description: >-
        Bad Request - The request could not be understood by the server due to
        malformed syntax. The client SHOULD NOT repeat the request without
        modifications.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WazperError'
          examples:
            missingField:
              value:
                error: Field X is required
            invalidFormat:
              value:
                error: Invalid format for field Y
    UnauthorizedError:
      description: >-
        Unauthorized - The request requires user authentication. The client may
        repeat the request with a valid X-Client-ID or other authorization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WazperError'
          example:
            error: Invalid client ID
    ForbiddenError:
      description: >-
        Forbidden - The server understood the request, but is refusing to
        fulfill it. Authorization will not help and the request SHOULD NOT be
        repeated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WazperError'
          example:
            error: Waz is currently disabled
    InternalServerError:
      description: >-
        Internal Server Error - The server encountered an unexpected condition
        which prevented it from fulfilling the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WazperError'
          example:
            error: Internal server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````