<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
        SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
       title="List vehicles" id="listVehicles">

    <!-- AUTO-GENERATED, DO NOT EDIT -->
    <p>This endpoint documentation is generated directly from <code>openapi.yaml</code>.</p>
    <chapter title="Endpoint" id="endpoint">
        <code-block lang="http">GET /vehicles</code-block>
    </chapter>
    <chapter title="Operation" id="operation">
        <p>Operation ID: <code>listVehicles</code></p>
        <p>List vehicles or fetch a specific vehicle when `id` is provided.

- When `id` is present, returns a single vehicle object (404 if not found).
- Otherwise returns a paginated list of vehicles.

Permissions:
- Own scope: `list_own_vehicles` (linked to subuser node `VEHICLES_LIST`).
- Broader scope: `list_vehicles_other`.

Subusers may specify header `X-Customer-Number` to target a specific customer. If the broader
permission is missing, the list will automatically be restricted to the effective customer context.
</p>
    </chapter>
    <chapter title="Authentication" id="authentication">
        <p>Security requirements:</p>
        <table>
            <tr><td>Scheme</td><td>Scopes</td></tr>
            <tr><td>BearerAuth</td><td>-</td></tr>
        </table>
    </chapter>
    <chapter title="Parameters" id="parameters">
        <table>
            <tr><td>Name</td><td>In</td><td>Required</td><td>Type</td><td>Description</td></tr>
            <tr><td></td><td></td><td>no</td><td>object</td><td></td></tr>
            <tr><td>id</td><td>query</td><td>no</td><td>integer</td><td></td></tr>
            <tr><td>reg</td><td>query</td><td>no</td><td>string</td><td></td></tr>
            <tr><td>customer_id</td><td>query</td><td>no</td><td>integer</td><td></td></tr>
        </table>
    </chapter>
    <chapter title="Responses" id="responses">
        <table>
            <tr><td>Status</td><td>Description</td><td>Content Types</td></tr>
            <tr><td>200</td><td>Vehicle(s) retrieved successfully</td><td>application/json</td></tr>
            <tr><td>403</td><td></td><td></td></tr>
            <tr><td>404</td><td></td><td></td></tr>
        </table>
        <p>Schema for response <code>200</code> (<code>application/json</code>):</p>
        <code-block lang="json">
{
  &quot;oneOf&quot;: [
    {
      &quot;$ref&quot;: &quot;#/components/schemas/Vehicle&quot;
    },
    {
      &quot;items&quot;: {
        &quot;$ref&quot;: &quot;#/components/schemas/Vehicle&quot;
      },
      &quot;type&quot;: &quot;array&quot;
    }
  ]
}
        </code-block>
    </chapter>
</topic>
