Smart Pension Company Exports API

The CompanyExports API from Smart Pension — 2 operation(s) for companyexports.

OpenAPI Specification

smart-pension-companyexports-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keystone Company Exports API
  version: v12
  description: This is the endpoint description of Keystone API.
servers:
- url: https://api.sandbox.autoenrolment.co.uk
- url: /
tags:
- name: CompanyExports
paths:
  /companies/{company_id}/exports:
    post:
      summary: Companies/Exports/Create
      tags:
      - CompanyExports
      security:
      - oAuth2:
        - customer
      parameters:
      - name: company_id
        in: path
        required: true
        example: 1081
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              'when export with format: csv, content type: data':
                value:
                  type: GroupsExport
                  content_type: data
                  file_format: csv
                  resource_type: Company
                  resource_id: 1080
                  metadata.employees.surname: '%Ford%'
                  metadata.contributions.starts_on: '>=2016-01-20'
                  metadata.contributions.ends_on: <=2016-02-20
              'when export with format: csv, content type: template':
                value:
                  type: ContributionsExport
                  content_type: template
                  file_format: csv
                  resource_type: Company
                  resource_id: 1064
                  metadata.employees.surname: '%Ford%'
                  metadata.contributions.starts_on: '>=2016-01-20'
              'when export with format: xls, content type: data':
                value:
                  type: GroupsExport
                  content_type: data
                  file_format: xls
                  resource_type: Company
                  resource_id: 1081
                  metadata.employees.surname: '%Ford%'
                  metadata.contributions.starts_on: '>=2016-01-20'
                  metadata.contributions.ends_on: <=2016-02-20
              'when export with format: xls, content type: template':
                value:
                  type: ContributionsExport
                  content_type: template
                  file_format: xls
                  resource_type: Company
                  resource_id: 1066
                  metadata.employees.surname: '%Ford%'
                  metadata.contributions.starts_on: '>=2016-01-20'
              'when export with format: zip, content type: data':
                value:
                  type: LettersExport
                  content_type: data
                  file_format: zip
                  resource_type: Company
                  resource_id: 1069
              'when export with format: pdf, content type: data':
                value:
                  type: PaymentSchedulesExport
                  content_type: data
                  file_format: pdf
                  resource_type: Company
                  resource_id: 1075
            schema:
              type: object
              properties:
                metadata:
                  type: object
                type:
                  type: string
                content_type:
                  type: string
                file_format:
                  type: string
                resource_type:
                  type: string
                resource_id:
                  type: integer
              required:
              - type
              - content_type
              - file_format
      responses:
        '201':
          description: Success
          content:
            application/json:
              examples:
                'when export with format: csv, content type: data':
                  value:
                    id: 33
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:12.000+01:00'
                    updated_at: '2026-08-05T13:03:12.000+01:00'
                    type: GroupsExport
                    content_type: data
                    file_format: csv
                    resource_type: Company
                    resource_id: 1080
                    metadata:
                      employees:
                        surname: '%Ford%'
                      contributions:
                        starts_on: '>=2016-01-20'
                        ends_on: <=2016-02-20
                    company_id: 1080
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1080
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1080
                'when export with format: csv, content type: template':
                  value:
                    id: 17
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:05.000+01:00'
                    updated_at: '2026-08-05T13:03:05.000+01:00'
                    type: ContributionsExport
                    content_type: template
                    file_format: csv
                    resource_type: Company
                    resource_id: 1064
                    metadata:
                      employees:
                        surname: '%Ford%'
                      contributions:
                        starts_on: '>=2016-01-20'
                    company_id: 1064
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1064
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1064
                'when export with format: xls, content type: data':
                  value:
                    id: 34
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:12.000+01:00'
                    updated_at: '2026-08-05T13:03:12.000+01:00'
                    type: GroupsExport
                    content_type: data
                    file_format: xls
                    resource_type: Company
                    resource_id: 1081
                    metadata:
                      employees:
                        surname: '%Ford%'
                      contributions:
                        starts_on: '>=2016-01-20'
                        ends_on: <=2016-02-20
                    company_id: 1081
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1081
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1081
                'when export with format: xls, content type: template':
                  value:
                    id: 19
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:06.000+01:00'
                    updated_at: '2026-08-05T13:03:06.000+01:00'
                    type: ContributionsExport
                    content_type: template
                    file_format: xls
                    resource_type: Company
                    resource_id: 1066
                    metadata:
                      employees:
                        surname: '%Ford%'
                      contributions:
                        starts_on: '>=2016-01-20'
                    company_id: 1066
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1066
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1066
                'when export with format: zip, content type: data':
                  value:
                    id: 22
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:07.000+01:00'
                    updated_at: '2026-08-05T13:03:07.000+01:00'
                    type: LettersExport
                    content_type: data
                    file_format: zip
                    resource_type: Company
                    resource_id: 1069
                    metadata: {}
                    company_id: 1069
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1069
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1069
                'when export with format: pdf, content type: data':
                  value:
                    id: 28
                    state: ignition
                    file_url: null
                    file_file_name: null
                    created_at: '2026-08-05T13:03:10.000+01:00'
                    updated_at: '2026-08-05T13:03:10.000+01:00'
                    type: PaymentSchedulesExport
                    content_type: data
                    file_format: pdf
                    resource_type: Company
                    resource_id: 1075
                    metadata: {}
                    company_id: 1075
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/1075
                    - rel: company
                      title: company
                      href: https://api.host.com/companies/1075
              schema:
                $ref: '#/components/schemas/response_company_export'
        '403':
          description: Forbidden
        '422':
          description: Invalid parameters
    get:
      summary: Companies/Exports/List
      tags:
      - CompanyExports
      security:
      - oAuth2:
        - customer
      parameters:
      - name: company_id
        in: path
        required: true
        example: 1087
        schema:
          type: string
      - name: limit
        in: query
        schema:
          type: integer
        required: false
      - name: offset
        in: query
        schema:
          type: integer
        required: false
      - name: sort
        in: query
        schema:
          type: string
        required: false
      - name: direction
        in: query
        schema:
          type: string
          enum:
          - ASC
          - DESC
        required: false
      - name: filter
        in: query
        schema:
          type: object
          properties:
            state:
              type: array
              items:
                type: string
            created_at:
              type: array
              items:
                type: string
            type:
              type: array
              items:
                type: string
        required: false
        style: deepObject
      - name: operator
        in: query
        schema:
          type: string
          enum:
          - or
          - and
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                limit: 50
                offset: 0
                total: 3
                links:
                - rel: self
                  title: self
                  href: http://api.host.com/companies/1087/exports
                - rel: first
                  title: first
                  href: http://api.host.com/companies/1087/exports?offset=0&limit=50
                - rel: last
                  title: last
                  href: http://api.host.com/companies/1087/exports?offset=0&limit=50
                exports:
                - id: 37
                  state: ignition
                  file_url: null
                  file_file_name: null
                  created_at: '2026-08-05T13:03:13.000+01:00'
                  updated_at: '2026-08-05T13:03:13.000+01:00'
                  type: ContributionsExport
                  content_type: data
                  file_format: csv
                  resource_type: Company
                  resource_id: 1087
                  metadata: {}
                  company_id: 1087
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/1087
                  - rel: company
                    title: company
                    href: https://api.host.com/companies/1087
                - id: 38
                  state: ignition
                  file_url: null
                  file_file_name: null
                  created_at: '2026-08-05T13:03:13.000+01:00'
                  updated_at: '2026-08-05T13:03:13.000+01:00'
                  type: ContributionsExport
                  content_type: data
                  file_format: csv
                  resource_type: Company
                  resource_id: 1087
                  metadata: {}
                  company_id: 1087
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/1087
                  - rel: company
                    title: company
                    href: https://api.host.com/companies/1087
                - id: 39
                  state: ignition
                  file_url: null
                  file_file_name: null
                  created_at: '2026-08-05T13:03:13.000+01:00'
                  updated_at: '2026-08-05T13:03:13.000+01:00'
                  type: ContributionsExport
                  content_type: data
                  file_format: csv
                  resource_type: Company
                  resource_id: 1087
                  metadata: {}
                  company_id: 1087
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/1087
                  - rel: company
                    title: company
                    href: https://api.host.com/companies/1087
              schema:
                type: object
                properties:
                  limit:
                    type:
                    - integer
                    - 'null'
                  offset:
                    type:
                    - integer
                    - 'null'
                  total:
                    type:
                    - integer
                    - 'null'
                  links:
                    type: array
                    items:
                      $ref: '#/components/schemas/link'
                  exports:
                    type:
                    - array
                    - 'null'
                    items:
                      $ref: '#/components/schemas/response_company_export'
        '422':
          description: Unprocessable entity - when invalid parameters
  /companies/{company_id}/exports/{id}:
    get:
      summary: Companies/Exports/Get
      tags:
      - CompanyExports
      security:
      - oAuth2:
        - customer
      parameters:
      - name: id
        in: path
        required: true
        example: 35
        schema:
          type: string
      - name: company_id
        in: path
        required: true
        example: 1085
        schema:
          type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                id: 35
                state: ignition
                file_url: null
                file_file_name: null
                created_at: '2026-08-05T13:03:13.000+01:00'
                updated_at: '2026-08-05T13:03:13.000+01:00'
                type: ContributionsExport
                content_type: data
                file_format: csv
                resource_type: Company
                resource_id: 1085
                metadata: {}
                company_id: 1085
                links:
                - rel: adviser
                  title: adviser
                  href: https://api.host.com/advisers/1085
                - rel: company
                  title: company
                  href: https://api.host.com/companies/1085
              schema:
                $ref: '#/components/schemas/response_company_export'
        '404':
          description: Not Found
components:
  schemas:
    response_band:
      type: object
      properties:
        id:
          type: integer
        employee_minimum_percentage:
          type: number
          format: float
        employee_maximum_percentage:
          type:
          - number
          - 'null'
          format: float
        employer_percentage:
          type: number
          format: float
        starts_on:
          type: string
          format: date
        ends_on:
          type: string
          format: date
        range_min:
          type:
          - integer
          - 'null'
        range_max:
          type:
          - integer
          - 'null'
        default:
          type: boolean
    response_scheme_contribution_limit:
      type: object
      properties:
        minimum_one_off_contribution_amount:
          type: number
          format: float
        minimum_one_off_contribution_amount_currency:
          type: string
        maximum_one_off_contribution_amount:
          type: number
          format: float
        maximum_one_off_contribution_amount_currency:
          type: string
        minimum_recurring_contribution_amount:
          type: number
          format: float
        minimum_recurring_contribution_amount_currency:
          type: string
    response_adviser:
      type: object
      properties:
        intercom_user_id:
          type:
          - string
          - 'null'
        intercom_user_id_hash:
          type:
          - string
          - 'null'
        id:
          type: integer
        name:
          type:
          - string
          - 'null'
        type:
          type:
          - string
          - 'null'
        address:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        signup_start:
          type:
          - string
          - 'null'
          format: text
        signup_finish:
          type:
          - string
          - 'null'
          format: text
        agent_number:
          type:
          - string
          - 'null'
        broker_channel:
          type:
          - string
          - 'null'
        broker_role:
          type:
          - string
          - 'null'
        abilities:
          type:
          - array
          - 'null'
          items: {}
        companies:
          type: object
          properties:
            limit:
              type:
              - integer
              - 'null'
            offset:
              type:
              - integer
              - 'null'
            total:
              type:
              - integer
              - 'null'
            links:
              type: array
              items:
                $ref: '#/components/schemas/link'
            companies:
              type:
              - array
              - 'null'
              items:
                $ref: '#/components/schemas/response_company'
        imports:
          type: object
          properties:
            limit:
              type:
              - integer
              - 'null'
            offset:
              type:
              - integer
              - 'null'
            total:
              type:
              - integer
              - 'null'
            links:
              type: array
              items:
                $ref: '#/components/schemas/link'
            data:
              type:
              - array
              - 'null'
              items:
                $ref: '#/components/schemas/response_adviser_import'
        company_tax_reliefs:
          type: object
          properties:
            limit:
              type:
              - integer
              - 'null'
            offset:
              type:
              - integer
              - 'null'
            total:
              type:
              - integer
              - 'null'
            links:
              type: array
              items:
                $ref: '#/components/schemas/link'
            data:
              type:
              - array
              - 'null'
              items:
                $ref: '#/components/schemas/response_company_tax_relief'
        shortcut:
          $ref: '#/components/schemas/response_adviser_shortcut'
    response_salary:
      type: object
      properties:
        annual_earnings_1:
          type:
          - number
          - 'null'
          format: float
        annual_earnings_2:
          type:
          - number
          - 'null'
          format: float
        created_at:
          type: string
          format: date-time
        effective_on:
          type: string
          format: date
        employee_id:
          type: integer
        id:
          type: integer
        updated_at:
          type: string
          format: date-time
        employee:
          $ref: '#/components/schemas/response_employee'
    response_company_automation:
      type: object
      properties:
        id:
          type: integer
        letter:
          type: boolean
        company_id:
          type: integer
        postponement_period:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
    response_know_your_customer_data:
      type: object
      properties:
        id:
          type: integer
        state:
          type: string
        reference:
          type:
          - string
          - 'null'
    response_ultimate_beneficial_owner_configuration:
      type: object
      properties:
        id:
          type: integer
        company_id:
          type: integer
        exempt:
          type: boolean
        exemption_reason:
          type:
          - string
          - 'null'
        natural_person_ubo:
          type: boolean
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
    response_adviser_company:
      type: object
      properties:
        id:
          type: integer
        adviser_id:
          type: integer
        company_id:
          type: integer
        preferred_contact_user_id:
          type:
          - integer
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    response_customer:
      type: object
      properties:
        intercom_user_id:
          type:
          - string
          - 'null'
        intercom_user_id_hash:
          type:
          - string
          - 'null'
        id:
          type: integer
        email:
          type:
          - string
          - 'null'
        reset_password_sent_at:
          type:
          - string
          - 'null'
          format: date-time
        remember_created_at:
          type:
          - string
          - 'null'
          format: date-time
        last_sign_in_at:
          type:
          - string
          - 'null'
          format: date-time
        slug:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        gauth_enabled:
          type: boolean
        gauth_tmp:
          type:
          - string
          - 'null'
        forename:
          type:
          - string
          - 'null'
        surname:
          type:
          - string
          - 'null'
        title:
          type:
          - string
          - 'null'
        authentication_token:
          type:
          - string
          - 'null'
        date_of_birth:
          type:
          - string
          - 'null'
          format: date
        line2:
          type:
          - string
          - 'null'
        city:
          type:
          - string
          - 'null'
        county:
          type:
          - string
          - 'null'
        building_name:
          type:
          - string
          - 'null'
        postcode:
          type:
          - string
          - 'null'
        line1:
          type:
          - string
          - 'null'
        building_number:
          type:
          - string
          - 'null'
        telephone:
          type:
          - string
          - 'null'
        alternative_telephone:
          type:
          - string
          - 'null'
        referee_id:
          type:
          - integer
          - 'null'
        referee_type:
          type:
          - string
          - 'null'
        referral_state:
          type: string
        referral_clicks:
          type:
          - integer
          - 'null'
        referral_reward_name:
          type:
          - string
          - 'null'
        authentication_token_generated_at:
          type:
          - string
          - 'null'
          format: date-time
        gender:
          type:
          - string
          - 'null'
        role:
          type:
          - string
          - 'null'
        middlename:
          type:
          - string
          - 'null'
        envelope_state:
          type: string
        enforce_password:
          type:
          - boolean
          - 'null'
        company_id:
          type:
          - integer
          - 'null'
        country_code:
          type:
          - string
          - 'null'
        uuid:
          type: string
        preferred_locale:
          type:
          - string
          - 'null'
        smart_analytics_access_permitted:
          type:
          - boolean
          - 'null'
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
        company:
          $ref: '#/components/schemas/response_company'
        employee:
          $ref: '#/components/schemas/response_employee'
        shortcut:
          $ref: '#/components/schemas/response_customer_shortcut'
        marketing_preference:
          $ref: '#/components/schemas/response_marketing_preference'
    response_payment:
      type: object
      properties:
        id:
          type: integer
        state:
          type: string
        amount:
          type:
          - number
          - 'null'
          format: float
        description:
          type:
          - string
          - 'null'
        invoice_name:
          type:
          - string
          - 'null'
        paid_at:
          type:
          - string
          - 'null'
          format: date-time
        charge_on:
          type:
          - string
          - 'null'
          format: date
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        invoice_url:
          type:
          - string
          - 'null'
        invoice_details_url:
          type:
          - string
          - 'null'
        invoice_details_file_name:
          type:
          - string
          - 'null'
        source_of_funds:
          type:
          - string
          - 'null'
    response_employee_plan_participation:
      type: object
      properties:
        id:
          type: integer
        in_waiting_period:
          type:
          - boolean
          - 'null'
        next_state:
          type:
          - string
          - 'null'
        updated_at:
          type: string
          format: date-time
        state:
          type: string
    response_letter:
      type: object
      properties:
        id:
          type: integer
        subject:
          type:
          - string
          - 'null'
        name:
          type:
          - string
          - 'null'
        employee_id:
          type:
          - integer
          - 'null'
        read:
          type:
          - boolean
          - 'null'
        file_url:
          type:
          - string
          - 'null'
        file_file_name:
          type:
          - string
          - 'null'
        created_at:
          type:
          - string
          - 'null'
          format: date-time
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
        cancelled_at:
          type:
          - string
          - 'null'
          format: date-time
        created_by_id:
          type:
          - integer
          - 'null'
        created_by_type:
          type:
          - string
          - 'null'
        send_employee_temporary_password_notification:
          type:
          - boolean
          - 'null'
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
        employee:
          $ref: '#/components/schemas/response_employee'
    response_base_payroll_configuration:
      type: object
      properties:
        id:
          type: integer
        company_id:
          type: integer
        description:
          type:
          - string
          - 'null'
        frequency:
          type: string
        name:
          type: string
        salary_rate:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        uuid:
          type: string
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
    response_company_tax_relief:
      type: object
      properties:
        id:
          type: integer
        basis_type:
          type: string
    response_beneficiary:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        name:
          type: string
        email:
          type:
          - string
          - 'null'
        address:
          type: string
        postcode:
          type:
          - string
          - 'null'
        relation:
          type: string
        percentage:
          type: number
          format: float
        born_on:
          type: string
          format: date
        type:
          type: string
    response_benefit_check_result:
      type: object
      properties:
        id:
          type: integer
        benefit_id:
          type: integer
        state:
          type: string
        redirect_url:
          type:
          - string
          - 'null'
        has_redirect_url:
          type:
          - boolean
          - 'null'
        returned_back_at:
          type:
          - string
          - 'null'
          format: date-time
        comment:
          type:
          - string
          - 'null'
          format: text
        automated_checks_available:
          type: boolean
    response_provider_scheme_migration:
      type: object
      properties:
        id:
          type: integer
        state:
          type: string
    response_valuation:
      type: object
      properties:
        id:
          type: integer
        amount:
          type:
          - number
          - 'null'
          format: float
        calculated_on:
          type: string
          format: date
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    response_adviser_import:
      type: object
      properties:
        id:
          type: integer
        status_code:
          type:
          - integer
          - 'null'
        state:
          type: string
        response_errors:
          type:
          - array
          - 'null'
          items: {}
        file_url:
          type:
          - string
          - 'null'
        file_file_name:
          type:
          - string
          - 'null'
        c

# --- truncated at 32 KB (84 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/smart-pension/refs/heads/main/openapi/smart-pension-companyexports-api-openapi.yml