Leadspace Authorization API

OAuth 2.0 token issuance and refresh

OpenAPI Specification

leadspace-authorization-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Leadspace Discovery Authorization 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
servers:
- url: https://apigw.leadspace.com
  description: Leadspace API gateway (production)
security:
- bearerAuth: []
tags:
- name: Authorization
  description: OAuth 2.0 token issuance and refresh
paths:
  /oauth/authorize:
    post:
      operationId: createAuthorizationToken
      summary: Request an OAuth 2.0 access token
      description: Exchanges the Program ID and authentication secret supplied by Leadspace for a bearer token. Tokens expire every 24 hours.
      tags:
      - Authorization
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationRequest'
      responses:
        '200':
          description: Token issued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
    put:
      operationId: refreshAuthorizationToken
      summary: Refresh an OAuth 2.0 access token
      description: Exchanges a refreshToken for a new bearer token.
      tags:
      - Authorization
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshRequest'
      responses:
        '200':
          description: Token refreshed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AuthorizationResponse:
      type: object
      properties:
        token:
          type: string
          description: The generated token to use in API v4 enrichment requests
        refreshToken:
          type: string
          description: Value to use in refresh token requests
        expiration:
          type: integer
          description: Epoch seconds of the expiration moment
    RefreshRequest:
      type: object
      required:
      - user
      - refreshToken
      properties:
        user:
          type: string
        refreshToken:
          type: string
    AuthorizationRequest:
      type: object
      required:
      - user
      - pass
      - audience
      properties:
        user:
          type: string
          description: The Program ID Leadspace provided in the credentials email
        pass:
          type: string
          description: The authentication secret Leadspace provided in the credentials email
        audience:
          type: string
          description: For API v4 services use API_GATEWAY
          examples:
          - API_GATEWAY
  responses:
    Unauthorized:
      description: Unauthorized request (wrong credentials or credentials have expired)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Authorization header in the form 'Bearer API_KEY'
externalDocs:
  description: Leadspace Discovery API documentation
  url: https://support.leadspace.com/hc/en-us/articles/360011926619-Leadspace-Discovery-API