Keap Lead Sources API

Keap Lead Sources API — 5 operations across 2 paths on the Keap REST v2 contract, read from Keap's own published OpenAPI 3.1 document.

OpenAPI Specification

keap-lead-sources-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Keap Lead Sources API
  description: Keap Public API Documentation
  termsOfService: https://www.thryv.com/terms-of-use
  contact:
    name: Keap
    url: https://developer.keap.com/get-support
    email: api.keap@thryv.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: v2
servers:
- url: https://api.infusionsoft.com/crm
tags:
- name: Lead Sources
paths:
  /rest/v2/leadSources:
    get:
      tags:
      - Lead Sources
      summary: List Lead Sources
      description: Retrieves a list of Lead Sources
      operationId: listLeadSources
      parameters:
      - name: filter
        in: query
        description: 'Filter to apply, allowed fields are:


          - (String) `id` - Must be a positive integer. Allowable operators: "==", "<=", "<", ">=", ">",
          "!=". Values that are zero, negative, or non-integer return a 400.

          - (String) `name` - Wildcard matching allowed

          - (String) `status`

          - (String) `lead_source_category_id`

          - (String) `vendor` - Wildcard matching allowed

          - (String) `medium` - Wildcard matching allowed

          - (String) `message` - Wildcard matching allowed

          - (String) `description` - Wildcard matching allowed

          - (String) `start_time`

          - (String) `end_time`


          You will need to apply the `==` operator (or another supported operator) to check the equality
          of one of

          the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above,
          here are

          some examples:


          - `filter=name%3D%3Dexample`

          - `filter=name%3D%3DGoogle%2A` (name starts with "Google")

          - `filter=id%3E1000` (id > 1000)

          - `filter=id%3E%3D1000` (id >= 1000)

          - `filter=start_time%3D%3D2024-12-22T01:00:00.000Z`


          For fields which allow wildcard matching, you may use the `*` wildcard character (or its encoded
          form

          `%2A`) for case-insensitive prefix matching on text fields. Example of a valid wildcard pattern:


          - `field==foo*` finds anything in `field` that begins with `foo`'
        required: false
        schema:
          type: string
      - name: page_token
        in: query
        description: Page token
        required: false
        schema:
          type: string
      - name: order_by
        in: query
        description: 'Attribute and direction to order items.

          One of the following fields:


          - `name`

          - `status`

          - `vendor`

          - `medium`

          - `start_time`

          - `end_time`

          - `create_time`

          - `update_time`


          One of the following directions:


          - `asc`

          - `desc`'
        required: false
        schema:
          type: string
      - name: page_size
        in: query
        description: Total number of items to return per page
        required: false
        schema:
          type: integer
          format: int32
          maximum: 1000
          minimum: 0
        example: 0
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Method Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListLeadSourcesResponse'
    post:
      tags:
      - Lead Sources
      summary: Create a Lead Source
      description: Creates a new Lead Source
      operationId: createLeadSource
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLeadSourceRequest'
        required: true
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Method Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
  /rest/v2/leadSources/{lead_source_id}:
    get:
      tags:
      - Lead Sources
      summary: Retrieve a Lead Source
      description: Retrieves a Lead Source by ID
      operationId: getLeadSource
      parameters:
      - name: lead_source_id
        in: path
        description: The ID of a lead source
        required: true
        schema:
          type: string
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Method Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
    delete:
      tags:
      - Lead Sources
      summary: Delete a Lead Source
      description: Deletes a Lead Source by ID
      operationId: deleteLeadSource
      parameters:
      - name: lead_source_id
        in: path
        description: The ID of a lead source
        required: true
        schema:
          type: string
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Method Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '204':
          description: No Content
    patch:
      tags:
      - Lead Sources
      summary: Update a Lead Source
      description: Updates a Lead Source with only the values provided in the request
      operationId: updateLeadSource
      parameters:
      - name: lead_source_id
        in: path
        description: The ID of a lead source
        required: true
        schema:
          type: string
      - name: update_mask
        in: query
        description: An optional list of properties to be updated. If set, only the provided properties
          will be updated and others will be skipped.
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - name
            - description
            - vendor
            - medium
            - message
            - start_time
            - end_time
            - status
            - lead_source_category_id
          uniqueItems: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLeadSourceRequest'
        required: true
      responses:
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Method Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadSource'
components:
  schemas:
    CreateLeadSourceRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the lead source
          example: Google Ads
        description:
          type: string
          description: A description of the lead source
          example: Paid search advertising
        vendor:
          type: string
          description: The vendor of the lead source
          example: Google
        medium:
          type: string
          description: The medium of the lead source
          example: cpc
        message:
          type: string
          description: A message on the lead source
          example: Spring promotion
        status:
          type: string
          description: The status of the lead source
          enum:
          - ACTIVE
          - INACTIVE
          example: ACTIVE
        lead_source_category_id:
          type: string
          description: The lead source category that the lead source belongs to
          example: 456
        start_time:
          type: string
          format: date-time
          description: When the lead source starts
          example: '2024-01-01T00:00:00Z'
        end_time:
          type: string
          format: date-time
          description: When the lead source ends
          example: '2024-12-31T23:59:59Z'
    Error:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        status:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetails'
    ErrorDetails:
      type: object
      properties:
        domain:
          type: string
        resource:
          type: string
    LeadSource:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for this lead source
          example: 123
        name:
          type: string
          description: The name of the lead source
          example: Google Ads
        description:
          type: string
          description: The description of the lead source
          example: Paid search advertising
        vendor:
          type: string
          description: The vendor of the lead source
          example: Google
        medium:
          type: string
          description: The medium of the lead source
          example: cpc
        message:
          type: string
          description: The message/content of the lead source
          example: Spring promotion
        status:
          type: string
          description: The status of the lead source
          enum:
          - ACTIVE
          - INACTIVE
          example: ACTIVE
        lead_source_category_id:
          type: string
          description: The ID of the category that the lead source belongs to
          example: 456
        start_time:
          type: string
          format: date-time
          description: The time that this lead source started
          example: '2024-01-01T00:00:00Z'
        end_time:
          type: string
          format: date-time
          description: The time that this lead source will end
          example: '2024-12-31T23:59:59Z'
        create_time:
          type: string
          format: date-time
          description: The time that this lead source was created
          example: '2024-01-10T08:00:00Z'
        update_time:
          type: string
          format: date-time
          description: The time that this lead source was last updated
          example: '2024-03-15T10:30:00Z'
    ListLeadSourcesResponse:
      type: object
      properties:
        lead_sources:
          type: array
          description: The lead sources in the current page
          items:
            $ref: '#/components/schemas/LeadSource'
        next_page_token:
          type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.infusionsoft.com/app/oauth/authorize
          tokenUrl: https://api.infusionsoft.com/token
          scopes: {}
security:
- oauth2: []