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

# Raw Passthrough

> Make an authenticated request to the underlying telematics provider and forward successful provider response bodies directly.

Use Raw Passthrough for provider endpoints that download inspection photos, documents, videos, or other non-JSON files.

Response rules:

* **Provider success (2xx):** the provider body is returned as raw bytes with the provider's `Content-Type` and status.
* **Provider error (non-2xx):** the response is HTTP `200` with a `PassthroughOutput` JSON envelope (`statusCode`, `headers`, `response`), matching `/passthrough`. Unsuccessful provider responses are therefore not surfaced as Terminal API errors; check the envelope's `statusCode` for the provider status.
* **Terminal error:** requests that fail before or around the provider call return a standard Terminal error status and JSON body.

For normal JSON API calls where you want Terminal to parse and wrap successful provider responses too, use `/passthrough` instead.


## OpenAPI

````yaml POST /passthrough/raw
openapi: 3.1.0
info:
  title: Terminal Telematics API
  description: >-
    Terminal is a unified API that makes it easy to integrate with the leading
    telematics service providers.
  version: '0.0'
  contact:
    name: Terminal
    email: connect@withterminal.com
    url: https://www.withterminal.com
servers:
  - url: https://api.withterminal.com/tsp/v1
    description: Production
  - url: https://api.sandbox.withterminal.com/tsp/v1
    description: Sandbox
security:
  - Authorization: []
tags:
  - name: Authentication
  - name: Connections
  - name: Data Management
  - name: Drivers
  - name: Groups
  - name: Hours of Service
  - name: IFTA
  - name: Issues
  - name: Link
  - name: Providers
  - name: Safety
  - name: Trailers
  - name: Vehicles
  - name: Vehicle Utilization
  - name: Webhook Events
paths:
  /passthrough/raw:
    parameters: []
    post:
      tags:
        - Data Management
      summary: Raw Passthrough
      description: >-
        Make an authenticated request to the underlying telematics provider and
        forward successful provider response bodies directly.


        Use Raw Passthrough for provider endpoints that download inspection
        photos, documents, videos, or other non-JSON files.


        Response rules:

        - **Provider success (2xx):** the provider body is returned as raw bytes
        with the provider's `Content-Type` and status.

        - **Provider error (non-2xx):** the response is HTTP `200` with a
        `PassthroughOutput` JSON envelope (`statusCode`, `headers`, `response`),
        matching `/passthrough`. Unsuccessful provider responses are therefore
        not surfaced as Terminal API errors; check the envelope's `statusCode`
        for the provider status.

        - **Terminal error:** requests that fail before or around the provider
        call return a standard Terminal error status and JSON body.


        For normal JSON API calls where you want Terminal to parse and wrap
        successful provider responses too, use `/passthrough` instead.
      operationId: passthroughRaw
      parameters:
        - name: Connection-Token
          in: header
          required: true
          schema:
            type: string
            example: con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4
            pattern: ^con_tkn_\S+$
          description: >-
            The token returned when a user authenticated their account. This
            authorizes access to a specific account.
      requestBody:
        content:
          application/json:
            schema:
              title: Passthrough Input
              type: object
              properties:
                method:
                  type: string
                  enum:
                    - GET
                    - POST
                    - PUT
                    - PATCH
                    - DELETE
                  description: The method for the third-party request, such as GET or POST.
                  example: POST
                path:
                  type: string
                  description: The path for the third-party request, such as `/reports`
                  example: /reports
                headers:
                  type: object
                  description: >-
                    The headers to use for the request (Terminal will handle the
                    connection's authorization headers)
                body:
                  type: string
                  description: The request body
                  example: '{"reportId":"1234"}'
              required:
                - method
                - path
            examples:
              downloadMediaFile:
                summary: Download a media file
                value:
                  method: POST
                  path: /media/files/download
                  body: '{"fileId":"file_123"}'
      responses:
        '200':
          description: >-
            A successful provider response body, forwarded directly without the
            Terminal `PassthroughOutput` JSON envelope. The `Content-Type`
            reflects the provider's response (for example `image/jpeg` or
            `application/pdf`), not necessarily `application/octet-stream`.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: >-
                  Raw response bytes from the provider. The body is not a JSON
                  object and is not base64 encoded for HTTP clients. This
                  endpoint may also return HTTP 200 with a `PassthroughOutput`
                  JSON envelope (see the endpoint description) when the provider
                  itself responds with an error status.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - bad_request
                  message:
                    type: string
                    example: Invalid request body
                  detail:
                    type: array
                    items:
                      title: ErrorPathDetail
                      type: object
                      properties:
                        message:
                          type: string
                          example: '''vehicleId'' property must be a valid ulid'
                        path:
                          type: string
                          example: '{requestQuery}.vehicleId'
                        suggestion:
                          type: string
                          example: >-
                            Please ensure you submit a valid 'vehicleId'
                            property
                        context:
                          type: object
                      required:
                        - message
                        - path
                required:
                  - code
                  - message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - unauthorized
                  message:
                    type: string
                    example: Unauthorized Request
                  detail:
                    type: string
                    example: Please ensure you have a valid API key
                required:
                  - code
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - forbidden
                  message:
                    type: string
                    example: Forbidden Request
                  detail:
                    type: string
                    example: >-
                      Please ensure the connection token matches the resource
                      you are attempting to access.
                required:
                  - code
                  - message
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - unprocessable_entity
                      - connection_disconnected
                      - insufficient_permissions
                      - invalid_credentials
                    example: connection_disconnected
                  message:
                    type: string
                    example: Connection must be connected to perform this action
                  detail:
                    type: array
                    items:
                      title: ErrorPathDetail
                      type: object
                      properties:
                        message:
                          type: string
                          example: '''vehicleId'' property must be a valid ulid'
                        path:
                          type: string
                          example: '{requestQuery}.vehicleId'
                        suggestion:
                          type: string
                          example: >-
                            Please ensure you submit a valid 'vehicleId'
                            property
                        context:
                          type: object
                      required:
                        - message
                        - path
                    example: []
                required:
                  - code
                  - message
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  code:
                    enum:
                      - too_many_requests
                  retryAfter:
                    description: The number of seconds to wait before retrying the request
                    type: integer
                    example: 60
                  message:
                    type: string
                    example: Too Many Requests
                  detail:
                    type: string
                    example: You have exceeded your rate limit. Please try again later.
                required:
                  - code
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - internal_server_error
                  message:
                    type: string
                    example: Internal Server Error
                  detail:
                    type: string
                    example: Something went wrong
                required:
                  - code
                  - message
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - not_implemented
                  message:
                    type: string
                    example: Not Implemented
                  detail:
                    type: string
                    example: This endpoint is not yet implemented
                required:
                  - code
                  - message
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - bad_gateway
                  message:
                    type: string
                    example: Provider Unavailable
                  detail:
                    type: string
                    example: Error response received from provider with status 500
                required:
                  - code
                  - message
        '504':
          description: Gateway Timeout Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - gateway_timeout
                  message:
                    type: string
                    example: Gateway Timeout
                required:
                  - code
                  - message
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````