# Use API to add custom catalog

**URL:** <https://forums.suse.com/t/use-api-to-add-custom-catalog/2324>\
**Category:** Rancher 1.x\
**Created:** [April 5, 2016, 2:35pm UTC](https://forums.suse.com/t/use-api-to-add-custom-catalog/2324 "2016-04-05T14:35:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dsvmacdonald](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dsvmacdonald](https://forums.suse.com/u/dsvmacdonald)\
**Post date:** [April 7, 2016, 11:40am UTC](https://forums.suse.com/t/use-api-to-add-custom-catalog/2324/4 "2016-04-07T11:40:40Z")

</div>

Figured it out looking from: [forum post 1](http://forums.suse.com/t/api-spec-creating-a-new-environment-project/430) and [forum post 2](http://forums.suse.com/t/how-can-i-create-registrationtoken-resource-without-navigating-web-page/1580)

Basically need to first create an admin key with something like:

> curl -X POST   
> -H ‘Accept: application/json’   
> -H ‘Content-Type: application/json’   
> -d ‘{“accountId”:“1a1”, “description”:“Scripting administration account”, “name”:“admin”, “publicValue”:“script”}’   
> ‘[http://192.168.101.128:8080/v1/apikeys](http://192.168.101.128:8080/v1/apikeys)’

Wait till it becomes active and then add the catalog with something like:

> curl -u “admin:script”   
> -X PUT   
> -H ‘Accept: application/json’   
> -H ‘Content-Type: application/json’   
> -d ‘{“activeValue”:“library=[GitHub - rancher/rancher-catalog](https://github.com/rancher/rancher-catalog.git), community=[GitHub - rancher/community-catalog: Catalog entries contributed by the community](https://github.com/rancher/community-catalog.git)”, “id”:“1as!catalog.url”, “name”:“catalog.url”, “source”:“Default Environment Variables”, “value”:“library=[GitHub - rancher/rancher-catalog](https://github.com/rancher/rancher-catalog.git), community=[GitHub - rancher/community-catalog: Catalog entries contributed by the community](https://github.com/rancher/community-catalog.git)”, newXXX=[https://XXXXX/XXXXX.git](https://XXXXX/XXXXX.git)}’   
> ‘[http://192.168.101.128:8080/v1/activesettings/1as!catalog.url](http://192.168.101.128:8080/v1/activesettings/1as!catalog.url)’

---

_[View the full topic](https://forums.suse.com/t/use-api-to-add-custom-catalog/2324)._
