---
title: "Create attribute"
method: POST
path: "/api-offers/attributes"
tags: ["Attributes"]
---

# Create attribute

`POST /api-offers/attributes`

## Request

- Base URL: `https://live.copilot.fabric.inc`
- URL: `https://live.copilot.fabric.inc/api-offers/attributes`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/fabric/apis/offers-v2/docs/api-offers/attributes/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a attribute record.

## Headers

- `x-site-context` string, required

## Request body

- CreateAttributeRequest
  - `name` string, required: The attribute name.
  - `values` string[], required: The attribute values corresponding to the `name`.

## Response `201`

OK

- CreateAttributeResponse
  - `_id` string: A 24-character system-generated attribute ID.
  - `attributeId` number: A unique identifier of the attribute, for external use.
  - `name` string: The attribute name.
  - `values` string[]: The attribute values corresponding to the `name`.
  - `deleted` boolean: A flag indicating the deletion status of the attribute. Set it to `true` to indicate the attribute is deleted and `false` to indicate otherwise.
  - `createdAt` string, date-time: The time of attribute creation, in UTC format.
  - `updatedAt` string, date-time: The time when the attribute was last updated, in UTC format.

## Other responses

- `400`: Bad request
- `500`: Internal Server Error

---

[API](https://skmtc.dev/fabric/apis/offers-v2.md) - [All operations](https://skmtc.dev/fabric/apis/offers-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/fabric/apis/offers-v2/revisions/da2bd742b9bc?raw)
