Smart Pension User API

The User API from Smart Pension — 3 operation(s) for user.

OpenAPI Specification

smart-pension-user-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Keystone User API
  version: v12
  description: This is the endpoint description of Keystone API.
servers:
- url: https://api.sandbox.autoenrolment.co.uk
- url: /
tags:
- name: User
paths:
  /advisers/{adviser_id}/users:
    post:
      summary: Users/Create
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: adviser_id
        in: path
        required: true
        example: 35
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              valid_request:
                value:
                  email: email@email.com
                  password: '!1234Qwertyuiop'
                  forename: forename
                  surname: surename
                  telephone: +44 123 4567 890
                  name: forename surename
                  address: Burj Khalifa
              invalid_parameter_request:
                value:
                  email: null
                  password: null
                  forename: null
                  surname: null
                  telephone: null
                  name: null
                  address: null
              forbidden_request:
                value:
                  email: jane@doe.fr
                  password: '!1234Qwertyuiop'
                  forename: Jane
                  surname: Doe
                  telephone: +44 123 4567 890
                  name: Jane Doe
                  address: Burj Al Arab
            schema:
              type: object
              properties:
                logo:
                  type: string
                  format: binary
                name:
                  type: string
                  minimum: 2
                  maximum: 115
                address:
                  type: string
                  minimum: 2
                  maximum: 165
                signup_start:
                  type: string
                  minimum: 2
                  maximum: 120
                signup_finish:
                  type: string
                  minimum: 2
                  maximum: 120
                channel:
                  type: string
                agent_number:
                  type: string
                broker_role:
                  type: string
                broker_channel:
                  type: string
                email:
                  type: string
                telephone:
                  type: string
                annuity_option_enabled:
                  type: boolean
                marketing_included:
                  type: boolean
                password:
                  type: string
                title:
                  type: string
                forename:
                  type: string
                surname:
                  type: string
              required:
              - email
              - telephone
              - name
              - address
              - password
              - forename
              - surname
      responses:
        '201':
          description: Success
          content:
            application/json:
              example:
                intercom_user_id: usr34
                intercom_user_id_hash: 4196187291a96b371b60ec347eacc9eccc25c4252dfbc31ff54b2f940dadc8f3
                id: 34
                email: email@email.com
                title: null
                forename: forename
                surname: surename
                api_key: XuxErut3CcbNmptG_O0f8Q
                telephone: '+441234567890'
                adviser_id: 35
                smart_analytics_access_permitted: false
                roles: []
                created_at: '2026-08-05T12:57:47.000+01:00'
                updated_at: '2026-08-05T12:57:47.000+01:00'
                links:
                - rel: adviser
                  title: adviser
                  href: https://api.host.com/advisers/35
              schema:
                $ref: '#/components/schemas/response_adviser'
        '403':
          description: Forbidden - number of users exceeds allowed limit
          content:
            application/json:
              example:
                errors:
                - code: 35
                  title: Maximum number of users reached!
                  detail: You cannot have more than 5 users.
                  form: null
                  attribute: base
                  error: out_of_limit
                  meta:
                    limit: 5
                    entity: users
                  source:
                    pointer: /base
        '422':
          description: Parameters invalid.
          content:
            application/json:
              example:
                errors:
                - code: 1812
                  title: Not Enough Characters for forename.
                  detail: You need to enter a forename with a minimum of 2 characters.
                  meta:
                    count: 2
                  source:
                    pointer: /data/attributes/forename
                - code: 1806
                  title: Forename is a required field.
                  detail: You need to include the forename for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/forename
                - code: 1813
                  title: Not Enough Characters for surname.
                  detail: You need to enter a surname with a minimum of 2 characters.
                  meta:
                    count: 2
                  source:
                    pointer: /data/attributes/surname
                - code: 1807
                  title: Surname is a required field.
                  detail: You need to include the surname for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/surname
                - code: 1818
                  title: Not Enough Characters for email.
                  detail: You need to enter an email with a minimum of 6 characters.
                  meta:
                    count: 2
                  source:
                    pointer: /data/attributes/email
                - code: 1804
                  title: Email address is a required field.
                  detail: You need to enter an email address for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/email
                - code: 1805
                  title: Email address is not valid.
                  detail: 'The email address you entered is not valid. This may be because of the address format or the domain being unreachable. Make sure the address uses this format: name@something.com and that email is enabled for this domain.'
                  meta: {}
                  source:
                    pointer: /data/attributes/email
                - code: 1801
                  title: Password is a required field.
                  detail: You need to enter a password for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/password
                - code: 1808
                  title: Telephone number is a required field.
                  detail: You need to include a telephone number for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/telephone
    get:
      summary: Users/List
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: adviser_id
        in: path
        required: true
        example: 44
        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:
            email:
              type: array
              items:
                type: string
            forename:
              type: array
              items:
                type: string
            surname:
              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/advisers/44/users
                - rel: first
                  title: first
                  href: http://api.host.com/advisers/44/users?offset=0&limit=50
                - rel: last
                  title: last
                  href: http://api.host.com/advisers/44/users?offset=0&limit=50
                users:
                - intercom_user_id: usr48
                  intercom_user_id_hash: f27752495b99afc62e3d13f394e1483cedb5df7c86426da85b7bcda6da214156
                  id: 48
                  email: email@example.com
                  title: null
                  forename: forename
                  surname: surname
                  api_key: XPmRmfeBMmvOf9wO1U5vaA
                  telephone: '+441234567890'
                  adviser_id: 44
                  smart_analytics_access_permitted: false
                  roles: []
                  created_at: '2026-08-05T12:57:50.000+01:00'
                  updated_at: '2026-08-05T12:57:50.000+01:00'
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/44
                - intercom_user_id: usr49
                  intercom_user_id_hash: 82f541aeae29a676cf8146881630baae7e106c058c2a095caf22d146a5ae6850
                  id: 49
                  email: user_1@example.com
                  title: null
                  forename: abcd
                  surname: surname
                  api_key: ''
                  telephone: 07854938738
                  adviser_id: 44
                  smart_analytics_access_permitted: false
                  roles: []
                  created_at: '2026-08-05T12:57:50.000+01:00'
                  updated_at: '2026-08-05T12:57:50.000+01:00'
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/44
                - intercom_user_id: usr50
                  intercom_user_id_hash: e9d952b71f4087b777729758b602e159e60a776480c99fbeddff565991a6a2af
                  id: 50
                  email: user_2@example.com
                  title: null
                  forename: wxyz
                  surname: surname
                  api_key: ''
                  telephone: 07854938738
                  adviser_id: 44
                  smart_analytics_access_permitted: false
                  roles: []
                  created_at: '2026-08-05T12:57:50.000+01:00'
                  updated_at: '2026-08-05T12:57:50.000+01:00'
                  links:
                  - rel: adviser
                    title: adviser
                    href: https://api.host.com/advisers/44
              schema:
                type: object
                properties:
                  limit:
                    type:
                    - integer
                    - 'null'
                  offset:
                    type:
                    - integer
                    - 'null'
                  total:
                    type:
                    - integer
                    - 'null'
                  links:
                    type: array
                    items:
                      $ref: '#/components/schemas/link'
                  users:
                    type:
                    - array
                    - 'null'
                    items:
                      $ref: '#/components/schemas/response_user'
  /advisers/{adviser_id}/users/{id}:
    delete:
      summary: Users/Destroy
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: id
        in: path
        required: true
        example: 41
        schema:
          type: string
      - name: adviser_id
        in: path
        required: true
        example: 38
        schema:
          type: string
      responses:
        '204':
          description: Success
        '403':
          description: Forbidden when trying to delete last user.
    get:
      summary: Users/Get
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: id
        in: path
        required: true
        example: 44
        schema:
          type: string
      - name: adviser_id
        in: path
        required: true
        example: 40
        schema:
          type: string
      - name: include[]
        in: query
        schema:
          type: array
          items:
            enum:
            - adviser
            - adviser.company_tax_reliefs
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                intercom_user_id: usr44
                intercom_user_id_hash: 6867c1b7078dcf40b048a2c6bb248b11ceb2c44164a70fea6601b9ea99435a42
                id: 44
                email: email@example.com
                title: null
                forename: forename
                surname: surname
                api_key: saZjqVZ42gqN5nS3TV4Mfg
                telephone: '+441234567890'
                adviser_id: 40
                smart_analytics_access_permitted: false
                roles: []
                created_at: '2026-08-05T12:57:49.000+01:00'
                updated_at: '2026-08-05T12:57:49.000+01:00'
                links:
                - rel: adviser
                  title: adviser
                  href: https://api.host.com/advisers/40
              schema:
                $ref: '#/components/schemas/response_user'
        '403':
          description: Failing when user belongs to another adviser.
          content:
            application/json:
              example:
                errors:
                - code: 374
                  title: You don't have the neccessary rights to perform this action.
                  detail: You don't have the necessary rights to perform this action.
                  form: null
                  attribute: base
                  error: generic_forbidden
                  meta: {}
                  source:
                    pointer: /base
        '404':
          description: Not Found
          content:
            application/json:
              example: ''
    put:
      summary: Users/Update
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: id
        in: path
        required: true
        example: 51
        schema:
          type: string
      - name: adviser_id
        in: path
        required: true
        example: 45
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              valid_parameters:
                value:
                  email: john@doe.fr
                  name: John Doe
                  address: Burj Khalifa
              invalid_parameters:
                value:
                  email: null
            schema:
              type: object
              properties:
                logo:
                  type: string
                  format: binary
                name:
                  type: string
                  minimum: 2
                  maximum: 115
                address:
                  type: string
                  minimum: 2
                  maximum: 165
                signup_start:
                  type: string
                  minimum: 2
                  maximum: 120
                signup_finish:
                  type: string
                  minimum: 2
                  maximum: 120
                channel:
                  type: string
                agent_number:
                  type: string
                broker_role:
                  type: string
                broker_channel:
                  type: string
                email:
                  type: string
                telephone:
                  type: string
                annuity_option_enabled:
                  type: boolean
      responses:
        '204':
          description: Success
        '404':
          description: Not Found
          content:
            application/json:
              example: ''
        '422':
          description: Fail
          content:
            application/json:
              example:
                errors:
                - code: 1818
                  title: Not Enough Characters for email.
                  detail: You need to enter an email with a minimum of 6 characters.
                  meta:
                    count: 2
                  source:
                    pointer: /data/attributes/email
                - code: 1804
                  title: Email address is a required field.
                  detail: You need to enter an email address for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/email
                - code: 1805
                  title: Email address is not valid.
                  detail: 'The email address you entered is not valid. This may be because of the address format or the domain being unreachable. Make sure the address uses this format: name@something.com and that email is enabled for this domain.'
                  meta: {}
                  source:
                    pointer: /data/attributes/email
    patch:
      summary: Users/Update
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: id
        in: path
        required: true
        example: 54
        schema:
          type: string
      - name: adviser_id
        in: path
        required: true
        example: 48
        schema:
          type: string
      requestBody:
        content:
          application/json:
            examples:
              valid_parameters:
                value:
                  email: john@doe.fr
                  name: John Doe
                  address: Burj Khalifa
              invalid_parameters:
                value:
                  email: null
            schema:
              type: object
              properties:
                logo:
                  type: string
                  format: binary
                name:
                  type: string
                  minimum: 2
                  maximum: 115
                address:
                  type: string
                  minimum: 2
                  maximum: 165
                signup_start:
                  type: string
                  minimum: 2
                  maximum: 120
                signup_finish:
                  type: string
                  minimum: 2
                  maximum: 120
                channel:
                  type: string
                agent_number:
                  type: string
                broker_role:
                  type: string
                broker_channel:
                  type: string
                email:
                  type: string
                telephone:
                  type: string
                annuity_option_enabled:
                  type: boolean
      responses:
        '204':
          description: Success
        '404':
          description: Not Found
          content:
            application/json:
              example: ''
        '422':
          description: Fail
          content:
            application/json:
              example:
                errors:
                - code: 1818
                  title: Not Enough Characters for email.
                  detail: You need to enter an email with a minimum of 6 characters.
                  meta:
                    count: 2
                  source:
                    pointer: /data/attributes/email
                - code: 1804
                  title: Email address is a required field.
                  detail: You need to enter an email address for this user.
                  meta: {}
                  source:
                    pointer: /data/attributes/email
                - code: 1805
                  title: Email address is not valid.
                  detail: 'The email address you entered is not valid. This may be because of the address format or the domain being unreachable. Make sure the address uses this format: name@something.com and that email is enabled for this domain.'
                  meta: {}
                  source:
                    pointer: /data/attributes/email
  /users/session:
    get:
      summary: Users/Session
      tags:
      - User
      security:
      - oAuth2:
        - user
      parameters:
      - name: Authorization
        in: header
        required: true
        example: Bearer eyJraWQiOiI5NWIwNTc4MTI5YWZjMjUwZmNlM2M1ZGQwNDdhYjRlYTRiMTdmYTk1MTgyM2Q1NTc1NDhjMWExMWViNmY3NTlmIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2FwaS5ob3N0LmNvbSIsImV4cCI6MTc4NTkzMjIyMywiaWF0IjoxNzg1OTMxNjIzLCJhdWQiOiI5MjM3ODR1MjM0aGsyajNoNDIzaXU0aWhmZHV5MzM0aGo0aGlkZjc4ZmRpZ2ZkaGdmZGdoODkiLCJqdGkiOiJoMXFNRGNhQzFFaElGM0szMWFWRGFueEJFemI5SEgxM1JBR0k2Y0lFQ1lBIiwic2NvcGUiOiI6dXNlciIsInN1YiI6NzIyLCJyb2xlIjoidXNlciJ9.XQBfKvaI-HHcmHkiGHAErxqjM9-vl9pD12YEYhRIOKs23f7rSt_E2Dk-3IVCcoUvxbGS15PV91LncLZSm5RdyrvT_9CfyidY7gSKPQfKJpVqdVqh1vaYh6OTNrje_I4FmbdWR_Z5DtqWGYCneglw5t-yZXWS4GwgoG5drUq0HIM
        schema:
          type: string
      responses:
        '200':
          description: Success (jwt token flow)
          content:
            application/json:
              examples:
                plain_token_flow:
                  value:
                    intercom_user_id: usr721
                    intercom_user_id_hash: 9eef459b3dd943735b86976e5187fec252bfb32fe486c188218a514f5fae5dd5
                    id: 721
                    email: email@example.com
                    title: null
                    forename: forename
                    surname: surname
                    api_key: VTzbn7uGmBulRq3TK4kS-g
                    telephone: '+441234567890'
                    adviser_id: 709
                    smart_analytics_access_permitted: false
                    roles: []
                    created_at: '2026-08-05T13:07:03.000+01:00'
                    updated_at: '2026-08-05T13:07:03.000+01:00'
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/709
                jwt_token_flow:
                  value:
                    intercom_user_id: usr722
                    intercom_user_id_hash: c195bffa578b46914a935a58a6aab5f7ef0968f0ca01e918082cdda7d03fc1a3
                    id: 722
                    email: email@example.com
                    title: null
                    forename: forename
                    surname: surname
                    api_key: tk6icyoglhnqPDPZtdjCZw
                    telephone: '+441234567890'
                    adviser_id: 710
                    smart_analytics_access_permitted: false
                    roles: []
                    created_at: '2026-08-05T13:07:03.000+01:00'
                    updated_at: '2026-08-05T13:07:03.000+01:00'
                    links:
                    - rel: adviser
                      title: adviser
                      href: https://api.host.com/advisers/710
        '401':
          description: Fail
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_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_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_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
          - 'n

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