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

# Proxy request

> Encrypt or decrypt data based on headers.  Allows forwarding to remote destinations.



## OpenAPI

````yaml /openapi/v1.yaml post /proxy/{proxy}
openapi: 3.0.0
info:
  title: Qanapi API v1
  version: 1.0.0
  description: Legacy Qanapi API version 1
servers:
  - url: https://your-account.qanapi.cloud
security:
  - ApiKey: []
paths:
  /proxy/{proxy}:
    parameters:
      - $ref: '#/components/parameters/proxy'
      - $ref: '#/components/parameters/qanapiMode'
      - $ref: '#/components/parameters/qanapiFields'
      - $ref: '#/components/parameters/qanapiDestination'
    post:
      summary: Proxy request
      description: >-
        Encrypt or decrypt data based on headers.  Allows forwarding to remote
        destinations.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              name: John Smith
              email: john@example.com
              ssn: 123-45-6789
              dob: '1980-01-01'
              address: 123 Main St
      responses:
        '200':
          $ref: '#/components/responses/ProxyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '422':
          $ref: '#/components/responses/InvalidMode'
components:
  parameters:
    proxy:
      name: proxy
      in: path
      required: true
      schema:
        type: string
      description: The proxy slug of your encryption configuration
    qanapiMode:
      name: x-qanapi-mode
      in: header
      required: true
      schema:
        type: string
        enum:
          - encrypt
          - decrypt
      description: Tells the route whether to encrypt or decrypt the payload.
    qanapiFields:
      name: x-qanapi-fields
      in: header
      required: true
      schema:
        type: string
      description: Comma separated list of fields to encrypt
    qanapiDestination:
      name: x-qanapi-destination
      in: header
      required: false
      schema:
        type: string
      description: >-
        A URL to forward the encrypted data to.  All non-qanapi headers will be
        forwarded to the destination.
  responses:
    ProxyResponse:
      description: Successful operation
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
          example:
            name: John Smith
            email: john@example.com
            ssn: >-
              qanapi:MQ:MDFreWVwc2hkMjE2d2N2dHlyZ3NtbXR0M2M:Un9XLlZVXEhQVK/+MiOAiw:$
            dob: >-
              qanapi:MQ:MDFreWVwc2hkOTUwMTkwejUya3I5eHM4OGI:F9ArUSbZ9qrfjX7zN+Fk/Q:$
            address: 123 Main St
    BadRequest:
      description: Invalid headers
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                message: The X-Qanapi-Authorization header is required.
            invalidApiKey:
              summary: Invalid API key
              value:
                message: The X-Qanapi-Authorization token provided is invalid.
    InvalidMode:
      description: Invalid mode
      content:
        application/json:
          schema:
            type: object
            additionalProperties: true
          example:
            error: Invalid mode provided
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Qanapi-Authorization

````