---
title: "Assign entities to an attribute"
url: "https://developers.vzconnect.com/apis/attribute-api/versions/5171af26-732a-43bc-84a1-1d89d361a339/operations/assignEntitiesToAttribute"
---

> Full API specification: https://developers.vzconnect.com/apis/attribute-api/versions/5171af26-732a-43bc-84a1-1d89d361a339.md

# Assign entities to an attribute

`POST` `/attribute/v1/attributes/{attributeId}/assignments/add-items`

Operation ID: `assignEntitiesToAttribute`

Assigns entities to an attribute by linking entity-type/entity-id pairs to attribute values.

## Path parameters

- `attributeId` (string, required) - The attribute identifier — either a UUID v7 or an external identifier.

## Request body

Content types: `application/json`, `text/json`, `application/*+json`

## Responses

- `200` - Assignments created successfully.
- `400` - Invalid request body or unresolved string values.
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Attribute not found for the given identifier.
- `409` - Duplicate assignment conflict.
- `415` - Unsupported Media Type
- `422` - Invalid attribute value reference (foreign key violation).
- `429` - Too Many Requests
- `default` - Error

## OpenAPI definition

```yaml
openapi: 3.0.4
info:
  title: Attribute Api
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
paths:
  /attribute/v1/attributes/{attributeId}/assignments/add-items:
    post:
      tags:
        - Attribute API
      summary: Assign entities to an attribute
      description: Assigns entities to an attribute by linking entity-type/entity-id
        pairs to attribute values.
      operationId: assignEntitiesToAttribute
      parameters:
        - name: attributeId
          in: path
          description: The attribute identifier — either a UUID v7 or an external
            identifier.
          required: true
          schema:
            maxLength: 96
            minLength: 3
            pattern: ^(^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$|^(?=.{3,96}$)[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+$)$
            type: string
      requestBody:
        description: Collection of entity assignments (1-10,000 items).
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignEntitiesToAttributeInputDto"
          text/json:
            schema:
              $ref: "#/components/schemas/AssignEntitiesToAttributeInputDto"
          application/*+json:
            schema:
              $ref: "#/components/schemas/AssignEntitiesToAttributeInputDto"
      responses:
        "200":
          description: Assignments created successfully.
          content:
            text/plain:
              schema:
                $ref: "#/components/schemas/AssignEntitiesToAttributeOutputDto"
            application/json:
              schema:
                $ref: "#/components/schemas/AssignEntitiesToAttributeOutputDto"
            text/json:
              schema:
                $ref: "#/components/schemas/AssignEntitiesToAttributeOutputDto"
        "400":
          description: Invalid request body or unresolved string values.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "401":
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "403":
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "404":
          description: Attribute not found for the given identifier.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "409":
          description: Duplicate assignment conflict.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "415":
          description: Unsupported Media Type
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "422":
          description: Invalid attribute value reference (foreign key violation).
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        "429":
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
        default:
          description: Error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/VerizonProblemDetails"
security:
  - STS: []
components:
  schemas:
    AssignEntitiesToAttributeInputDto:
      required:
        - items
      type: object
      properties:
        items:
          maxItems: 1000
          minItems: 1
          type: array
          items:
            $ref: "#/components/schemas/EntityAssignmentItemDto"
          description: Collection of entity assignments. Minimum 1, maximum 10,000 items
            per request.
      additionalProperties: false
      description: Input DTO for the assign entities to attribute endpoint.
    AssignEntitiesToAttributeOutputDto:
      required:
        - items
      type: object
      properties:
        items:
          maxItems: 1000
          minItems: 1
          type: array
          items:
            $ref: "#/components/schemas/AssignmentOutputItemDto"
          description: Collection of created assignments.
      additionalProperties: false
      description: Output DTO for the assign entities to attribute endpoint.
    VerizonProblemDetails:
      type: object
      properties:
        type:
          maxLength: 65519
          minLength: 0
          pattern: ^.{0,}$
          type: string
          description: A URI reference that identifies the problem type.
          format: uri-reference
          nullable: true
          example: string
        title:
          maxLength: 65519
          minLength: 0
          pattern: ^.{0,}$
          type: string
          description: A short, human-readable summary of the problem type.
          nullable: true
          example: string
        status:
          maximum: 599
          minimum: 300
          type: integer
          description: The HTTP status code generated by the origin server for this
            occurrence of the problem.
          format: int32
          nullable: true
        detail:
          maxLength: 65519
          minLength: 0
          pattern: ^.{0,}$
          type: string
          description: A human-readable explanation specific to this occurrence of the
            problem.
          nullable: true
          example: string
        instance:
          maxLength: 65519
          minLength: 0
          pattern: ^.{0,}$
          type: string
          description: A URI reference that identifies the specific occurrence of the
            problem. It may or may not yield further information if
            dereferenced.
          nullable: true
          example: string
        debugId:
          maxLength: 2048
          minLength: 3
          pattern: ^.{0,}$
          type: string
          description: A unique error identifier string generated on the service-side and
            logged for correlation purposes. Verizon extension to RFC 9457.
          nullable: true
          example: string
        errors:
          maxItems: 1000
          minItems: 0
          type: array
          items:
            $ref: "#/components/schemas/ProblemError"
          description: List of errors. Verizon extension to RFC 9457.
          nullable: true
      additionalProperties: false
      description: A machine-readable format for specifying errors in HTTP API
        responses based on RFC 9457. Responses include the Verizon extension
        field 'debugId' — a unique error identifier generated server-side and
        logged for correlation (maps to x-request-id / Correlation-Id header).
    EntityAssignmentItemDto:
      required:
        - entityId
        - entityType
        - stringValue
      type: object
      properties:
        entityType:
          minLength: 1
          enum:
            - Vehicle
            - Driver
            - PoweredAsset
            - NonPoweredAsset
          type: string
          description: "The type of entity being assigned. Accepted values: vehicle,
            driver, powered_asset, non_powered_asset."
          example: vehicle
        entityId:
          maxLength: 36
          pattern: ^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$
          type: string
          description: The identifier of the entity being assigned.
          format: uuid
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        stringValue:
          maxLength: 30
          minLength: 1
          pattern: ^(?=.*[a-zA-Z0-9])[a-zA-Z0-9 \-_:]{1,30}$
          type: string
          description: The human-readable attribute value string to assign. Resolved to an
            internal attribute_value_id.
          example: North
      additionalProperties: false
      description: DTO representing a single entity assignment item.
    AssignmentOutputItemDto:
      required:
        - assignmentId
        - entityId
        - entityType
        - stringValue
      type: object
      properties:
        assignmentId:
          maxLength: 36
          pattern: ^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$
          type: string
          description: Unique identifier for the assignment (UUID v7).
          format: uuid
          example: 019462a1-d9e5-7bcd-ac34-6a7b8c9d0e1f
        entityType:
          enum:
            - Vehicle
            - Driver
            - PoweredAsset
            - NonPoweredAsset
          type: string
          description: The type of entity assigned.
          example: Vehicle
        entityId:
          maxLength: 36
          pattern: ^[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}$
          type: string
          description: The identifier of the entity assigned.
          format: uuid
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        stringValue:
          maxLength: 30
          minLength: 1
          pattern: ^(?=.*[a-zA-Z0-9])[a-zA-Z0-9 \-_:]{1,30}$
          type: string
          description: The human-readable attribute value string.
          example: North
      additionalProperties: false
      description: DTO representing a single created assignment in the response.
    ProblemError:
      type: object
      properties:
        detail:
          maxLength: 65519
          minLength: 0
          pattern: ^.{0,}$
          type: string
          description: A human-readable explanation of this error.
          nullable: true
          example: string
        pointer:
          maxLength: 2048
          minLength: 1
          pattern: ^.{0,}$
          type: string
          description: A pointer to locate the problem within the request's content using
            a JSON Pointer. Verizon extension to RFC 9457.
          nullable: true
          example: string
        debugId:
          maxLength: 2048
          minLength: 3
          pattern: ^.{0,}$
          type: string
          description: A unique error identifier string generated on the service-side and
            logged for correlation purposes. Verizon extension to RFC 9457.
          nullable: true
          example: string
      additionalProperties: false
  securitySchemes:
    STS:
      type: http
      description: Please enter '{token}'
      scheme: bearer
      bearerFormat: JWT
```
