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

# Create a tag assignment

> Creates a tag assignment. When `has_gps` is true, `vehicle_external_id` is required; otherwise `vehicle_title` and `vehicle_license_plate` are required. `tag_number` is unique per organization.



## OpenAPI

````yaml /openapi.json post /paso-rapido/tags
openapi: 3.1.0
info:
  title: United Logistics API
  version: 0.1.0
  description: >-
    Industry-grade public API for fleet, fuel, and toll operations. Every
    endpoint is scoped to the organization owning the API key. Authentication:
    bearer API key (`ulk_<prefix>_<secret>`). Rate limit: 60 requests/minute/key
    by default (override per key via the dashboard).
  contact:
    name: United Logistics Engineering
    email: sfuentes@assetmg.tech
servers:
  - url: https://app.unitedlogistics.com.do/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /paso-rapido/tags:
    post:
      tags:
        - Paso Rápido
      summary: Create a tag assignment
      description: >-
        Creates a tag assignment. When `has_gps` is true, `vehicle_external_id`
        is required; otherwise `vehicle_title` and `vehicle_license_plate` are
        required. `tag_number` is unique per organization.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTagRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTagResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateTagRequest:
      type: object
      properties:
        tag_number:
          type: integer
          exclusiveMinimum: 0
        has_gps:
          type: boolean
          description: Whether the assigned vehicle is GPS-tracked. Defaults to true.
        vehicle_external_id:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
          description: >-
            External id of the GPS vehicle (maps to `vehicle_id`). Required when
            `has_gps` is true.
        vehicle_title:
          type:
            - string
            - 'null'
          maxLength: 200
          description: >-
            Free-text label for a non-GPS vehicle. Required when `has_gps` is
            false.
        vehicle_license_plate:
          type:
            - string
            - 'null'
          maxLength: 50
          description: >-
            License plate for a non-GPS vehicle. Required when `has_gps` is
            false.
        category:
          type: integer
          minimum: 1
          maximum: 5
        assignment_category:
          type:
            - string
            - 'null'
          maxLength: 200
        type:
          type: string
          enum:
            - corporativo
            - prepago
        date:
          type: string
          description: Assignment date (YYYY-MM-DD).
        issued_at:
          type:
            - string
            - 'null'
        expires_at:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - Valido
            - Inhabilitado
          description: Defaults to `Valido`.
        notes:
          type:
            - string
            - 'null'
      required:
        - tag_number
        - category
        - type
        - date
    CreateTagResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Tag'
      required:
        - data
    ErrorObject:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: unauthorized
            message:
              type: string
              example: Missing Authorization header.
            details: {}
          required:
            - code
            - message
      required:
        - error
    Tag:
      type: object
      properties:
        id:
          type: integer
        org_id:
          type: string
          format: uuid
        tag_number:
          type: integer
        has_gps:
          type: boolean
        vehicle_external_id:
          type:
            - integer
            - 'null'
          description: >-
            External id of the GPS vehicle (legacy `vehicle_id`). Null for
            non-GPS tags.
        vehicle_title:
          type:
            - string
            - 'null'
        vehicle_license_plate:
          type:
            - string
            - 'null'
        category:
          type: integer
        assignment_category:
          type:
            - string
            - 'null'
        type:
          type: string
        date:
          type: string
        issued_at:
          type:
            - string
            - 'null'
        expires_at:
          type:
            - string
            - 'null'
        status:
          type: string
        notes:
          type:
            - string
            - 'null'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - org_id
        - tag_number
        - has_gps
        - vehicle_external_id
        - vehicle_title
        - vehicle_license_plate
        - category
        - assignment_category
        - type
        - date
        - issued_at
        - expires_at
        - status
        - notes
        - created_at
        - updated_at
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: ulk_<prefix>_<secret>
      description: >-
        Authorization: Bearer ulk_<prefix>_<secret>. Cree la clave en
        Configuración → API.

````