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

# Update a counsellor

> Changes only the fields you send. `name` and `mobile_number` change only when the login belongs to your account alone; `active: false` deactivates and `true` reactivates. Admins and other staff are never changed (403).

Scope: `counsellors:manage`.



## OpenAPI

````yaml /api-reference/openapi.json patch /counsellors/{id}
openapi: 3.1.0
info:
  title: Telleo API
  version: 1.3.0
  description: >-
    Start AI phone calls, or connect your counsellors to contacts, from your own
    systems and get each call's outcome back. Manage your counsellors and AI
    agents from the same API.
servers:
  - url: https://api.telleo.ai/v1
security:
  - ApiKey: []
tags:
  - name: Calls
  - name: Batches
  - name: Agents
  - name: Human calls
  - name: Counsellors
  - name: Credits
  - name: Webhook
paths:
  /counsellors/{id}:
    patch:
      tags:
        - Counsellors
      summary: Update a counsellor
      description: >-
        Changes only the fields you send. `name` and `mobile_number` change only
        when the login belongs to your account alone; `active: false`
        deactivates and `true` reactivates. Admins and other staff are never
        changed (403).


        Scope: `counsellors:manage`.
      operationId: updateCounsellor
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCounsellor'
            example:
              mobile_number: '+919812345678'
              airtel_extension: null
      responses:
        '200':
          description: The updated counsellor.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CounsellorWrite'
        '400':
          description: The request is not valid.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_request:
                  value:
                    error:
                      code: invalid_request
                      message: >-
                        mobile_number must be in E.164 format, e.g.
                        +919876543210.
                      request_id: req_8f2c1a7e
        '401':
          description: The key is missing, unknown, revoked or expired.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_api_key:
                  value:
                    error:
                      code: missing_api_key
                      message: Send your API key in the X-API-Key header.
                      request_id: req_8f2c1a7e
                invalid_api_key:
                  value:
                    error:
                      code: invalid_api_key
                      message: This API key is not valid.
                      request_id: req_8f2c1a7e
        '403':
          description: Not a counsellor the API may change, or the key lacks the scope.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                counsellor_not_manageable:
                  value:
                    error:
                      code: counsellor_not_manageable
                      message: >-
                        This person is an admin or other staff of this account
                        (ADMIN)…
                      request_id: req_8f2c1a7e
                insufficient_scope:
                  value:
                    error:
                      code: insufficient_scope
                      message: This API key does not have the counsellors:manage scope.
                      request_id: req_8f2c1a7e
        '404':
          description: No counsellor or admin with this id in your account.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                counsellor_not_found:
                  value:
                    error:
                      code: counsellor_not_found
                      message: No counsellor 6b7e… in this account.
                      request_id: req_8f2c1a7e
        '409':
          description: The change is not possible.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                shared_account:
                  value:
                    error:
                      code: shared_account
                      message: >-
                        This counsellor's account also belongs to another
                        account on the platform…
                      request_id: req_8f2c1a7e
                extension_taken:
                  value:
                    error:
                      code: extension_taken
                      message: >-
                        Airtel extension 201 is already mapped to another person
                        in this account.
                      request_id: req_8f2c1a7e
                extension_managed_elsewhere:
                  value:
                    error:
                      code: extension_managed_elsewhere
                      message: >-
                        This counsellor's Airtel extension is managed by another
                        account on the platform.
                      request_id: req_8f2c1a7e
        '429':
          description: Too many requests for this key.
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rate_limited:
                  value:
                    error:
                      code: rate_limited
                      message: Too many requests. Retry after 12 seconds.
                      request_id: req_8f2c1a7e
        '503':
          description: Your user directory could not be reached for a moment.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                temporarily_unavailable:
                  value:
                    error:
                      code: temporarily_unavailable
                      message: >-
                        Could not reach the account directory right now. Retry
                        shortly.
                      request_id: req_8f2c1a7e
components:
  schemas:
    UpdateCounsellor:
      type: object
      minProperties: 1
      properties:
        name:
          type: string
          maxLength: 120
          description: >-
            Only for a login that belongs to your account alone (else `409
            shared_account`).
        mobile_number:
          type: string
          description: E.164. Same rule as `name`. Cannot be removed.
        airtel_extension:
          type:
            - string
            - 'null'
          description: '`null` removes the mapping.'
        active:
          type: boolean
          description: '`false` deactivates (as `DELETE`), `true` reactivates.'
    CounsellorWrite:
      allOf:
        - $ref: '#/components/schemas/Counsellor'
        - type: object
          properties:
            created:
              type: boolean
              description: >-
                `true` when this request made the person a counsellor here;
                `false` when they already were (nothing changed).
            existing_account:
              type: boolean
              description: >-
                The email already had a login on the platform: it was reused,
                its name, mobile and password were not changed, and no email was
                sent.
            welcome_email_sent:
              type: boolean
            effects:
              type: object
              additionalProperties: true
              description: >-
                On deactivation / reactivation: what else changed (see the
                counsellors guide).
            warnings:
              type: array
              items:
                $ref: '#/components/schemas/Warning'
              description: >-
                Non-fatal notes about what was (not) done, e.g.
                `mobile_number_missing`.
            idempotent_replay:
              type: boolean
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable code. Branch on this, not on the message.
              example: invalid_request
            message:
              type: string
              description: A sentence you can log or show to an operator.
            request_id:
              type: string
              description: Quote this when you contact support.
            details:
              type: object
              additionalProperties: true
              description: >-
                Extra context, e.g. `errors: [{field, message}]` for validation
                errors or `call_id` for conflicts.
    Counsellor:
      type: object
      properties:
        id:
          type: string
          description: Use as `counsellor_id` on `POST /human-calls`.
        object:
          type: string
          const: counsellor
        name:
          type: string
        email:
          type:
            - string
            - 'null'
        roles:
          type: array
          items:
            type: string
          example:
            - COUNSELLOR
        can_call:
          type: boolean
          description: >-
            Whether this person can take a human call right now on your calling
            provider.
        blocked_reason:
          type:
            - string
            - 'null'
          description: >-
            Why `can_call` is false, e.g. no mobile number on their profile
            (Vacademy Voice, Exotel) or no Airtel extension mapped.
        status:
          type: string
          enum:
            - active
            - invited
            - inactive
          description: >-
            `inactive` after `DELETE /counsellors/{id}` (deactivated); `GET
            /counsellors` lists active ones only.
        mobile_number:
          type:
            - string
            - 'null'
          description: >-
            Only on `GET /counsellors/{id}` (and write responses) for keys with
            `counsellors:manage`, and `null` when the login also belongs to
            another account (`shared_account`). Digits with the country code, as
            stored on the profile.
          example: '919876543210'
        airtel_extension:
          type:
            - string
            - 'null'
          description: >-
            Only on single-counsellor responses, for keys with
            `counsellors:manage`.
        manageable:
          type: boolean
          description: >-
            Only for `counsellors:manage` keys: whether the API may change this
            person (their roles here are counsellor roles only). Admins and
            other staff are `false`.
        shared_account:
          type: boolean
          description: >-
            Only for `counsellors:manage` keys: the login also belongs to
            another account on the platform, so its name and mobile number
            cannot be changed through the API.
    Warning:
      type: object
      description: >-
        Something in the request that was accepted but may not do what you
        expect.
      properties:
        field:
          type: string
          example: variables.date
        code:
          type: string
          enum:
            - reserved_variable
        message:
          type: string
          example: >-
            {{date}} in the agent's script is always filled with the current
            date and time; this value does not replace it. The agent receives it
            only as information about the contact.
  headers:
    RequestId:
      schema:
        type: string
      description: Unique id of this request. Quote it to support.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your AI calling API key (`vak_call_…`). `Authorization: Bearer <key>`
        also works.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.