# 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 %}
