> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/api/en/api-reference/scim.md).

# SCIM

SCIM 2.0 endpoints let your identity provider (Entra ID, Okta, etc.) automatically provision, update, and deactivate organization members. The base URL is `https://api.maiagent.ai/api/v1/scim/{orgUuid}`, with no trailing `/`. Authentication uses `Authorization: Bearer <SCIM Token>` (obtained from the identity synchronization settings in the admin console, rather than an API Key), with `Content-Type: application/scim+json` and a limit of 100 requests per minute per organization. For field mappings and deactivation semantics, see [Member Provisioning](https://docs.maiagent.ai/tech/authorization-integration/member-provisioning) in the technical manual.

### Get Service Provider Configuration (for IdP Discovery) <a href="#scim-service-provider-config-retrieve" id="scim-service-provider-config-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/ServiceProviderConfig`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig", config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/ServiceProviderConfig", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### List or Query Members (Supports \`filter\`, \`startIndex\`, and \`count\`) <a href="#scim-users-retrieve" id="scim-users-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/Users`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Create Member <a href="#scim-users-create" id="scim-users-create"></a>

POST `/api/v1/scim/{orgUuid}/Users`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request Body (payload)
const data = null;

axios.post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.post(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Get a Specific Member <a href="#scim-users-retrieve2" id="scim-users-retrieve2"></a>

GET `/api/v1/scim/{orgUuid}/Users/{userId}`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |
| `userId`       | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Replace Member <a href="#scim-users-update" id="scim-users-update"></a>

PUT `/api/v1/scim/{orgUuid}/Users/{userId}`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |
| `userId`       | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request Body (payload)
const data = null;

axios.put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.put(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Partially Update Member (Deactivate, Rename, or Change externalId) <a href="#scim-users-partial-update" id="scim-users-partial-update"></a>

PATCH `/api/v1/scim/{orgUuid}/Users/{userId}`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |
| `userId`       | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request Body (payload)
const data = null;

axios.patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.patch(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Deactivate Member <a href="#scim-users-destroy" id="scim-users-destroy"></a>

DELETE `/api/v1/scim/{orgUuid}/Users/{userId}`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |
| `userId`       | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request Body (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.delete(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Users/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 204         | No response body |

***

### List Groups (Mapped to MaiAgent Roles) <a href="#scim-groups-retrieve" id="scim-groups-retrieve"></a>

GET `/api/v1/scim/{orgUuid}/Groups`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response Content

| Status Code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Create Group <a href="#scim-groups-create" id="scim-groups-create"></a>

POST `/api/v1/scim/{orgUuid}/Groups`

#### Parameters

| Parameter Name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `orgUuid`      | ✅        | string |             |

#### Code Examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API Call Example (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set Request Headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request Body (payload)
const data = null;

axios.post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.post(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response body

| Status code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Retrieve a specific group <a href="#scim-groups-retrieve2" id="scim-groups-retrieve2"></a>

GET `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### Parameters

| Parameter name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `groupId`      | ✅        | string |             |
| `orgUuid`      | ✅        | string |             |

#### Code examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API call example (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set request headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

axios.get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.get(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response body

| Status code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Replace a group <a href="#scim-groups-update" id="scim-groups-update"></a>

PUT `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### Parameters

| Parameter name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `groupId`      | ✅        | string |             |
| `orgUuid`      | ✅        | string |             |

#### Code examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API call example (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set request headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request body (payload)
const data = null;

axios.put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.put(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response body

| Status code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Partially update a group (rename, add or remove members) <a href="#scim-groups-partial-update" id="scim-groups-partial-update"></a>

PATCH `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### Parameters

| Parameter name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `groupId`      | ✅        | string |             |
| `orgUuid`      | ✅        | string |             |

#### Code examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API call example (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set request headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request body (payload)
const data = null;

axios.patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.patch(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response body

| Status code | Description      |
| ----------- | ---------------- |
| 200         | No response body |

***

### Delete a group <a href="#scim-groups-destroy" id="scim-groups-destroy"></a>

DELETE `/api/v1/scim/{orgUuid}/Groups/{groupId}`

#### Parameters

| Parameter name | Required | Type   | Description |
| -------------- | -------- | ------ | ----------- |
| `groupId`      | ✅        | string |             |
| `orgUuid`      | ✅        | string |             |

#### Code examples

{% tabs %}
{% tab title="Shell/Bash" %}

```bash
# API call example (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_SCIM_TOKEN"

# Replace YOUR_API_KEY and verify the request data before running.
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

// Set request headers
const config = {
  headers: {
    'Authorization': 'Bearer YOUR_SCIM_TOKEN'
  }
};

// Request body (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", data, config)
  .then(response => {
    console.log('Response received successfully:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('Request error:');
    console.error(error.response?.data || error.message);
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000"
headers = {
    "Authorization": "Bearer YOUR_SCIM_TOKEN"
}


response = requests.delete(url, headers=headers)
try:
    print("Response received successfully:")
    print(response.json())
except Exception as e:
    print("Request error:", e)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/v1/scim/550e8400-e29b-41d4-a716-446655440000/Groups/550e8400-e29b-41d4-a716-446655440000", [
        'headers' => [
            'Authorization' => 'Bearer YOUR_SCIM_TOKEN'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "Response received successfully:\n";
    print_r($data);
} catch (Exception $e) {
    echo 'Request error: ' . $e->getMessage();
}
?>
```

{% endtab %}
{% endtabs %}

#### Response body

| Status code | Description      |
| ----------- | ---------------- |
| 204         | No response body |

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/api/en/api-reference/scim.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
