Keap File API (v1)

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

OpenAPI Specification

keap-file-v1-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Keap File 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: v1
servers:
- url: https://api.infusionsoft.com/crm
tags:
- name: File
paths:
  /rest/v1/files/{fileId}:
    get:
      tags:
      - File
      summary: Retrieve File
      description: 'Retrieves metadata about a specific file. Optionally returns the base64 encoded file
        data.


        **Note:** Files larger than 8MB may cause errors when retrieved via the v1 API due to Base64 encoding
        overhead. For files approaching or exceeding this size, use the [v2 Files endpoint](https://developer.infusionsoft.com/docs/restv2/#tag/Files/operation/getFileDataUsingGET),
        which returns file data as byte arrays without encoding limitations.'
      operationId: getFile
      parameters:
      - name: fileId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      - name: optional_properties
        in: query
        description: Comma-delimited list of File properties to include in the response. (Some fields
          such as `file_data` aren't included, by default.)
        schema:
          type: string
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileInformation'
    put:
      tags:
      - File
      summary: Replace File
      description: Upload a base64 encoded file to replace an existing one. `contact_id` is required only
        when `file_association` is `CONTACT`.
      operationId: updateFile
      parameters:
      - name: fileId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileUpload'
        required: true
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileInformation'
    delete:
      tags:
      - File
      summary: Delete File
      description: Deletes the specified file
      operationId: deleteFile
      parameters:
      - name: fileId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '204':
          description: No Content
  /rest/v1/files:
    get:
      tags:
      - File
      summary: List Files
      description: Retrieves a list of all files
      operationId: listFiles
      parameters:
      - name: fileQueryCommand
        in: query
        required: true
        schema:
          $ref: '#/components/schemas/FileQueryCommand'
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileList'
    post:
      tags:
      - File
      summary: Upload File
      description: Upload a base64 encoded file. `contact_id` is required only when `file_association`
        is `CONTACT`.
      operationId: createFile
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileUpload'
        required: true
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelAndView'
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileInformation'
components:
  schemas:
    DefaultHttpStatusCode:
      allOf:
      - $ref: '#/components/schemas/HttpStatusCode'
    FileDescriptor:
      type: object
      properties:
        category:
          type: string
          enum:
          - Attachments
          - Cart
          - Documents
          - Hidden
          - Invoice
          - Logo
          - Tickets
          - WebForm
          - Funnel
        date_created:
          type: string
          format: date-time
        last_updated:
          type: string
          format: date-time
        file_name:
          type: string
        file_size:
          type: integer
          format: int64
        created_by:
          type: integer
          format: int64
        public:
          type: boolean
        contact_id:
          type: integer
          format: int64
        remote_file_key:
          type: string
        file_box_type:
          type: string
          enum:
          - Application
          - Image
          - Fax
          - Attachment
          - Ticket
          - Contact
          - DigitalProduct
          - Import
          - Hidden
          - WebForm
          - StyledCart
          - ReSampledImage
          - TemplateThumbnail
          - Funnel
          - LogoThumbnail
          - Unlayer
          - BrandingCenterLogo
        download_url:
          type: string
    FileInformation:
      type: object
      properties:
        file_descriptor:
          $ref: '#/components/schemas/FileDescriptor'
        file_data:
          type: string
    FileList:
      type: object
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileDescriptor'
        count:
          type: integer
          format: int32
        next:
          type: string
        previous:
          type: string
    FileQueryCommand:
      type: object
      properties:
        limit:
          type: integer
          format: int32
        offset:
          type: integer
          format: int32
        viewable:
          type: string
          enum:
          - PUBLIC
          - PRIVATE
          - BOTH
        permission:
          type: string
          enum:
          - USER
          - COMPANY
          - BOTH
        type:
          type: string
          enum:
          - Application
          - Image
          - Fax
          - Attachment
          - Ticket
          - Contact
          - DigitalProduct
          - Import
          - Hidden
          - WebForm
          - StyledCart
          - ReSampledImage
          - TemplateThumbnail
          - Funnel
          - LogoThumbnail
          - Unlayer
          - BrandingCenterLogo
        name:
          type: string
        contact_id:
          type: integer
          format: int64
        contactId:
          type: integer
          format: int64
    FileUpload:
      type: object
      description: fileUpload
      properties:
        file_name:
          type: string
          writeOnly: true
        file_data:
          type: string
          writeOnly: true
        contact_id:
          type: integer
          format: int64
          writeOnly: true
        is_public:
          type: boolean
          writeOnly: true
        file_association:
          type: string
          enum:
          - CONTACT
          - USER
          - COMPANY
          writeOnly: true
        public:
          type: boolean
    HttpStatus:
      allOf:
      - $ref: '#/components/schemas/HttpStatusCode'
      enum:
      - 100 CONTINUE
      - 101 SWITCHING_PROTOCOLS
      - 102 PROCESSING
      - 103 EARLY_HINTS
      - 200 OK
      - 201 CREATED
      - 202 ACCEPTED
      - 203 NON_AUTHORITATIVE_INFORMATION
      - 204 NO_CONTENT
      - 205 RESET_CONTENT
      - 206 PARTIAL_CONTENT
      - 207 MULTI_STATUS
      - 208 ALREADY_REPORTED
      - 226 IM_USED
      - 300 MULTIPLE_CHOICES
      - 301 MOVED_PERMANENTLY
      - 302 FOUND
      - 303 SEE_OTHER
      - 304 NOT_MODIFIED
      - 307 TEMPORARY_REDIRECT
      - 308 PERMANENT_REDIRECT
      - 400 BAD_REQUEST
      - 401 UNAUTHORIZED
      - 402 PAYMENT_REQUIRED
      - 403 FORBIDDEN
      - 404 NOT_FOUND
      - 405 METHOD_NOT_ALLOWED
      - 406 NOT_ACCEPTABLE
      - 407 PROXY_AUTHENTICATION_REQUIRED
      - 408 REQUEST_TIMEOUT
      - 409 CONFLICT
      - 410 GONE
      - 411 LENGTH_REQUIRED
      - 412 PRECONDITION_FAILED
      - 413 CONTENT_TOO_LARGE
      - 413 PAYLOAD_TOO_LARGE
      - 414 URI_TOO_LONG
      - 415 UNSUPPORTED_MEDIA_TYPE
      - 416 REQUESTED_RANGE_NOT_SATISFIABLE
      - 417 EXPECTATION_FAILED
      - 418 I_AM_A_TEAPOT
      - 421 MISDIRECTED_REQUEST
      - 422 UNPROCESSABLE_CONTENT
      - 422 UNPROCESSABLE_ENTITY
      - 423 LOCKED
      - 424 FAILED_DEPENDENCY
      - 425 TOO_EARLY
      - 426 UPGRADE_REQUIRED
      - 428 PRECONDITION_REQUIRED
      - 429 TOO_MANY_REQUESTS
      - 431 REQUEST_HEADER_FIELDS_TOO_LARGE
      - 451 UNAVAILABLE_FOR_LEGAL_REASONS
      - 500 INTERNAL_SERVER_ERROR
      - 501 NOT_IMPLEMENTED
      - 502 BAD_GATEWAY
      - 503 SERVICE_UNAVAILABLE
      - 504 GATEWAY_TIMEOUT
      - 505 HTTP_VERSION_NOT_SUPPORTED
      - 506 VARIANT_ALSO_NEGOTIATES
      - 507 INSUFFICIENT_STORAGE
      - 508 LOOP_DETECTED
      - 509 BANDWIDTH_LIMIT_EXCEEDED
      - 510 NOT_EXTENDED
      - 511 NETWORK_AUTHENTICATION_REQUIRED
    HttpStatusCode:
      type: object
      properties:
        error:
          type: boolean
        is1xxInformational:
          type: boolean
        is2xxSuccessful:
          type: boolean
        is3xxRedirection:
          type: boolean
        is4xxClientError:
          type: boolean
        is5xxServerError:
          type: boolean
    ModelAndView:
      type: object
      properties:
        view:
          $ref: '#/components/schemas/View'
        model:
          type: object
          additionalProperties: {}
        status:
          oneOf:
          - $ref: '#/components/schemas/DefaultHttpStatusCode'
          - $ref: '#/components/schemas/HttpStatus'
        modelMap:
          type: object
          additionalProperties: {}
          properties:
            empty:
              type: boolean
        reference:
          type: boolean
        empty:
          type: boolean
        viewName:
          type: string
    View:
      type: object
      properties:
        contentType:
          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: []