---
title: Importing and Exporting via the API
---

## Importing and Exporting via the API

This page describes how to use the import and export features through the API. To make requests to the endpoints below the client making the requests must have the correct access rights.

For more information see the swagger docs on the API at `/swagger`.

## Exporting All Clients

To export all clients in the system, use the following configuration

* URL: `/clients/export`
  
* Http Method: `POST`

* Content type: `application/vnd.adminui.export-clients-v1+json`

* Return type: `export-clients-v1+json`

## Exporting Specific Clients

To export only a specific set of clients, use the following configuration

* URL: `/clients/export/specified`
  
* Http Method: `POST`

* Content type: `export-specified-clients-v1+json`

* Return type: `export-clients-v1+json`

* Parameters: 
    * `clientIds` (Required) Form data value the name of the value is `clientIds` and the value is a comma separated list of client ids that will be exported

## Import Validation

To validate your import use the following configuration:

* Http Method: `POST`

* Content type: `application/vnd.adminui.import-clients-validation-v1+json`

* Return type: `application/vnd.adminui.import-clients-validation-result-v1+json`

* URL: `http://localhost:5001/clients/import/validate`

An example model can be found in the export documentation [here](Export.md)

## Complete an Import

To complete import after validation use the following configuration

* Http Method: `POST`

* Content type: `application/vnd.adminui.import-clients-v1+json`

* URL: `http://localhost:5001/clients/import`

The request body will be the same as the previous model with an appended section for the import configuration.

```{
"importConfiguration":{
    "clients":[
        {
            "ResourceId":"a46cfa01b4704f16a9fec1cd6cc4b015"
        }
    ],
    "protectedResources":[

    ]
}
```