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

# Partially Update a Representative

> Updates only the supplied fields of one representative in your company. Sending `availability` updates the representative's personal hours, or creates them if the representative has none. Requires the matching representative permission on your API user; other callers receive a 403. Contact Sela staff to grant it.



## OpenAPI

````yaml /Sela_API.yaml patch /api/representatives/{id}/
openapi: 3.0.3
info:
  title: Sela API
  version: 1.0.2
  description: >-
    Create and manage leads, configure outbound webhook subscriptions, and use
    customer-specific lead ingestion workflows. Unless an endpoint says
    otherwise, authenticate with `Authorization: Token <api-key>`.
servers:
  - url: https://api.trysela.com/
    description: Production API
security: []
tags:
  - name: Leads
    description: Create, retrieve, update, and schedule customer leads.
  - name: Call Control
    description: Pause or resume outbound calling for an API user.
  - name: Lead Types
    description: >-
      Discover lead categories and the public metadata fields accepted for each
      one.
  - name: Representatives
    description: >-
      Manage your company's representatives, such as loan officers, and their
      personal hours.
  - name: Webhooks
    description: >-
      Manage subscriptions that deliver lead and call events to customer
      systems.
  - name: Lead Ingestion
    description: >-
      Submit provider-specific lead payloads through ingestion URLs configured
      by Sela.
  - name: File Ingestion
    description: Request temporary upload URLs for configured CSV ingestion sources.
paths:
  /api/representatives/{id}/:
    patch:
      tags:
        - Representatives
      summary: Partially Update a Representative
      description: >-
        Updates only the supplied fields of one representative in your company.
        Sending `availability` updates the representative's personal hours, or
        creates them if the representative has none. Requires the matching
        representative permission on your API user; other callers receive a 403.
        Contact Sela staff to grant it.
      operationId: representatives_partial_update
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          description: A unique integer value identifying this representative.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedRepresentativeRequest'
            examples:
              DeactivateARepresentative:
                value:
                  active: false
                summary: Deactivate a representative
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedRepresentativeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedRepresentativeRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Representative'
              examples:
                Representative:
                  value:
                    id: 42
                    external_id: jdoe
                    phone_number: '+14155550123'
                    email: jane.doe@example.com
                    active: true
                    metadata:
                      nmls_id: '123456'
                    created_time: '2026-11-02T15:04:05Z'
                    modified_time: '2026-11-02T15:04:05Z'
                    availability:
                      id: 7
                      description: Jane's hours
                      times:
                        wkd:
                          - 9
                          - 17
                        sat: null
                        sun: null
                      timezone: America/New_York
                      created_time: '2026-11-02T15:04:05Z'
                      modified_time: '2026-11-02T15:04:05Z'
          description: Representative updated successfully.
        '400':
          description: >-
            A field is invalid, the availability times or timezone are invalid,
            or another representative in your company already uses the
            external_id or phone_number.
        '401':
          description: API token is missing or invalid.
        '403':
          description: The API user does not have the required representative permission.
        '404':
          description: Representative not found.
      security:
        - tokenAuth: []
      x-codeSamples:
        - lang: curl
          label: DeactivateARepresentative
          source: |-
            curl --request PATCH \
              --url https://api.trysela.com/api/representatives/<representative-id>/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "active": false
              }'
components:
  schemas:
    PatchedRepresentativeRequest:
      type: object
      description: >-
        A representative in your company, such as a loan officer, and their
        personal hours.


        `external_id` and `phone_number` are unique within your company.
        `availability`, when

        set, replaces your company's hours for this representative.
      properties:
        external_id:
          type: string
          minLength: 1
          description: >-
            Your unique identifier for the representative (e.g. username,
            employee id). This is required and must be unique per company.
          maxLength: 255
        phone_number:
          type: string
          nullable: true
          maxLength: 128
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        active:
          type: boolean
        metadata: {}
        availability:
          allOf:
            - $ref: '#/components/schemas/RepresentativeAvailabilityRequest'
          nullable: true
    Representative:
      type: object
      description: >-
        A representative in your company, such as a loan officer, and their
        personal hours.


        `external_id` and `phone_number` are unique within your company.
        `availability`, when

        set, replaces your company's hours for this representative.
      properties:
        id:
          type: integer
          readOnly: true
        external_id:
          type: string
          description: >-
            Your unique identifier for the representative (e.g. username,
            employee id). This is required and must be unique per company.
          maxLength: 255
        phone_number:
          type: string
          nullable: true
          maxLength: 128
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        active:
          type: boolean
        metadata: {}
        created_time:
          type: string
          format: date-time
          readOnly: true
        modified_time:
          type: string
          format: date-time
          readOnly: true
        availability:
          allOf:
            - $ref: '#/components/schemas/RepresentativeAvailability'
          nullable: true
      required:
        - created_time
        - external_id
        - id
        - modified_time
    RepresentativeAvailabilityRequest:
      type: object
      properties:
        description:
          type: string
          minLength: 1
          description: A descriptive name of the availability.
          maxLength: 255
        times:
          description: >-
            This JSON structure defines call hour settings for different days,
            including weekdays, weekends, holidays, and specific dates. Time
            values can be a single range [start, end] or multiple ranges
            [[start1, end1], [start2, end2], ...] sorted by start time and
            non-overlapping. Priority Order (highest to lowest): 1. Specific
            dates ('dates', optional): A dictionary where keys are specific
            dates in 'YYYY-MM-DD' format and values are null or time ranges,
            e.g., 'dates': { '2025-12-31': [9, 17], '2025-01-15': null }.
            Specific dates have the highest priority and override all other
            settings. 2. Special holidays ('holidays', optional): A dictionary
            where keys are holiday names and values are null or time ranges,
            e.g., 'holidays': { 'New Year's Day': [8, 20] }. 3. General holidays
            ('hld', optional): Call hours for all federal holidays not
            specifically defined. 4. Specific weekdays ('mon', 'tue', 'wed',
            'thu', 'fri', 'sat', 'sun', optional): Call hours for specific days
            of the week. 5. General weekdays ('wkd', required): Default call
            hours for weekdays not specifically defined. Required Fields: 'wkd'
            (nullable or time range. Use null if no calls should be made, e.g.,
            [9, 17], [8.5, 17.5], or [[9, 12], [14, 17]] for split hours), 'sat'
            (nullable or time range, same as for 'wkd' but for Saturday), 'sun'
            (nullable or time range, same as for 'wkd' but for Sunday). Optional
            Fields (can be omitted or set to null or a time range): 'mon',
            'tue', 'wed', 'thu', 'fri', 'hld', 'dates', 'holidays'. If 'hld' is
            omitted, holidays will be considered as regular weekdays. Example
            JSON: { 'dates': { '2025-12-25': null, '2025-10-12': [10, 14] },
            'hld': null, 'wkd': [[9, 12], [13, 17]], 'sat': null, 'sun': null,
            'holidays': { 'Christmas Day': [10, 16] } }. This setup allows calls
            on weekdays from 9-12 and 13-17 (lunch break), no calls on weekends,
            special hours on Christmas Day, no calls on 2025-12-25 (specific
            date override), and custom hours on 2025-10-12. List of all
            holidays: 'Dr. Martin Luther King Jr. / Civil Rights Day', 'Dr.
            Martin Luther King Jr. and Robert E. Lee's Birthdays', 'New Year's
            Eve', 'Lyndon Baines Johnson Day', 'Mardi Gras', 'Juneteenth
            National Independence Day', 'Town Meeting Day', 'George Washington's
            Birthday and Daisy Gatson Bates Day', 'Washington's Birthday', 'San
            Jacinto Day', 'Patriots' Day', 'Memorial Day', 'Thanksgiving',
            'Columbus Day / American Indian Heritage Day / Fraternal Day',
            'Native Americans' Day', 'Indigenous Peoples' Day / Columbus Day',
            'Casimir Pulaski Day', 'Day After Christmas', 'Bennington Battle
            Day', 'Evacuation Day', 'Friday After Thanksgiving', 'Martin Luther
            King Jr. / Idaho Human Rights Day', 'Labor Day', 'Veterans Day',
            'Prince Jonah Kuhio Kalanianaole Day', 'Good Friday', 'Jefferson
            Davis Birthday', 'Emancipation Day In Texas', 'Columbus Day',
            'Primary Election Day', 'Seward's Day', 'State Holiday', 'Alaska
            Day', 'Frances Xavier Cabrini Day', 'Kamehameha Day', 'American
            Indian Heritage Day', 'Martin Luther King, Jr & Robert E. Lee's
            Birthday', 'Martin Luther King Jr. Day', 'Election Day', 'Truman
            Day', 'Pioneer Day', 'George Washington & Thomas Jefferson's
            Birthday', 'Family Day', 'Lincoln's Birthday', 'West Virginia Day',
            'Susan B. Anthony Day', 'Confederate Memorial Day', 'Independence
            Day', 'Indigenous Peoples' Day', 'Presidents' Day', 'Statehood Day',
            'Christmas Eve', 'Arbor Day', 'Texas Independence Day', 'Cesar
            Chavez Day', 'Day After Thanksgiving', 'New Year's Day', 'Victory
            Day', 'Christmas Day', 'Nevada Day', 'Inauguration Day'.
        timezone:
          type: string
          minLength: 1
          description: The timezone that the times are specified in.
          maxLength: 63
      required:
        - times
        - timezone
    RepresentativeAvailability:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        description:
          type: string
          description: A descriptive name of the availability.
          maxLength: 255
        times:
          description: >-
            This JSON structure defines call hour settings for different days,
            including weekdays, weekends, holidays, and specific dates. Time
            values can be a single range [start, end] or multiple ranges
            [[start1, end1], [start2, end2], ...] sorted by start time and
            non-overlapping. Priority Order (highest to lowest): 1. Specific
            dates ('dates', optional): A dictionary where keys are specific
            dates in 'YYYY-MM-DD' format and values are null or time ranges,
            e.g., 'dates': { '2025-12-31': [9, 17], '2025-01-15': null }.
            Specific dates have the highest priority and override all other
            settings. 2. Special holidays ('holidays', optional): A dictionary
            where keys are holiday names and values are null or time ranges,
            e.g., 'holidays': { 'New Year's Day': [8, 20] }. 3. General holidays
            ('hld', optional): Call hours for all federal holidays not
            specifically defined. 4. Specific weekdays ('mon', 'tue', 'wed',
            'thu', 'fri', 'sat', 'sun', optional): Call hours for specific days
            of the week. 5. General weekdays ('wkd', required): Default call
            hours for weekdays not specifically defined. Required Fields: 'wkd'
            (nullable or time range. Use null if no calls should be made, e.g.,
            [9, 17], [8.5, 17.5], or [[9, 12], [14, 17]] for split hours), 'sat'
            (nullable or time range, same as for 'wkd' but for Saturday), 'sun'
            (nullable or time range, same as for 'wkd' but for Sunday). Optional
            Fields (can be omitted or set to null or a time range): 'mon',
            'tue', 'wed', 'thu', 'fri', 'hld', 'dates', 'holidays'. If 'hld' is
            omitted, holidays will be considered as regular weekdays. Example
            JSON: { 'dates': { '2025-12-25': null, '2025-10-12': [10, 14] },
            'hld': null, 'wkd': [[9, 12], [13, 17]], 'sat': null, 'sun': null,
            'holidays': { 'Christmas Day': [10, 16] } }. This setup allows calls
            on weekdays from 9-12 and 13-17 (lunch break), no calls on weekends,
            special hours on Christmas Day, no calls on 2025-12-25 (specific
            date override), and custom hours on 2025-10-12. List of all
            holidays: 'Dr. Martin Luther King Jr. / Civil Rights Day', 'Dr.
            Martin Luther King Jr. and Robert E. Lee's Birthdays', 'New Year's
            Eve', 'Lyndon Baines Johnson Day', 'Mardi Gras', 'Juneteenth
            National Independence Day', 'Town Meeting Day', 'George Washington's
            Birthday and Daisy Gatson Bates Day', 'Washington's Birthday', 'San
            Jacinto Day', 'Patriots' Day', 'Memorial Day', 'Thanksgiving',
            'Columbus Day / American Indian Heritage Day / Fraternal Day',
            'Native Americans' Day', 'Indigenous Peoples' Day / Columbus Day',
            'Casimir Pulaski Day', 'Day After Christmas', 'Bennington Battle
            Day', 'Evacuation Day', 'Friday After Thanksgiving', 'Martin Luther
            King Jr. / Idaho Human Rights Day', 'Labor Day', 'Veterans Day',
            'Prince Jonah Kuhio Kalanianaole Day', 'Good Friday', 'Jefferson
            Davis Birthday', 'Emancipation Day In Texas', 'Columbus Day',
            'Primary Election Day', 'Seward's Day', 'State Holiday', 'Alaska
            Day', 'Frances Xavier Cabrini Day', 'Kamehameha Day', 'American
            Indian Heritage Day', 'Martin Luther King, Jr & Robert E. Lee's
            Birthday', 'Martin Luther King Jr. Day', 'Election Day', 'Truman
            Day', 'Pioneer Day', 'George Washington & Thomas Jefferson's
            Birthday', 'Family Day', 'Lincoln's Birthday', 'West Virginia Day',
            'Susan B. Anthony Day', 'Confederate Memorial Day', 'Independence
            Day', 'Indigenous Peoples' Day', 'Presidents' Day', 'Statehood Day',
            'Christmas Eve', 'Arbor Day', 'Texas Independence Day', 'Cesar
            Chavez Day', 'Day After Thanksgiving', 'New Year's Day', 'Victory
            Day', 'Christmas Day', 'Nevada Day', 'Inauguration Day'.
        timezone:
          type: string
          description: The timezone that the times are specified in.
          maxLength: 63
        created_time:
          type: string
          format: date-time
          readOnly: true
        modified_time:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_time
        - id
        - modified_time
        - times
        - timezone
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |-
        Token-based authentication. Format: `Token <your_token>`

        Example: `Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b`

````

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