---
post:

  summary: Check if a signatory can sign

  tags:
    - Sign
    - Internal

  description: |
    Check if a signatory `sign` call could succeed.

  parameters:
    - $ref: ../../../../extras/parameters.yaml#/DocumentID
    - $ref: ../../../../extras/parameters.yaml#/SignatoryID
    - $ref: ../../../../extras/parameters.yaml#/SignParamFields
    - $ref: ../../../../extras/parameters.yaml#/SignParamAuthType
    - $ref: ../../../../extras/parameters.yaml#/SignParamAuthValue
    - $ref: ../../../../extras/parameters.yaml#/SignParamSMSPIN
    - $ref: ../../../../extras/parameters.yaml#/SignParamAcceptedAttachments
    - $ref: ../../../../extras/parameters.yaml#/ObjectVersion

  responses:
    200:
      description: |
        A call to `{document_id}/{signatory_id}/sign` with the same parameters
        should succeed.
    400:
      description: TODO
      # TODO
      # request_parameters_invalid; The parameter 'authentication_(type|value)' had the following problems: (problems).
      # request_parameters_invalid; The parameter 'sms_pin' had the following problems: invalid SMS PIN
      # FIXME It is possible to add a schema here, although APIError is too general
    409:
      description: TODO
      # TODO
      # signatory_state_error; The signatory has already signed.
      # signatory_state_error; Swedish BankID authentication needed before signing.
      # signatory_state_error; Some mandatory author attachments aren't accepted.
      # FIXME It is possible to add a schema here, although APIError is too general
