openapi: 3.0.0
security: []
info:
  title: SignBox API
  version: 1.0.0
  description: >
    For testing purposes, Uanataca provides integrators of a pre-configured
    test-mode SignBox Optimizer accessible at the following URL:
    `https://optimizer-developers.uanataca.com`


    For more information about the sandbox environment click here. [UANATACA
    SIGNBOX API
    Sandbox](https://namirial.atlassian.net/wiki/spaces/BES/pages/276856895/UANATACA+SIGNBOX+API#Sandbox-Environment)
  x-logo:
    url: https://web.uanataca.com/common/project/svg/logo.svg
servers:
  - url: /signbox
paths:
  /api/v1/echo:
    get:
      summary: Echo
      tags:
        - Signature
      description: Replies back what it receives to check the service availability.
      operationId: echo_api_v1_echo_get
      parameters:
        - name: message
          in: query
          required: false
          schema:
            type: string
            default: echo
            title: Message
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/plain:
              schema:
                type: string
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X GET
            'https://signbox.sandbox.uanataca.com/api/v1/echo?message=HelloWorld'
          label: curl
  /api/v1/image:
    post:
      summary: Upload Image
      tags:
        - Images
      description: Uploads an image for using in a visual graphic signature.
      operationId: call_upload_image_api_v1_image_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Upload_image'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: Image uploaded with uid '463156ce-d566-44d2-94e9-184d89632b98'
                details:
                  image_uid: 463156ce-d566-44d2-94e9-184d89632b98
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Images of type xxx are not supported
                detail:
                  error_code: 0cc65ceeb3bc392d
                  error_message: Images of type xxx are not supported
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              examples:
                Field required:
                  summary: Field Required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: 41117e5a6fe99a22
                      error_message: Invalid input fields
                      fields:
                        image: Field required
                Invalid input field:
                  summary: Invalid input field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: e40f1e86ff908e96
                      error_message: Invalid input fields
                      fields:
                        image: >-
                          Value error, Expected UploadFile, received: <class
                          'str'>
  /api/v1/token:
    post:
      tags:
        - Tokens
      summary: Call Create Token
      description: >-
        Creates a new token that contains the Registration Authority Officer
        (RAO) credentials
      operationId: call_create_token_api_v1_token_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateToken'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: Token created
                details:
                  token_uid: 14185cd9-c6ec-30f4-9f59-a844a77bc234
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Environment xxx doesn't exist
                detail:
                  error_code: d47bc1acf7151230
                  error_message: Environment xxx doesn't exist
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                status: error
                message: Invalid RAO credentials
                details:
                  error_code: 1dbf554b582f5caf
                  error_message: Invalid RAO credentials
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema: {}
              examples:
                Token already created:
                  summary: Token already created
                  value:
                    status: error
                    message: Token for username xxx already exists
                    details:
                      error_code: d0c1e1262b1c73b4
                      error_message: Token for username xxx already exists
                Certificate expired:
                  summary: Certificate expired
                  value:
                    status: error
                    message: 'Cannot create token: Certificate expired'
                    details:
                      error_code: 1ec7ba6ace391c26
                      error_message: 'Cannot create token: Certificate expired'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              examples:
                Field Required:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    details:
                      error_code: 09e736eb3db9f1ac
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameters:
                  summary: Missing parameters
                  value:
                    status: error
                    message: Cannot retrieve certificate for remote identity
                    details:
                      error_code: 09e736eb3db9f1ac
                      error_message: Cannot retrieve certificate for remote identity
                Invalid JSON:
                  summary: Invalid JSON
                  value:
                    status: error
                    message: Data validation error
                    details:
                      error_code: 82efa64d5c532e15
                      error_message: Invalid input fields
                      fields:
                        xxx: JSON decode error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Error occured while verifying SignCloud credentials
                details:
                  error_code: 95d85b9ac22592dd
                  error_message: Error occured while verifying SignCloud credentials
  /api/v1/token/{token_uid}:
    get:
      tags:
        - Tokens
      summary: Call Get Token
      description: >-
        Retrieves the token associated credentials with the given unique
        identifier.<br> The response gets a `true` or `false` value regarding if
        password and PIN parameters are associated to the token.
      operationId: call_get_token_api_v1_token__token_uid__get
      parameters:
        - name: token_uid
          in: path
          description: The token unique identifier
          required: true
          schema:
            title: Token Uid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                details:
                  username: '2626807'
                  password: 'true'
                  pin: 'true'
                  rao_id: '1182'
                  env: xxx
        '404':
          description: Not found
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Token False not found
                details:
                  error_code: 1bf11df92bcefb91
                  error_message: Token False not found
        '405':
          description: Method Not allowed
          content:
            application/json:
              schema: {}
              example:
                details: Method Not Alllowed
    delete:
      tags:
        - Tokens
      summary: Call Delete Token
      description: Deletes the token with the specified unique identifier.
      operationId: call_delete_token_api_v1_token__token_uid__delete
      parameters:
        - name: token_uid
          in: path
          description: The token unique identifier
          required: true
          schema:
            title: Token Uid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: >-
                  Token 0112c943-87a3-4fdf-b12g-d95233e973b5 deleted
                  successfully
        '405':
          description: Method Not allowed
          content:
            application/json:
              schema: {}
              example:
                details: Method Not Alllowed
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Cannot delete token xxx
                detail:
                  error_code: 68116cf0cdc38f1c
                  error_message: Cannot delete token xxx
  /api/v1/tokens:
    get:
      tags:
        - Tokens
      summary: Call List Tokens
      description: Returns a list of all tokens available and their associated data.
      operationId: call_list_tokens_api_v1_tokens_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                detail:
                  6d1cae4d55be4cdf9cac50ee36f73406:
                    username: '9001800'
                    password: true
                    pin: true
                    rao_id: '1182'
                    env: xxx
        '405':
          description: Method Not allowed
          content:
            application/json:
              schema: {}
              example:
                details: Method Not Alllowed
  /api/v1/image/{image_uid}:
    get:
      tags:
        - Images
      summary: Call Get Image
      description: Retrieves a previously uploaded image.
      operationId: call_get_image_api_v1_image__image_uid__get
      parameters:
        - name: image_uid
          in: path
          description: The image unique identifier
          required: true
          schema:
            title: Image Uid
      responses:
        '200':
          description: Successful Response
          content:
            image/png:
              schema: {}
              example: The retrieved image in png format
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Image xxx not found on disk
                detail:
                  error_code: f95a1897e69e95d3
                  error_message: Image xxx not found on disk
        '405':
          description: Method Not allowed
          content:
            application/json:
              schema: {}
              example:
                details: Method Not Alllowed
    delete:
      summary: Call Delete Image
      tags:
        - Images
      description: Deletes a previously uploaded image.
      operationId: call_delete_image_api_v1_image__image_uid__delete
      parameters:
        - name: image_uid
          in: path
          description: The image unique identifier
          required: true
          schema:
            title: Image Uid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: Image c4cb5944-463156ce-d566-44d2-94e9-184d89632b98 deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Image xxx not found on disk
                detail:
                  error_code: 992f6c95e257d711
                  error_message: Image xxx not found on disk
        '405':
          description: Method Not allowed
          content:
            application/json:
              schema: {}
              example:
                details: Method Not Alllowed
  /api/v1/images:
    get:
      tags:
        - Images
      summary: Call Get Images
      description: Lists all uploaded images.
      operationId: call_list_images_api_v1_images_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                detials:
                  aef3f74c-0f39-408f-8f54-657bd71d6d3a:
                    content_type: image/png
                    filename: xxx.png
                    digest: >-
                      ea9c05a7228cd8106a0bcedd8ce7952dee24455e6ebd1354a9a9d99023cbc5ed
                  93868edb-561d-4439-a56d-79f2a8c32087:
                    content_type: image/jpeg
                    filename: xxx.jpg
                    digest: >-
                      eff1343e1353940a23a199bb0ecda8f4bfbccc01f940c782326622851cb42c62
    delete:
      summary: Call Delete Images
      tags:
        - Images
      description: Deletes all uploaded images.
      operationId: call_delete_images_api_v1_images_delete
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: All Images deleted
  /api/v1/sign:
    post:
      summary: Sign
      tags:
        - Signature
      description: Signs the submitted file.
      operationId: sign_api_v1_sign_post
      parameters:
        - name: append
          in: query
          required: false
          schema:
            type: string
            title: Append
        - name: countersign
          in: query
          required: false
          schema:
            type: string
            title: Countersign
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Sign'
      responses:
        '200':
          description: Successful Response
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: Signed file
                example: The document in PDF
            application/pkcs7-mime:
              schema:
                type: string
                format: binary
                description: Signed file
            application/xml:
              schema:
                type: string
                format: binary
                description: Signed file
            application/json:
              schema: {}
              example:
                value:
                  status: success
                  message: New job process created
                  detail:
                    status: created
                    format: xxx
                    env: xxx
                    jobid: 9bf9513f-3f9b-4020-b3a6-7275e3cd76e1
        '400':
          content:
            application/json:
              schema: {}
              example:
                value:
                  status: error
                  message: >-
                    'xxx' is not a valid environment. Available environments
                    are: devel, sandbox, prod
                  detail:
                    error_code: 5344848148e9b99d
                    error_message: >-
                      'xxx' is not a valid environment. Available environments
                      are: devel, sandbox, prod
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Invalid billing:
                  summary: Invalid or missing billing parameters
                  value:
                    status: error
                    message: Invalid billing credentials
                    details:
                      error_code: xxx
                      error_message: Invalid billing credentials
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Required parameter:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: decd5282139a23a7
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameter:
                  summary: Empty field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: aecd5182139a23a9
                      error_message: Invalid input fields
                      fields:
                        xxx: Empty field
                Invalid credentials:
                  summary: Invalid credentials
                  value:
                    status: error
                    message: >-
                      Error occurred while signing document: Cannot retrieve
                      certificate for remote identity xxx
                    detail:
                      error_code: bb6d73c28aa05ccb
                      error_message: >-
                        Error occurred while signing document: Cannot retrieve
                        certificate for remote identity xxx
                File or url missing in the request:
                  summary: File or url missing in the request
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: af5c33b337e019dd
                      error_message: Invalid input fields
                      fields:
                        '': Value error, One of file or url_in must be provided
                Signature appearance invalid json:
                  summary: Signature appearance invalid json
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: a6c8c349cbe5f724
                      error_message: Invalid input fields
                      fields:
                        signature_appearance: Value error, Invalid JSON
                Invalid format:
                  summary: Invalid format
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: a7f4b1128e15f25c
                      error_message: Invalid input fields
                      fields:
                        format: Input should be 'PADES', 'CADES' or 'XADES'
          description: Unprocessable Entity
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X POST 'https://signbox.sandbox.uanataca.com/api/v1/sign'   -H
            'Content-Type: multipart/form-data'   -F file=@file.pdf  
            --form-string 'username=username'   --form-string 'pin=pin'  
            --form-string 'password=password'   --form-string 'format=PADES'  
            --form-string 'level=BASIC'
          label: curl
  /api/v1/job/{jobid}:
    get:
      summary: Job
      tags:
        - Troubleshooting
      description: Get job status
      operationId: job_api_v1_job__jobid__get
      parameters:
        - name: jobid
          in: path
          required: true
          schema:
            type: string
            title: Jobid
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: completed
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Job xxx cannot be found
                detail:
                  error_code: f7d54f44e9c3d55d
                  error_message: Job xxx cannot be found
  /api/v1/result/{jobid}:
    get:
      summary: Result
      tags:
        - Troubleshooting
      description: Get job result
      operationId: result_api_v1_result__jobid__get
      parameters:
        - name: jobid
          in: path
          required: true
          schema:
            type: string
            title: Jobid
      responses:
        '200':
          description: Successful Response
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: Signed file
                example: The document in PDF
            application/pkcs7-mime:
              schema:
                type: string
                format: binary
                description: Signed file
            application/xml:
              schema:
                type: string
                format: binary
                description: Signed file
        '400':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Job xxx cannot be found
                detail:
                  error_code: f7d54f44e9c3d55d
                  error_message: Job xxx cannot be found
  /api/v1/otp:
    post:
      summary: Otp
      tags:
        - Signature
      description: Generates an otp for the specified digital identity.
      operationId: otp_api_v1_otp_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Otp'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
              example:
                status: success
                message: OTP generated
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              examples:
                Credentials not qualified:
                  summary: Credentials not qualified
                  value:
                    status: error
                    message: Invalid Remote Token
                    detail:
                      error_code: 516d15cf01be9586
                      error_message: The token specified is not a qualified one
                Invalid environment:
                  summary: Invalid environment
                  value:
                    status: error
                    message: >-
                      'xxx' is not a valid environment. Available environments
                      are: devel, sandbox, prod
                    detail:
                      error_code: 966543b86aac37e3
                      error_message: >-
                        'xxx' is not a valid environment. Available environments
                        are: devel, sandbox, prod
        '404':
          description: Not Found
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Remote token not found
                detail:
                  error_code: 00361a8e783a625b
                  error_message: Remote token xxx not found
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Field required:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: 06aaf9e1ca002fe9
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameter:
                  summary: Empty field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: aecd5182139a23a9
                      error_message: Invalid input fields
                      fields:
                        xxx: Empty field
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X POST 'https://signbox.sandbox.uanataca.com/api/v1/otp'   -H
            'Content-Type: multipart/form-data'   --form-string
            'username=username'   --form-string 'password=password'
          label: curl
  /api/v1/open_session:
    post:
      summary: Open Session
      tags:
        - Signature
      description: Open a signature session for the specified digital identity.
      operationId: open_session_api_v1_open_session_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Open_session'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                description: Session id
                example:
                  status: success
                  message: Session opened
                  detail:
                    sessionid: a07e9c99-c83e-424f-a396-20b4683fa2a0
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: >-
                  'xxx' is not a valid environment. Available environments are:
                  devel, sandbox, prod
                detail:
                  error_code: 966543b86aac37e3
                  error_message: >-
                    'xxx' is not a valid environment. Available environments
                    are: devel, sandbox, prod
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Required parameter:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: decd5282139a23a7
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameter:
                  summary: Empty field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: aecd5182139a23a9
                      error_message: Invalid input fields
                      fields:
                        xxx: Empty field
        '500':
          description: Interal Server Error
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Session opening error
                detail:
                  error_code: 80f2e0b99e1fa7a0
                  error_message: Session opening error
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X POST
            'https://signbox.sandbox.uanataca.com/api/v1/open_session'   -H
            'Content-Type: multipart/form-data'   --form-string
            'username=username'   --form-string 'password=password'  
            --form-string 'otp=otp'
          label: curl
  /api/v1/close_session:
    post:
      summary: Close Session
      tags:
        - Signature
      description: Close the specified signature session.
      operationId: close_session_api_v1_close_session_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Close_session'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: >-
                  'xxx' is not a valid environment. Available environments are:
                  devel, sandbox, prod
                detail:
                  error_code: 966543b86aac37e3
                  error_message: >-
                    'xxx' is not a valid environment. Available environments
                    are: devel, sandbox, prod
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Required parameter:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: decd5282139a23a7
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameter:
                  summary: Empty field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: aecd5182139a23a9
                      error_message: Invalid input fields
                      fields:
                        xxx: Empty field
        '500':
          description: Interal Server Error
          content:
            application/json:
              schema: {}
              example:
                status: error
                message: Session opening error
                detail:
                  error_code: 80f2e0b99e1fa7a0
                  error_message: Session opening error
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X POST
            'https://signbox.sandbox.uanataca.com/api/v1/close_session'   -H
            'Content-Type: multipart/form-data'   --form-string
            'username=username'   --form-string 'password=password'  
            --form-string 'sessionid=sessionid'
          label: curl
  /api/v1/timestamp:
    post:
      summary: Timestamp
      tags:
        - Timestamp
      description: Timestamps the submitted file
      operationId: timestamp_api_v1_timestamp_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Timestamp'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/timestamp-reply:
              schema:
                type: string
                format: binary
                description: Timestamped file
                example: The document in PDF
            application/timestamped-data:
              schema:
                type: string
                format: binary
                description: Timestamped file
            application/pdf:
              schema:
                type: string
                format: binary
                description: Timestamped file
            application/timestamp-token:
              schema:
                type: string
                format: binary
                description: Timestamped file
            multipart/mixed:
              schema:
                type: string
                format: binary
                description: Timestamped file
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
              examples:
                Field required:
                  summary: Field required
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: 06aaf9e1ca002fe9
                      error_message: Invalid input fields
                      fields:
                        xxx: Field required
                Missing parameter:
                  summary: Empty field
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: aecd5182139a23a9
                      error_message: Invalid input fields
                      fields:
                        xxx: Empty field
                File is empty:
                  summary: File is empty
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: 299997b341901b99
                      error_message: Invalid input fields
                      fields:
                        file: Value error, File is empty
                Invalid format:
                  summary: Invalid format
                  value:
                    status: error
                    message: Data validation error
                    detail:
                      error_code: bc3e0e54ffee6739
                      error_message: Invalid input fields
                      fields:
                        format: >-
                          Input should be 'TSR', 'TSD', 'PDF', 'TST', 'M7M' or
                          'P7M'
      x-codeSamples:
        - lang: curl
          source: >-
            curl -X POST
            'https://signbox.sandbox.uanataca.com/api/v1/timestamp'   -H
            'Content-Type: multipart/form-data'   -F file=@file.pdf  
            --form-string 'url=url'   --form-string 'username=username'  
            --form-string 'password=password'   --form-string 'format=TSD'
          label: curl
components:
  schemas:
    CreateToken:
      properties:
        username:
          type: string
          title: Username
          description: The RAO's digital identity username
        password:
          type: string
          description: >-
            The RAO's digital identity password. If not included in this call,
            must be included in calls that require RAO's credentials
          title: Password
        pin:
          type: string
          description: >-
            The RAO's digital identity PIN. If not included in this call, must
            be included in calls that require RAO's credentials
          title: Pin
        env:
          type: string
          description: The API work environment. (sandbox / prod)
          title: Env
      type: object
      required:
        - username
      title: CreateToken
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Close_session:
      properties:
        username:
          type: string
          title: Username
          description: Digital identity username
        password:
          type: string
          title: Password
          description: Digital identity password
        sessionid:
          type: string
          title: Sessionid
          description: The id of the session previously opened
        env:
          type: string
          description: |-
            Reference environment for sandbox or production 
             - sandbox
             - prod
          enum:
            - sandbox
            - prod
          title: Env
          default: prod
      type: object
      required:
        - username
        - password
        - sessionid
      title: Close session
    Open_session:
      properties:
        username:
          type: string
          title: Username
          description: Digital identity username
        password:
          type: string
          title: Password
          description: Digital identity password
        otp:
          type: string
          title: Otp
          description: The OTP code previously sent to the user
        env:
          type: string
          description: |-
            Reference environment for sandbox or production 
             - sandbox
             - prod
          enum:
            - sandbox
            - prod
          title: Env
          default: prod
      type: object
      required:
        - username
        - password
        - otp
      title: Open_session
    Otp:
      properties:
        username:
          type: string
          title: Username
          description: Digital identity username
        password:
          type: string
          title: Password
          description: Digital identity password
        env:
          type: string
          description: |-
            Reference environment for sandbox or production 
             - sandbox
             - prod
          enum:
            - sandbox
            - prod
          title: Env
          default: prod
      type: object
      required:
        - username
        - password
      title: Otp
    Upload_image:
      properties:
        image:
          type: array
          description: The image to add in the visual graphic signature in PNG format
          format: string
          title: Image
      type: object
      required:
        - image
      title: Upload_image
    Sign:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: >-
            File to be signed. If this parameter is specified, **leave `url_in`
            blank**
        url_in:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url In
          description: >-
            Url to download the file to sign. If this parameter is specified,
            **leave `file_in` blank**
        url_out:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url Out
          description: Url where to send the signed file
        urlback:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Urlback
          description: Url where to send log process informations
        env:
          type: string
          description: |-
            Reference environment for sandbox or production 
             - **sandbox** 
             - **prod**
          enum:
            - prod
            - sandbox
          title: Env
          default: prod
        username:
          type: string
          title: Username
          description: Digital identity username
        password:
          type: string
          title: Password
          description: Digital identity password
        pin:
          type: string
          title: Pin
          description: Digital identity PIN
        identifier:
          type: string
          title: Identifier
          description: Digital identity identifier
          default: DS0
        certificate_check:
          type: boolean
          title: certificate_check
          description: Verification of certificate validity status
        format:
          type: string
          title: Format
          enum:
            - pades
            - xades
            - cades
          default: pades
          description: |-
            Types of supported signature profiles:

            **pades** for PDF files

            **xades** for XML files

            **cades** for other files
        otp:
          type: string
          title: Otp
          description: >-
            The OTP code previously sent to the user. This parameter is only
            required and available for specific digital identities
        sessionid:
          type: string
          title: Sessionid
          description: >-
            The id of the session previously opened. This parameter is only
            required and available for specific digital identities
        level:
          type: string
          enum:
            - BASIC
            - T
            - LTV
            - LTVLITE
            - LTVA
          title: Level
          description: |-
            Specify the level of the signature 
             - BASIC, T, LTV, LTVLITE, LTVA for pades

            - BASIC, T, EPES, XL for xades

            - BASIC, T, EPES for cades
          default: BASIC
        tsa_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Tsa Url
          description: >-
            Timestamp service URL. This field is required for signatures with
            levels T or LTV. Required only if not set at settings.toml file.
          default: https://tsa.uanataca.com/tsa/tss03
        tsa_user:
          type: string
          title: Tsa User
          description: Timestamp service billing username.
          default: ''
        tsa_pass:
          type: string
          title: Tsa Pass
          description: Timestamp service billing password.
          default: ''
        billing_username:
          type: string
          title: Billing Username
          description: Billing account username
        billing_password:
          type: string
          title: Billing Password
          description: Billing account password in base64 or plain text
        page:
          type: integer
          title: Page
          description: >-
            Page number where the image signature is placed. The first page
            starts in 0
          default: 0
        signature_ids:
          type: string
          title: Signature Ids
          description: 'PDF signature field ids to sign (Example: signature1,signature2)'
        signature_appearance:
          type: string
          title: Signature Appearance
          description: |
            Describes the signature appearance like an JSON object.
            The parameters are:
              - **text** This property controls the text that is going to be introduced. Through variables you retrieve information from the signer certificate. '%(CN)', '%(SUBJECT)s', '%(DATE)s', '%(E)s' can be used.
              - **date** Date formatting. An input example would be %d/%m/%Y %H:%M:%S
              - **timezone** Selected timezone for the graphic signature, default is UTC.
                              You can list the time zones with the following linux command: timedatectl list-timezones
              - **position** The coordinates in points (pt) for signature image position and size, starting from bottom left corner (x1,y1,x2,y2). 1px = 0.75pt.
              - **image** The previously uploaded image id
              - **b64_image** the image in base64
              - **qrcode** url used to build a qr
              - **horizontal**
              - **page** The document page where the signature will be placed. The first page starts at 0
              - **text_size** Controls the text size.
              - **text_align** Controls the horizontal alignment of text
              - **reason** Reason about the signature
              - **location** Geographic location about the signature

            ```json
            {
              "text": [
                "Firmado por: %(CN)s",
                "%(EMAIL)s %(L)s %(SUBJECT)s",
                "Fecha: %(DATE)s"
              ],
              "date": "%d/%m/%Y %H:%M:%S %z",
              "timezone": "America/Guatemala",
              "position": "30,100,165,150",
              "image": "be1cd133-8be5-4346-87de-d40afd90a3b9",
              "horizontal": true,
              "page": 0
            }
        signature_subfilter:
          type: string
          enum:
            - ETSI.CAdES.detached
            - adbe.pkcs7.detached
          title: Signature Subfilter
          description: Change the signature subfilter. Default ETSI.CAdES.detached
          default: ETSI.CAdES.detached
        useasync:
          type: boolean
          title: Useasync
          description: Enable the asyncronous flow. Default asynchronous
          default: true
      type: object
      required:
        - username
        - password
        - pin
        - billing_username
        - billing_password
      title: Sign
    Timestamp:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: File to be timestamped
        tsa_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: Timestamp service URL
        billing_username:
          type: string
          title: Username
          description: Timestamp service billing username
        billing_password:
          type: string
          title: Password
          description: Timestamp service billing password
        format:
          type: string
          enum:
            - TSR
            - TSD
            - PDF
            - TST
            - M7M
            - P7M
          title: Format
          description: |-
            Supported timestamp formats. Default PDF 
             - TSR 

            - TSD 

            - PDF 

            - TST 

            - M7M 

            - P7M
          default: TSR
        policy:
          type: string
          title: Policy
          description: Timestamp policy
      type: object
      required:
        - file
        - url
      title: Timestamp
    HTTPError:
      properties:
        error_code:
          type: integer
          title: Error Code
        detail:
          title: Detail
      type: object
      required:
        - error_code
        - detail
      title: HTTPError
