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

# Update source

> Update an existing source



## OpenAPI

````yaml patch /v2/sources/{id}
openapi: 3.1.0
info:
  title: The Portable API
  description: This API allows you to interact with the Portable platform.
  version: 0.0.1
servers:
  - url: https://api.portable.io
security:
  - bearerAuth: []
paths:
  /v2/sources/{id}:
    parameters:
      - $ref: '#/components/parameters/id'
    patch:
      tags:
        - Sources
      summary: Update source
      description: Update an existing source
      operationId: updateSource
      requestBody:
        description: Source to update
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                displayName:
                  type: string
                  description: A human-readable name for the source
                  x-order: 1
                properties:
                  $ref: '#/components/schemas/PropertyInput'
            example:
              displayName: ''
              properties:
                domain: veradata-3625884588
                api_key: '********'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Source'
              example:
                data:
                  id: 80562
                  displayName: ''
                  sourceSpec:
                    name: freshsales
                    instructions: >-
                      **API Key:** Each user in Freshsales is provided with a
                      unique API key. To find your API key


                      1. Click your profile picture and select Profile Settings.

                      2. Click the API Settings tab.

                      3. You can find your API key in the field Your API key.


                      **Subdomain:** Your subdomain is found in the URL when you
                      visit Freshsales. For instance, if you visit
                      "https://example.myfreshworks.com/crm/sales", your
                      subdomain is just 'example'.


                      **Account View ID:** By default, we iterate through all
                      account views to find your accounts. If you have a single
                      account view ID (likely the one that corresponds to All
                      Accounts) that you would like us to use to pull accounts,
                      you can enter the ID here.
                    propertyDefinitions:
                      - name: domain
                        type: string
                        required: true
                        description: Subdomain
                      - name: api_key
                        type: password
                        required: true
                        description: API Key
                      - name: account_view_id
                        type: string
                        required: false
                        description: >-
                          Account View ID (If you only want to pull accounts
                          from one view i.e. 12006154448)
                  properties:
                    domain: veradata-3625884588
                    api_key: '********'
                  createdAt: 2023‐06‐12T20:03:00Z
                  updatedAt: '2023-08-01T00:00:00Z'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    id:
      name: id
      in: path
      description: ID
      required: true
      schema:
        $ref: '#/components/schemas/id'
      example:
        - value: 568971
  schemas:
    PropertyInput:
      type: object
      additionalProperties:
        type: string
        x-go-type: any
    Source:
      type: object
      required:
        - id
        - sourceSpec
      properties:
        id:
          type: integer
          format: int
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 1
        displayName:
          type: string
          description: A human-readable name for the source
          x-go-type-skip-optional-pointer: true
          x-order: 2
        sourceSpec:
          $ref: '#/components/schemas/SourceSpec'
          x-order: 3
        properties:
          $ref: '#/components/schemas/PropertyInput'
          description: >
            The properties of the source. This is a map of property names to
            their values. The names are defined in the `propertyDefinitions`
            field of the source spec.
          x-order: 4
        createdAt:
          type: string
          format: date-time
          readOnly: true
          description: The timestamp marking when the source was created
          x-go-type-skip-optional-pointer: true
          x-order: 5
        updatedAt:
          type: string
          format: date-time
          readOnly: true
          description: The timestamp marking when the source was last updated
          x-go-type-skip-optional-pointer: true
          x-order: 6
      examples:
        - $ref: '#/components/examples/sourceGcal/value'
        - $ref: '#/components/examples/sourceFreshsales/value'
        - $ref: '#/components/examples/sourceWithNoProperties/value'
    id:
      type: integer
      format: int
      examples:
        - 568971
    SourceSpec:
      allOf:
        - $ref: '#/components/schemas/SourceSpecSummary'
        - type: object
          properties:
            instructions:
              type: string
              readOnly: true
              x-go-type-skip-optional-pointer: true
              x-order: 7
            propertyDefinitions:
              type: array
              items:
                $ref: '#/components/schemas/PropertyDefinition'
              readOnly: true
              x-go-type-skip-optional-pointer: true
              x-go-type: '[]*native.PropDef'
              x-order: 8
      examples:
        - $ref: '#/components/examples/sourceSpecGcal/value'
        - $ref: '#/components/examples/sourceSpecFreshsales/value'
    SourceSpecSummary:
      type: object
      properties:
        name:
          type: string
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 1
        displayName:
          type: string
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 2
        website:
          type: string
          format: uri
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 3
        tagLine:
          type: string
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 4
        lifecycle:
          type: string
          enum:
            - ALPHA
            - BETA
            - STABLE
            - DEPRECATED
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 5
        authenticationStrategy:
          type: string
          enum:
            - NONE
            - BASIC
            - TOKEN
            - AUTH_CODE
            - CLIENT_CREDENTIALS
            - FETCH_CREDENTIALS
            - OIDC
          readOnly: true
          x-go-type-skip-optional-pointer: true
          x-order: 6
    PropertyDefinition:
      type: object
      required:
        - name
        - type
        - required
      x-go-type-import:
        path: github.com/portable-io/portable/model/native
      x-go-type: native.PropDef
      properties:
        name:
          type: string
          description: A machine-readable name for the property
          x-order: 1
        displayName:
          type: string
          description: A human-readable name for the property
          x-go-type-skip-optional-pointer: true
          x-order: 2
        type:
          type: string
          description: The type of the property
          x-order: 3
          enum:
            - STRING
            - PASSWORD
            - TEXT
            - NUMBER
            - BOOLEAN
            - DATE
            - DATETIME
            - TIME
        required:
          type: boolean
          description: Whether the property's value is required
          x-order: 4
        description:
          type: string
          description: A human-readable description of the property
          x-go-type-skip-optional-pointer: true
          x-order: 5
  responses:
    BadRequestError:
      description: Bad Request - The request is malformed.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            examples:
              - message: Bad Request
    UnauthorizedError:
      description: Unauthorized - No valid API key provided.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            examples:
              - message: Unauthorized
    ForbiddenError:
      description: Forbidden - You don't have enough permissions to access this resource.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            examples:
              - message: Your current plan does not support this feature
    NotFoundError:
      description: Not Found - The requested resource does not exist.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            examples:
              - message: Not Found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````