# SelfApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**getSelf**](#getself) | **GET** /self | Get the current user\&#39;s profile|
|[**getSelfOrgMembership**](#getselforgmembership) | **GET** /self/organization-membership | Get the current user\&#39;s organization membership|
|[**getSelfOrganizations**](#getselforganizations) | **GET** /self/organizations | List the current user\&#39;s organizations|
|[**selfLeaveOrganization**](#selfleaveorganization) | **DELETE** /self/organizations/{organizationId} | Leave an organization|
|[**updateSelf**](#updateself) | **PUT** /self | Update the current user\&#39;s profile|

# **getSelf**
> GetSelf200Response getSelf()

Returns the profile of the currently authenticated user.

### Example

```typescript
import {
    SelfApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new SelfApi(configuration);

const { status, data } = await apiInstance.getSelf();
```

### Parameters
This endpoint does not have any parameters.


### Return type

**GetSelf200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getSelfOrgMembership**
> AddOrganizationUser200Response getSelfOrgMembership()

Returns the authenticated user\'s membership record for the currently selected organization, including their role and status; no special permission is required beyond being signed in.

### Example

```typescript
import {
    SelfApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new SelfApi(configuration);

const { status, data } = await apiInstance.getSelfOrgMembership();
```

### Parameters
This endpoint does not have any parameters.


### Return type

**AddOrganizationUser200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getSelfOrganizations**
> GetSelfOrganizations200Response getSelfOrganizations()

Returns a paginated list of organizations the authenticated user belongs to, supporting search and ordering; no special permission is required beyond being signed in.

### Example

```typescript
import {
    SelfApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new SelfApi(configuration);

let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getSelfOrganizations(
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetSelfOrganizations200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **selfLeaveOrganization**
> UpdateSelf200Response selfLeaveOrganization()

Removes the authenticated user\'s membership from the given organization, and fails if that organization is the user\'s currently signed-in organization.

### Example

```typescript
import {
    SelfApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new SelfApi(configuration);

let organizationId: string; //The organization identifier (default to undefined)

const { status, data } = await apiInstance.selfLeaveOrganization(
    organizationId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **organizationId** | [**string**] | The organization identifier | defaults to undefined|


### Return type

**UpdateSelf200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **updateSelf**
> UpdateSelf200Response updateSelf(userUpdateInputs)

Updates profile fields on the authenticated user\'s own account, such as name and contact details, and returns the updated user record.

### Example

```typescript
import {
    SelfApi,
    Configuration,
    UserUpdateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new SelfApi(configuration);

let userUpdateInputs: UserUpdateInputs; //

const { status, data } = await apiInstance.updateSelf(
    userUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **userUpdateInputs** | **UserUpdateInputs**|  | |


### Return type

**UpdateSelf200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

