> For the complete documentation index, see [llms.txt](https://docs.terrakube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terrakube.io/api/methods/collection-item.md).

# Collection Item

This endpoint is used to manager collection item for a collection inside the organization

### Entity fields:

| Path                                    | Type    | Description            |
| --------------------------------------- | ------- | ---------------------- |
| data.type                               | string  | Should be "step"       |
| data.attributes.category                | string  | Collection description |
| data.attributes.description             | string  | Collection name        |
| data.attributes.hcl                     | int     | Collection priority    |
| data.attribute.key                      | string  | Collection item name   |
| data.attributes.value                   | string  | Collection item value  |
| <p>data.attributes.s</p><p>ensitive</p> | boolean | Values is sensitive    |

### Example

```json
POST /api/v1/organization/${ORGANIZATION_ID}/collection/"${COLLECTION_ID}/item/

{
    "data": {
        "type": "item",
        "attributes": {
            "category": "ENV",
            "description": "random_description",
            "hcl": false,
            "key": "random_key",
            "sensitive": true
        }
}
```

### Supported Operations

## GET /organization/{organizationId}/collection/{collectionId}/item

> Returns the relationship item

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"item"}],"servers":[{"url":"/api/v1"}],"paths":{"/organization/{organizationId}/collection/{collectionId}/item":{"get":{"tags":["item"],"description":"Returns the relationship item","parameters":[{"name":"sort","in":"query","description":"Sorts the collection on the selected attributes.  A prefix of '-' sorts descending","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["description","-description","hcl","-hcl","key","-key","sensitive","-sensitive","value","-value","id","-id"]}}},{"name":"fields[item]","in":"query","description":"Selects the set of item fields that should be returned in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["category","description","hcl","key","sensitive","value","collection"]}}},{"name":"include","in":"query","description":"Selects the set of relationships that should be expanded as a compound document in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["collection"]}}},{"name":"filter[item]","in":"query","description":"Filters the collection of item using a 'disjoint' RSQL expression","schema":{"type":"string"}},{"name":"page[number]","in":"query","description":"Number of pages to return.  Can be used with page[size]","schema":{"type":"integer","format":"int32"}},{"name":"page[size]","in":"query","description":"Number of elements per page.  Can be used with page[number]","schema":{"type":"integer","format":"int32"}},{"name":"page[offset]","in":"query","description":"Offset from 0 to start paginating.  Can be used with page[limit]","schema":{"type":"integer","format":"int32"}},{"name":"page[limit]","in":"query","description":"Maximum number of items to return.  Can be used with page[offset]","schema":{"type":"integer","format":"int32"}},{"name":"page[totals]","in":"query","description":"For requesting total pages/records be included in the response page meta data","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/item"}},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}}}}}},"components":{"schemas":{"item":{"type":"object","properties":{"type":{"type":"string","description":""},"id":{"type":"string"},"attributes":{"type":"object","properties":{"category":{"type":"string","readOnly":false,"writeOnly":false,"enum":["TERRAFORM","ENV"]},"description":{"type":"string","readOnly":false,"writeOnly":false},"hcl":{"type":"boolean","readOnly":false,"writeOnly":false},"key":{"type":"string","readOnly":false,"writeOnly":false},"sensitive":{"type":"boolean","readOnly":false,"writeOnly":false},"value":{"type":"string","description":"Read Permissions : (user read collection)","readOnly":false,"writeOnly":false}}},"relationships":{"type":"object","properties":{"collection":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["collection"]},"id":{"type":"string"}},"readOnly":false,"writeOnly":false}}}}}}}}}}}
```

## POST /organization/{organizationId}/collection/{collectionId}/item

> Creates an item of type item and adds it to item

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"item"}],"servers":[{"url":"/api/v1"}],"paths":{"/organization/{organizationId}/collection/{collectionId}/item":{"post":{"tags":["item"],"description":"Creates an item of type item and adds it to item","requestBody":{"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/item"},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}},"responses":{"201":{"description":"Successful response","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/item"},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}}}}}},"components":{"schemas":{"item":{"type":"object","properties":{"type":{"type":"string","description":""},"id":{"type":"string"},"attributes":{"type":"object","properties":{"category":{"type":"string","readOnly":false,"writeOnly":false,"enum":["TERRAFORM","ENV"]},"description":{"type":"string","readOnly":false,"writeOnly":false},"hcl":{"type":"boolean","readOnly":false,"writeOnly":false},"key":{"type":"string","readOnly":false,"writeOnly":false},"sensitive":{"type":"boolean","readOnly":false,"writeOnly":false},"value":{"type":"string","description":"Read Permissions : (user read collection)","readOnly":false,"writeOnly":false}}},"relationships":{"type":"object","properties":{"collection":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["collection"]},"id":{"type":"string"}},"readOnly":false,"writeOnly":false}}}}}}}}}}}
```

## GET /organization/{organizationId}/collection/{collectionId}/item/{itemId}

> Returns an instance of type item

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"item"}],"servers":[{"url":"/api/v1"}],"paths":{"/organization/{organizationId}/collection/{collectionId}/item/{itemId}":{"get":{"tags":["item"],"description":"Returns an instance of type item","parameters":[{"name":"fields[item]","in":"query","description":"Selects the set of item fields that should be returned in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["category","description","hcl","key","sensitive","value","collection"]}}},{"name":"include","in":"query","description":"Selects the set of relationships that should be expanded as a compound document in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["collection"]}}}],"responses":{"200":{"description":"Successful response","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/item"},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}}}}}},"components":{"schemas":{"item":{"type":"object","properties":{"type":{"type":"string","description":""},"id":{"type":"string"},"attributes":{"type":"object","properties":{"category":{"type":"string","readOnly":false,"writeOnly":false,"enum":["TERRAFORM","ENV"]},"description":{"type":"string","readOnly":false,"writeOnly":false},"hcl":{"type":"boolean","readOnly":false,"writeOnly":false},"key":{"type":"string","readOnly":false,"writeOnly":false},"sensitive":{"type":"boolean","readOnly":false,"writeOnly":false},"value":{"type":"string","description":"Read Permissions : (user read collection)","readOnly":false,"writeOnly":false}}},"relationships":{"type":"object","properties":{"collection":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["collection"]},"id":{"type":"string"}},"readOnly":false,"writeOnly":false}}}}}}}}}}}
```

## DELETE /organization/{organizationId}/collection/{collectionId}/item/{itemId}

> Deletes an instance of type item

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"item"}],"servers":[{"url":"/api/v1"}],"paths":{"/organization/{organizationId}/collection/{collectionId}/item/{itemId}":{"delete":{"tags":["item"],"description":"Deletes an instance of type item","responses":{"204":{"description":"Successful response"}}}}}}
```

## PATCH /organization/{organizationId}/collection/{collectionId}/item/{itemId}

> Modifies an instance of type item

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"item"}],"servers":[{"url":"/api/v1"}],"paths":{"/organization/{organizationId}/collection/{collectionId}/item/{itemId}":{"patch":{"tags":["item"],"description":"Modifies an instance of type item","requestBody":{"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/item"},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}},"responses":{"204":{"description":"Successful response"}}}}},"components":{"schemas":{"item":{"type":"object","properties":{"type":{"type":"string","description":""},"id":{"type":"string"},"attributes":{"type":"object","properties":{"category":{"type":"string","readOnly":false,"writeOnly":false,"enum":["TERRAFORM","ENV"]},"description":{"type":"string","readOnly":false,"writeOnly":false},"hcl":{"type":"boolean","readOnly":false,"writeOnly":false},"key":{"type":"string","readOnly":false,"writeOnly":false},"sensitive":{"type":"boolean","readOnly":false,"writeOnly":false},"value":{"type":"string","description":"Read Permissions : (user read collection)","readOnly":false,"writeOnly":false}}},"relationships":{"type":"object","properties":{"collection":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["collection"]},"id":{"type":"string"}},"readOnly":false,"writeOnly":false}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.terrakube.io/api/methods/collection-item.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
