# Add a customizable ID for package policy

**URL:** <https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [July 5, 2023, 3:01pm UTC](https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690 "2023-07-05T15:01:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bearloggs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bearloggs/32/127052_2.png) [@Bearloggs](https://discuss.elastic.co/u/Bearloggs)\
**Post date:** [July 5, 2023, 3:01pm UTC](https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690/1 "2023-07-05T15:01:13Z")

</div>

Hello,

I am trying to create a policy package using the Kibana Dev Tools and I wondered if it was possible to apply a unique customizable ID.

For example, I want to create osquery manager package policy with ID "osquery\_manager\_1".

Request :

```auto
POST kbn:/api/fleet/package_policies
{
  "policy_id": "agent_policy",
  "package": {
    "name": "osquery_manager",
    "version": "1.5.1"
  },
  "name": "osquery_manager_1",
  "id": "osquery_manager_1"
  "description": "osquery manager",
  "namespace": "default",
  "inputs": {
    "osquery_manager-osquery": {
      "enabled": true,
      "streams": {
        "osquery_manager.result": {
          "enabled": true,
          "vars": {}
        }
      }
    }
  }
}

```

I have the following response :

```auto
{
  "item": {
    **"id": "9de387f0-1b78-11ee-998e-a17c25uif75e"** ,
    "version": "WzTwVywxXQ==",
    "name": "osquery_manager_1",
    "namespace": "default",
    "description": "osquery manager",
    "package": {
      "name": "osquery_manager",
      "title": "Osquery Manager",
      "version": "1.5.1"
    },
    "enabled": true,
    "policy_id": "agent_policy",
    "inputs": [
      {
        "type": "osquery",
        "policy_template": "osquery_manager",
        "enabled": true,
        "streams": [
          {
            "enabled": true,
            "data_stream": {
              "type": "logs",
              "dataset": "osquery_manager.result"
            },
            "vars": {
              "query": {
                "type": "text"
              },
              "interval": {
                "type": "text"
              },
              "id": {
                "type": "text"
              },
              "platform": {
                "type": "text"
              },
              "version": {
                "type": "text"
              }
            },
            "id": "osquery-osquery_manager.result-9de387f0-1b78-11ee-998e-a17c25uif75e",
            "compiled_stream": {
              "query": null,
              "id": null
            }
          }
        ]
      }
    ],
    "revision": 1,
    "created_at": "2023-07-05T14:52:50.518Z",
    "created_by": "elastic",
    "updated_at": "2023-07-05T14:52:50.518Z",
    "updated_by": "elastic"
  }
}

```

As you can see the ID is a random set of numbers and not my ID "osquery\_manager\_1".

So is it possible to customize the ID of a package policy?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![nchaulet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nchaulet/32/77896_2.png) [@nchaulet](https://discuss.elastic.co/u/nchaulet)\
**Post date:** [July 5, 2023, 8:33pm UTC](https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690/2 "2023-07-05T20:33:31Z")

</div>

Hi @Bearloggs

It seems it's a bug in our package policy API, I just created an issue so we can work on fixing that [[Fleet] POST package policy api id field is not honoured · Issue #161303 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/161303)

---

<div class="post-metadata">

**Author:** ![Bearloggs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bearloggs/32/127052_2.png) [@Bearloggs](https://discuss.elastic.co/u/Bearloggs)\
**Post date:** [July 5, 2023, 8:58pm UTC](https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690/3 "2023-07-05T20:58:05Z")

</div>

Thanks for your help !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2023, 8:58pm UTC](https://discuss.elastic.co/t/add-a-customizable-id-for-package-policy/337690/4 "2023-08-02T20:58:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
