---
title: "Create Attribute"
method: POST
path: "/api/inventory/v2/schemas/{schemaName}/attributes/"
tags: ["Inventory Schema"]
---

# Create Attribute

`POST /api/inventory/v2/schemas/{schemaName}/attributes/`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/api/inventory/v2/schemas/{schemaName}/attributes/`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `INVENTORY`, `INVENTORY_WRITE`

Use this API to create an attribute for the inventory schema.

## Path parameters

- `schemaName` 'processing-activities' | 'vendors' | 'assets' | 'entities', required

## Request body

- AttributeCreateRequest
  - `name` string, required: Name of the attribute
  - `description` string, required: Description of the attribute
  - `responseType` 'text' | 'date' | 'single-select' | 'multi-select' | 'numerical-text' | 'numerical-single-select' | 'score' | 'formula', required: Response type of the attribute
  - `allowOther` boolean
  - `formula` string: Formula expression for formula-type attributes
  - `intakeQuestionKey` string: Key for the intake question
  - `question` string: Question for Attribute
  - `questionDescription` string: Question Description for Attribute
  - `context` AttributeContext
    - `parameters` object
  - `fieldName` string: Field name of the attribute (system-generated if not provided)
  - `attributeType` 'none' | 'users' | 'locations' | 'organizations' | 'vendors' | 'assets' | 'entities' | 'processing-activities' | 'statuses': Type of the attribute
  - `trackedAtRelatedInventoryType` string: Related inventory type where this attribute is tracked
  - `responseSubType` 'Standard' | 'Formula' | 'Matrix' | 'RollUp': Response sub-type for the attribute
  - `associatedAttributeRequest` AssociatedAttributeRequest
    - `associatedAttributes` AssociatedAttribute[]: Associated attributes
      - `fieldName` string: Field Name
      - `name` string, required: Attribute Name
      - `nameKey` string: Attribute Name Key. Used for Translation
      - `description` string: Attribute Description
      - `descriptionKey` string: Attribute Description Key
      - `options` AttributeOptionRequest[]: Attribute Options
        - `option` string, required: The option text to be displayed
        - `optionKey` string: Option key which can be used for translation and internationalization
        - `optionSelectionValue` string: Option selection value used to identify the option in forms or programmatic interfaces
        - `colorCode` '#000000' | '#FFFFFF' | '#FF0000' | '#00FF00' | '#0000FF': Color code in hexadecimal format for UI representation
        - `metadata` AttributeOptionMetadata
          - `hint` string: Hint
          - `hintKey` string: Hint key which can be used for translation
  - `allowLabels` boolean: Flag indicating if the attribute allows labels
  - `abacBasicAssignmentInfo` AbacAssignmentAssociation
    - `assignments` AbacBasicAssignmentInfo[]
      - `assignmentId` string, uuid: GUID of the linked assignment
      - `assignmentName` string: Name of the linked assignment
      - `policyStatus` 'INACTIVE' | 'ACTIVE' | 'PROCESSING' | 'FAILED': Policy status of the linked assignment
    - `objectType` string

## Response `201`

Created

- AttributeResponse
  - `id` string, uuid
  - `name` string
  - `fieldName` string
  - `nameKey` string: Key used for name translation
  - `description` string: Description of the attribute
  - `descriptionKey` string: Key used for description translation
  - `required` boolean: Flag indicating if the attribute is required
  - `status` 'enabled' | 'disabled': Status of the attribute
  - `attributeType` 'none' | 'users' | 'locations' | 'organizations' | 'vendors' | 'assets' | 'entities' | 'processing-activities' | 'statuses': Type of the attribute
  - `responseType` 'text' | 'date' | 'single-select' | 'multi-select' | 'numerical-text' | 'numerical-single-select' | 'score' | 'formula': Response type of the attribute
  - `readOnly` boolean: Flag indicating if the attribute is read-only
  - `seeded` boolean: Flag indicating if the attribute is seeded (system-provided)
  - `hiddenAtInventory` boolean: Flag indicating if the attribute is hidden at inventory detail view
  - `trackedAtRelatedInventoryType` string: Related inventory type where this attribute is tracked
  - `source` 'System' | 'Custom' | 'Vendorpedia': Source of the attribute
  - `dataSource` AttributeDataSourceDto
    - `Attribute Data Source Key` string, required
    - `Attribute Data Source Name` string, required
    - `Attribute Data Source Name Key for translation` string, required
  - `formula` string: Formula expression for formula-type attributes
  - `schemaName` string: Name of the schema this attribute belongs to
  - `hidden` boolean: Flag indicating if the attribute is hidden
  - `allowLabels` boolean: Flag indicating if the attribute allows labels
  - `intakeQuestionKey` string: Key for the intake question
  - `intakeQuestion` IntakeQuestion
    - `nameKey` string: Key used for intake question name translation
    - `name` string: Name of the intake question
    - `descriptionKey` string: Key used for intake question description translation
    - `description` string: Description of the intake question
  - `validationRuleId` string: ID of the validation rule applied to this attribute
  - `abacBasicAssignmentInfo` AbacAssignmentAssociation
    - `assignments` AbacBasicAssignmentInfo[]
      - `assignmentId` string, uuid: GUID of the linked assignment
      - `assignmentName` string: Name of the linked assignment
      - `policyStatus` 'INACTIVE' | 'ACTIVE' | 'PROCESSING' | 'FAILED': Policy status of the linked assignment
    - `objectType` string
  - `systemManaged` boolean: Flag indicating if the attribute is system-managed and cannot be modified
  - `responseSubType` 'Standard' | 'Formula' | 'Matrix' | 'RollUp': Sub-type of the response
  - `associatedAttributes` AssociatedAttributeResponse[]: List of associated attributes
    - `id` string, uuid
    - `name` string
    - `fieldName` string
    - `nameKey` string
    - `description` string
    - `descriptionKey` string
    - `status` string
    - `responseType` string
    - `responseSubType` 'Standard' | 'Formula' | 'Matrix' | 'RollUp'
    - `formula` string
    - `schemaName` string
    - `hidden` boolean, required
    - `readOnly` boolean
    - `Attribute options` AttributeValueResponse[]
      - `id` string: Unique identifier of the attribute value
      - `value` string: Value of the attribute option
      - `valueKey` string: Key used for value translation
      - `hint` string: Hint text for the attribute value
      - `hintKey` string: Key used for hint translation
      - `status` 'enabled' | 'disabled': Status of the attribute value
      - `seeded` boolean: Flag indicating if the attribute value is seeded (system-provided)
      - `sequence` integer: Sequence number for ordering
      - `colorCode` string: Color code for visual representation
      - `selectionValue` string: Selection value for numerical attributes

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500`: Internal Server Error

---

[API](https://skmtc.dev/onetrust/apis/privacy-automation-data-mapping-automation.md) - [All operations](https://skmtc.dev/onetrust/apis/privacy-automation-data-mapping-automation/llms.txt) - [OpenAPI document](https://skmtc.dev/onetrust/apis/privacy-automation-data-mapping-automation/revisions/daead5d9fad6?raw)
