> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mosey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup Payroll Connection for Legal Entity



## OpenAPI

````yaml /openapi_v2.json post /v2/auth/payroll
openapi: 3.1.0
info:
  title: Mosey API
  description: If you'd like to use the Mosey API, please contact sales@mosey.com.
  version: V2
  x-logo:
    url: null
servers: []
security: []
paths:
  /v2/auth/payroll:
    post:
      summary: Setup Payroll Connection for Legal Entity
      operationId: setup_payroll_v2_auth_payroll_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PlatformAuthenticationSessionPayrollSetupRequest
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PlatformAuthenticationSessionPayrollSetupResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PlatformAuthenticationSessionPayrollSetupRequest:
      properties:
        legal_entity_id:
          type: string
          title: Legal Entity Id
        authorization_callback_url:
          type: string
          title: Authorization Callback Url
      type: object
      required:
        - legal_entity_id
        - authorization_callback_url
      title: PlatformAuthenticationSessionPayrollSetupRequest
    PlatformAuthenticationSessionPayrollSetupResponse:
      properties:
        url:
          type: string
          title: Url
      type: object
      required:
        - url
      title: PlatformAuthenticationSessionPayrollSetupResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````