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

# Update a CompanyShare

> Deprecated in favor of "Update a `CompanyShare` as a `Company`"

Update a `CompanyShare`.

This endpoint requires the `edit_company_share` permission.

Note that `external_id` can only be updated by the receiver `Company`.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/company_shares/{id}
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/company_shares/{id}:
    parameters:
      - schema:
          type: string
          format: uuid
        name: id
        in: path
        required: true
        description: CompanyShare ID
      - $ref: '#/components/parameters/Accept-Language'
    patch:
      tags:
        - CompanyShares
      summary: Update a CompanyShare
      description: |-
        Deprecated in favor of "Update a `CompanyShare` as a `Company`"

        Update a `CompanyShare`.

        This endpoint requires the `edit_company_share` permission.

        Note that `external_id` can only be updated by the receiver `Company`.
      operationId: patch-v1-company_shares-id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyShare-Update'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/CompanyShare-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      deprecated: true
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
  schemas:
    CompanyShare-Update:
      title: CompanyShare-Update
      x-stoplight:
        id: geay0k7358gt2
      type: object
      properties:
        external_id:
          type: string
          x-stoplight:
            id: kob9ztzpw31hb
        ticket_match_id:
          type: string
          x-stoplight:
            id: baa1ztzpw31hb
        dispatchable:
          type: boolean
          x-stoplight:
            id: goxg92u0s8end
        schedule_on:
          type: boolean
          x-stoplight:
            id: aaaa92u0s8end
        rate_override:
          type: boolean
          x-stoplight:
            id: 4ezg457x7lxek
        default_equipment_id:
          type: string
          x-stoplight:
            id: m1n56g7y6y1m5
          nullable: true
        default_additional_equipment_ids:
          type: array
          x-stoplight:
            id: o89g451x7vxb4
          items:
            x-stoplight:
              id: tkcbf1r95tmhc
            type: string
            format: uuid
        expires_at:
          type: string
          x-stoplight:
            id: fbckt1r95tmhc
          format: date-time
          description: ISO8601 timestamp with local timezone
          nullable: true
      additionalProperties: false
    CompanyShare-Read:
      title: CompanyShare-Read
      x-stoplight:
        id: 3fw8no6g8e334
      allOf:
        - $ref: '#/components/schemas/CompanyShare-Read-Nested'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          x-stoplight:
            id: 5tvsur0wkmwr3
          required:
            - parent_company_share_id
            - company_shareable_id
            - company_shareable_type
            - receiver_company
            - company_shareable
          properties:
            parent_company_share_id:
              type: string
              x-stoplight:
                id: hl0lvh254bdch
              format: uuid
              nullable: true
            company_shareable_id:
              type: string
              x-stoplight:
                id: l5wwd21py5c6e
              format: uuid
              deprecated: true
            company_shareable_type:
              $ref: '#/components/schemas/CompanyShareableType'
              deprecated: true
            receiver_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            company_shareable:
              $ref: '#/components/schemas/CompanyShareable-Read-Nested'
    CompanyShare-Read-Nested:
      title: CompanyShare-Read-Nested
      x-stoplight:
        id: makajouqsb7jq
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: s6h0nfzt2fjry
          required:
            - external_id
            - ticket_match_id
            - sender_company
            - dispatchable
            - schedule_on
            - rate_override
            - expires_at
          properties:
            external_id:
              type: string
              x-stoplight:
                id: c9ls3nrhbih3v
              nullable: true
            ticket_match_id:
              type: string
              x-stoplight:
                id: a1cd3nrhbih3v
              nullable: true
            sender_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            dispatchable:
              type: boolean
              x-stoplight:
                id: kd884ihz6qi6w
            schedule_on:
              type: boolean
              x-stoplight:
                id: kd884ihz61234
            rate_override:
              type: boolean
              x-stoplight:
                id: mq4osazzielxo
            expires_at:
              type: string
              x-stoplight:
                id: aaa111jpq0ga9
              format: date-time
              description: ISO8601 timestamp with local timezone
              nullable: true
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    CompanyShareableType:
      title: CompanyShareType
      x-stoplight:
        id: o6j5rtwll4fvm
      enum:
        - User
        - Equipment
        - Site
      description: ''
    Company-Read-Nested:
      title: Company-Read-Nested
      x-stoplight:
        id: cb2kn77qmf1l7
      description: Compact Company model for nested reads.
      allOf:
        - $ref: '#/components/schemas/Identifier'
          x-stoplight:
            id: jwsufva4znm91
        - $ref: '#/components/schemas/TreadId'
        - type: object
          properties:
            legal_name:
              type: string
              x-stoplight:
                id: yc10t8hieecwk
              description: The Company's name. Must be globally unique.
            company_type:
              $ref: '#/components/schemas/CompanyType'
          required:
            - legal_name
            - company_type
    CompanyShareable-Read-Nested:
      title: CompanyShareable-Read-Nested
      x-stoplight:
        id: 7gq4gh59nzv6r
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: f3fdykm0k5rid
          required:
            - name
            - type
          properties:
            name:
              type: string
              x-stoplight:
                id: m0zwbwf2ta0tr
            type:
              $ref: '#/components/schemas/CompanyShareableType'
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    TreadId:
      title: TreadId
      x-stoplight:
        id: 43k4t5tl359m4
      type: object
      required:
        - tread_id
      properties:
        tread_id:
          type: string
          x-stoplight:
            id: zi3ld7djflw6f
          pattern: ^[0-9A-F]{6}$
          minLength: 6
          maxLength: 6
          example: ABC123
          description: Tread ID
      additionalProperties: false
    CompanyType:
      title: CompanyType
      x-stoplight:
        id: dkzo7gjbtb1b3
      enum:
        - broker
        - contractor
        - hauler
        - owner_operator
        - producer
        - super
      example: hauler
      description: Company Type
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
  responses:
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````