# API Clients

Operations for the API Clients service collection.

7 operations in this service collection.

## Operations

- **CreateAPIClient** (POST `/api-clients/entities/api-clients/v1`) — Create new API Client.
- **DeleteAPIClients** (DELETE `/api-clients/entities/api-clients/v1`) — Delete existing API Client(s) based on API Client ID(s) provided as request parameter(s) 'ids'.
- **GetAccessibleScopes** (GET `/api-clients/entities/accessible-scopes/v1`) — Get all available scopes for customer.
- **GetAllAPIClientIdsForCustomer** (GET `/api-clients/queries/api-clients/v1`) — Get All API client ID(s) for customer.
- **GetAPIClients** (GET `/api-clients/entities/api-clients/v1`) — Get API Client(s) based on API Client ID(s) provided as request parameter(s) 'ids'.
- **ResetAPIClientSecret** (POST `/api-clients/entities/api-clients-actions/v1`) — Reset existing API Client(s)'s secret based on API Client ID(s) provided as request parameter(s) 'ids'.
- **UpdateAPIClient** (PATCH `/api-clients/entities/api-clients/v1`) — Update existing API Client based on API Client ID provided as request parameter 'ids'.

---

## CreateAPIClient

Create new API Client.

**POST** `/api-clients/entities/api-clients/v1`
**Scope:** Api Client Mgmt: WRITE

### Parameters

- **description** (body string)
- **is_confidential** (body boolean)
- **name** (body string)
- **redirect_uris** (body array)
- **scopes** (body array)
- **type** (body string)

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.create_api_client(description="string",
                                    name="string",
                                    scopes=id_list)
print(response)
```

### Response

```json
{}
```

---

## DeleteAPIClients

Delete existing API Client(s) based on API Client ID(s) provided as request parameter(s) 'ids'.

**DELETE** `/api-clients/entities/api-clients/v1`
**Scope:** Api Client Mgmt: WRITE

### Parameters

- **ids** (query array) — The API Client ID(s) for which API Client(s) have to be deleted.

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.delete_api_clients(ids=id_list)
print(response)
```

### Response

```json
{
  "errors": [
    {
      "code": 0,
      "id": "string",
      "message": "string"
    }
  ],
  "meta": {
    "pagination": {
      "limit": 0,
      "offset": 0,
      "total": 0
    },
    "powered_by": "string",
    "query_time": 0.0,
    "trace_id": "string",
    "writes": {
      "resources_affected": 0
    }
  },
  "resources": {}
}
```

---

## GetAccessibleScopes

Get all available scopes for customer.

**GET** `/api-clients/entities/accessible-scopes/v1`
**Scope:** Api Client Mgmt: READ

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

response = falcon.get_accessible_scopes()
print(response)
```

### Response

```json
[
  {
    "action": "string",
    "group": "string",
    "id": "string"
  }
]
```

---

## GetAllAPIClientIdsForCustomer

Get All API client ID(s) for customer.

**GET** `/api-clients/queries/api-clients/v1`
**Scope:** Api Client Mgmt: READ

### Parameters

- **offset** (query integer) — Starting index of overall result set from which to return ids.
- **limit** (query integer) — Number of ids to return.
- **sort** (query string) — Possible values for sort by field includes id, name, created_by, updated_by, created_timestamp, last_modified. Ex: 'name|asc', 'name|desc', etc.

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

response = falcon.get_all_api_client_ids_for_customer(offset=integer,
                                                      limit=integer,
                                                      sort="string")
print(response)
```

### Response

```json
[
  "string"
]
```

---

## GetAPIClients

Get API Client(s) based on API Client ID(s) provided as request parameter(s) 'ids'.

**GET** `/api-clients/entities/api-clients/v1`
**Scope:** Api Client Mgmt: READ

### Parameters

- **ids** (query array) — The API Client ID(s) for which to obtain API Client definition(s).

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.get_api_clients(ids=id_list)
print(response)
```

### Response

```json
{}
```

---

## ResetAPIClientSecret

Reset existing API Client(s)'s secret based on API Client ID(s) provided as request parameter(s) 'ids'.

**POST** `/api-clients/entities/api-clients-actions/v1`
**Scope:** Api Client Mgmt: WRITE

### Parameters

- **ids** (query array) — The API Client ID(s) for which to perform action on API Client(s).
- **action_name** (query string) — Action to perform as part of API Client update. Only allowed value is 'reset_secret'.

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.reset_api_client_secret(ids=id_list, action_name="string")
print(response)
```

### Response

```json
{}
```

---

## UpdateAPIClient

Update existing API Client based on API Client ID provided as request parameter 'ids'.

**PATCH** `/api-clients/entities/api-clients/v1`
**Scope:** Api Client Mgmt: WRITE

### Parameters

- **description** (body string)
- **is_confidential** (body boolean)
- **name** (body string)
- **redirect_uris** (body array)
- **scopes** (body array)
- **type** (body string)
- **ids** (query string) — The API Client ID for which to update the API Client definition.

### Example (Python)

```python
from falconpy import APIClients

falcon = APIClients(client_id=CLIENT_ID,
                    client_secret=CLIENT_SECRET
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.update_api_client(ids=id_list,
                                    description="string",
                                    name="string",
                                    scopes=id_list)
print(response)
```

### Response

```json
{
  "errors": [
    {
      "code": 0,
      "id": "string",
      "message": "string"
    }
  ],
  "meta": {
    "pagination": {
      "limit": 0,
      "offset": 0,
      "total": 0
    },
    "powered_by": "string",
    "query_time": 0.0,
    "trace_id": "string",
    "writes": {
      "resources_affected": 0
    }
  }
}
```
