# Credentials

## List credentials

<mark style="color:green;">`GET`</mark> /v1/organizations/credentials/list

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**QueryString**

| Name                     | Type   | Description                          |
| ------------------------ | ------ | ------------------------------------ |
| org\_id                  | string | The Organization ID                  |
| action=list\_credentials | string | The action (will not be needed soon) |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": 200,
  "credentials": [
    {
      "type": "azure|aws|gcp",
      "id": "string",
      "name": "string",
      "comments": "string",
      "resources": 0-1000,
      "last_time": "string"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Create a new credential

<mark style="color:green;">`POST`</mark> /v1/organizations/credentials/create?action=add\_credential

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th width="140">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>org_id</td><td>string</td><td>The Organization ID</td></tr><tr><td>type</td><td>string</td><td>aws / azure / gap</td></tr><tr><td>name</td><td>string</td><td>Credential Name</td></tr><tr><td>specific</td><td>Dict(string)</td><td>AWS:<br>{"role": ""}<br>Azure:<br>{"tenant": "", "clientId": "", "key": ""}<br>GCP:<br>{"project": ""}</td></tr><tr><td>comments</td><td>string</td><td>Descriptive comments</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": 200,
  "response": "Credential created"
}
```

{% endtab %}
{% endtabs %}

## Remove credential

<mark style="color:green;">`POST`</mark> `/`/v1/organizations/credentials/delete?action=remove\_credential

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name           | Type   | Description         |
| -------------- | ------ | ------------------- |
| org\_id        | string | The Organization ID |
| credential\_id | string | Credential ID       |
| comments       | string | Remove comments     |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": 200,
  "response": "Credential removed"
}
```

{% endtab %}
{% endtabs %}

## Credential update

<mark style="color:green;">`POST`</mark> /v1/organizations/credentials/update?action=update\_credential

\<Description of the endpoint>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name           | Type   | Description         |
| -------------- | ------ | ------------------- |
| org\_id        | string | The Organization ID |
| credential\_id | string |                     |
| data           | Dict   |                     |
| reason         | string |                     |

#### data:

| Name     | Type         | Description                                                                                             |
| -------- | ------------ | ------------------------------------------------------------------------------------------------------- |
| name     | string       |                                                                                                         |
| comments | string       |                                                                                                         |
| specific | Dict(string) | <p>AWS:<br>{"role": ""}<br><br>Azure:<br>{"clientId": "", "key": ""}<br><br>GCP:<br>{"project": ""}</p> |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": 200,
  "response": "Credential updated"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.cloudplans.io/api-reference/credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
