Leadspace Discovery API

Account expansion. Finds net-new contacts inside up to 500 target accounts per request, ranked against persona, region, and country criteria and filtered by required contact information such as verified email or direct phone.

OpenAPI Specification

leadspace-discovery-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Leadspace Discovery API
  description: >-
    The Leadspace Discovery (Expansion) API finds net-new contacts inside target
    accounts. A bulk request expands up to 500 accounts, ranking discovered
    people against persona, region, and required-contact-information criteria,
    and returns a polling URI for asynchronous retrieval. This document was
    generated by API Evangelist from Leadspace's published technical
    specifications; Leadspace does not publish a machine-readable OpenAPI
    definition.
  version: '2.0'
  contact:
    name: Leadspace Support
    url: https://support.leadspace.com/hc/en-us
    email: support@leadspace.com
  termsOfService: https://www.leadspace.com/service-support-terms
externalDocs:
  description: Leadspace Discovery API documentation
  url: https://support.leadspace.com/hc/en-us/articles/360011926619-Leadspace-Discovery-API
servers:
  - url: https://apigw.leadspace.com
    description: Leadspace API gateway (production)
tags:
  - name: Discovery
    description: Bulk account expansion into net-new contacts
  - name: Results
    description: Polling for asynchronous discovery results
security:
  - bearerAuth: []
paths:
  /v2/expansion/company:
    post:
      operationId: discoverCompanyContacts
      summary: Submit a bulk account discovery (expansion) job
      description: >-
        Expands up to 500 accounts into ranked contacts. Either companyName or
        companyWebsite is mandatory for each account.
      tags:
        - Discovery
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscoveryRequest'
      responses:
        '202':
          description: Bulk job successfully accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Program ID is invalid
        '427':
          $ref: '#/components/responses/InsufficientCredits'
        '500':
          $ref: '#/components/responses/ServerError'
      callbacks:
        discoveryComplete:
          '{$request.body#/callbackUrl}':
            post:
              operationId: discoveryCompleteCallback
              summary: Discovery completion callback
              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/DiscoveryCallback'
              responses:
                '200':
                  description: Callback acknowledged
  /v1/expansion/results/{bulkId}:
    get:
      operationId: getDiscoveryResults
      summary: Poll for bulk discovery results
      tags:
        - Results
      parameters:
        - name: bulkId
          in: path
          required: true
          description: The Leadspace bulk identifier returned when the job was accepted
          schema:
            type: string
      responses:
        '200':
          description: Request is done
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscoveryResults'
        '204':
          description: Request is still processing
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Results not found
        '500':
          $ref: '#/components/responses/ServerError'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Authorization header in the form 'Bearer API_KEY'
  responses:
    BadRequest:
      description: Request fails basic input validation or JSON format is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized request (wrong credentials or credentials have expired)
    InsufficientCredits:
      description: Insufficient credits to process this request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    DiscoveryRequest:
      type: object
      required: [data]
      properties:
        data:
          type: array
          maxItems: 500
          description: Up to 500 accounts per bulk request
          items:
            $ref: '#/components/schemas/DiscoveryItem'
        external_bulk_id:
          type: string
        callbackUrl:
          type: string
          description: URL Leadspace calls back when bulk processing completes
    DiscoveryItem:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/DiscoveryAccount'
        contact:
          $ref: '#/components/schemas/DiscoveryContactCriteria'
        requiredResultsFields:
          $ref: '#/components/schemas/RequiredResultsFields'
        limits:
          type: object
          properties:
            resultPerAccount:
              type: integer
              minimum: 1
              maximum: 100
              default: 10
              description: Max leads retrieved per expanded account
        location:
          type: object
          properties:
            country:
              type: string
              description: >-
                Required person location. Multiple values are comma delimited.
                Omit entirely to receive all locations.
        external_id:
          type: string
    DiscoveryAccount:
      type: object
      description: Either companyName or companyWebsite is mandatory
      properties:
        companyName:
          type: string
        companyWebsite:
          type: string
        companylinkedinUrl:
          type: string
    DiscoveryContactCriteria:
      type: object
      properties:
        persona:
          type: array
          maxItems: 5
          description: Persona criteria used to rank discovery results
          items:
            type: string
        contactRegions:
          type: array
          items:
            type: string
        contactCountries:
          type: array
          items:
            type: string
        contactState:
          type: array
          items:
            type: string
    RequiredResultsFields:
      type: object
      properties:
        directPhone:
          type: boolean
        companyPhone:
          type: boolean
        verifiedEmail:
          type: boolean
    DiscoveryAccepted:
      type: object
      properties:
        id:
          type: string
          description: The polling endpoint URI to extract the bulk results
          examples: ['/v1/expansion/results/a4b6e123-8905-4dff-a966-50c3ce8f78ft']
    DiscoveryCallback:
      type: object
      properties:
        bulkId:
          type: string
        callbackMethod:
          type: object
          properties:
            callbackUrl:
              type: string
            pollingUrl:
              type: string
        bulkStatus:
          type: string
    DiscoveryResults:
      type: object
      properties:
        results:
          type: array
          description: List of expansion results
          items:
            type: object
            properties:
              status:
                type: string
              external_id:
                type: string
              data:
                type: object
    Error:
      type: object
      properties:
        error:
          type: string
        tracking_id:
          type: string
        request_timestamp:
          type: string
        details:
          type: string