> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/dynamic-lookup-table-api/create-attribute-library-entry.md).

# Create attribute library entry

Create an entry (attribute) inside an existing attribute library group. An entry has a name, a data type, a list of predefined values and a usage.

Create the group first with Create attribute library group, then pass the group's `data.id` here as `moduleId`.

## Create attribute library entry

> Create an entry (attribute) inside an existing attribute library group.\
> \
> \*\*Before you call this:\*\* create the group with \*\*Create attribute library group\*\* and copy its \`data.id\`. Pass it as \`moduleId\`.\
> \
> \*\*Required fields:\*\* \`name\`, \`dataType\`, \`moduleId\`, \`options\` and \`usageType\`.\
> \
> \*\*\`options\`:\*\* the predefined values of the entry. Each value is an object with a \`value\` key.\
> \
> \*\*\`data.id\`, \`data.checksum\`:\*\* on success, \`data.id\` is the new entry's ID and \`data.checksum\` is its checksum. You need both to update the entry.\
> \
> \*\*Note:\*\* after an entry is created, only its values and usage can be changed — not its \`name\` or \`dataType\`.

```json
{"openapi":"3.0.3","info":{"title":"Nected Dynamic Lookup Table API (Attribute Library, Dev V1)","version":"1.0"},"tags":[{"name":"Dynamic Lookup Table API (Attribute Library)","description":"The Dynamic Lookup Table API lets you list, create, read and update **attribute library groups** (lookup tables) in your workspace. Each group holds one or more **attributes**, and each attribute has a name, a data type, a list of predefined values and a usage.\n\nUse it to update lookup values in bulk, sync them from your systems of record, or promote them between environments in CI/CD. For a no-code walkthrough, see Dynamic Lookup Tables (Attribute Library).\n\n**Entity type:** all paths use the entity type `module`.\n\n**Supported operations:** list, create, get and update only. Publish, test, schedule and version listing are not available for attribute libraries.\n\n**Update rules:** after an attribute is created, you can change its predefined values and usage. You can't change its name or data type, the same as in the UI.\n\n**Data types:** `String`, `Numeric`, `Date`, `DateTime`, `Boolean`, `List`, `JSON`.\n\n## Why use the API?\n\nUse the API when you need:\n\n* **Bulk updates** (large value lists in one or a few calls)\n* **Automated sync** from your systems of record\n* **CI/CD / environment promotion** of lookup values\n* **Programmatic governance** with controlled access and auditability\n\n## How it works\n\nAttribute libraries are created in two steps:\n\n1. **Create the group** with `POST /dev/v1/module`. The response returns the group's `id`.\n2. **Create the entries inside the group** with `POST /dev/v1/module_schema`, passing the group's `id` as `moduleId`.\n\nTo change things later, use `PATCH /dev/v1/module/{entity-id}` to rename the group or change its description, and `PATCH /dev/v1/module_schema/{entity-id}` to change the values or usage of an entry. Both need the current `checksum`."}],"servers":[{"url":"https://api.nected.ai","description":"Production"}],"security":[{"DevAuth":[]}],"components":{"securitySchemes":{"DevAuth":{"type":"apiKey","in":"header","name":"Nected-API-Key","description":"Your Nected API key. Obtain from your workspace settings."}},"schemas":{"CreateAttributeEntryPayload":{"type":"object","required":["name","dataType","moduleId","options","usageType"],"properties":{"name":{"type":"string","description":"Name of the entry. Can't be changed after creation."},"dataType":{"type":"string","description":"Data type of the entry. Can't be changed after creation."},"moduleId":{"type":"string","description":"ID of the group to add the entry to (`data.id` from **Create attribute library group**)"},"options":{"type":"array","description":"The predefined values of the entry","items":{"$ref":"#/components/schemas/AttributeOption"}},"usageType":{"type":"string","description":"Whether the entry is required"}}},"AttributeOption":{"type":"object","description":"One predefined value","properties":{"value":{"description":"The value"}}},"CreateResponse":{"type":"object","description":"Success response for create calls","properties":{"code":{"type":"string"},"message":{"type":"string"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Entity ID of the created group or entry"},"checksum":{"type":"string","description":"Checksum of the created group or entry — required for the next update"}}}}},"ErrorResponse":{"type":"object","description":"Error response wrapper","properties":{"code":{"type":"string"},"message":{"type":"string","description":"Human-readable error message"},"data":{"nullable":true}}}},"responses":{"BadRequest":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/dev/v1/module_schema":{"post":{"operationId":"createAttributeEntry","tags":["Dynamic Lookup Table API (Attribute Library)"],"summary":"Create attribute library entry","description":"Create an entry (attribute) inside an existing attribute library group.\n\n**Before you call this:** create the group with **Create attribute library group** and copy its `data.id`. Pass it as `moduleId`.\n\n**Required fields:** `name`, `dataType`, `moduleId`, `options` and `usageType`.\n\n**`options`:** the predefined values of the entry. Each value is an object with a `value` key.\n\n**`data.id`, `data.checksum`:** on success, `data.id` is the new entry's ID and `data.checksum` is its checksum. You need both to update the entry.\n\n**Note:** after an entry is created, only its values and usage can be changed — not its `name` or `dataType`.","parameters":[{"name":"Nected-Branch","in":"header","required":false,"description":"Branch name (optional)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttributeEntryPayload"}}}},"responses":{"201":{"description":"Created — `data.id` is the new entry's ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

### Request body

| Field       | Type   | Required | Description                                                                                             |
| ----------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- |
| `name`      | string | Yes      | Name of the entry, for example `OrderStatus`.                                                           |
| `dataType`  | string | Yes      | Data type of the entry, for example `string`.                                                           |
| `moduleId`  | string | Yes      | ID of the group to add the entry to (`data.id` from the create group response).                         |
| `options`   | array  | Yes      | The predefined values. Each item is an object with a `value` key, for example `{ "value": "Pending" }`. |
| `usageType` | string | Yes      | Whether the entry is required, for example `optional`.                                                  |

{% hint style="info" %}
You can't change an entry's `name` or `dataType` after it's created, so check them before you send the request. Only its values and usage can be updated later.
{% endhint %}
