# \IdentityApi
All URIs are relative to *https://playground.projects.oryapis.com*
[**create_identity**](IdentityApi.md#create_identity) | **POST** /admin/identities | Create an Identity
[**create_recovery_code_for_identity**](IdentityApi.md#create_recovery_code_for_identity) | **POST** /admin/recovery/code | Create a Recovery Code
[**create_recovery_link_for_identity**](IdentityApi.md#create_recovery_link_for_identity) | **POST** /admin/recovery/link | Create a Recovery Link
[**delete_identity**](IdentityApi.md#delete_identity) | **DELETE** /admin/identities/{id} | Delete an Identity
[**delete_identity_credentials**](IdentityApi.md#delete_identity_credentials) | **DELETE** /admin/identities/{id}/credentials/{type} | Delete a credential for a specific identity
[**delete_identity_sessions**](IdentityApi.md#delete_identity_sessions) | **DELETE** /admin/identities/{id}/sessions | Delete & Invalidate an Identity's Sessions
[**disable_session**](IdentityApi.md#disable_session) | **DELETE** /admin/sessions/{id} | Deactivate a Session
[**extend_session**](IdentityApi.md#extend_session) | **PATCH** /admin/sessions/{id}/extend | Extend a Session
[**get_identity**](IdentityApi.md#get_identity) | **GET** /admin/identities/{id} | Get an Identity
[**get_identity_schema**](IdentityApi.md#get_identity_schema) | **GET** /schemas/{id} | Get Identity JSON Schema
[**get_session**](IdentityApi.md#get_session) | **GET** /admin/sessions/{id} | Get Session
[**list_identities**](IdentityApi.md#list_identities) | **GET** /admin/identities | List Identities
[**list_identity_schemas**](IdentityApi.md#list_identity_schemas) | **GET** /schemas | Get all Identity Schemas
[**list_identity_sessions**](IdentityApi.md#list_identity_sessions) | **GET** /admin/identities/{id}/sessions | List an Identity's Sessions
[**list_sessions**](IdentityApi.md#list_sessions) | **GET** /admin/sessions | List All Sessions
[**patch_identity**](IdentityApi.md#patch_identity) | **PATCH** /admin/identities/{id} | Patch an Identity
[**update_identity**](IdentityApi.md#update_identity) | **PUT** /admin/identities/{id} | Update an Identity
## create_identity
> crate::models::Identity create_identity(create_identity_body)
Create an Identity
Create an [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model). This endpoint can also be used to [import credentials](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities) for instance passwords, social sign in configurations or multifactor methods.
### Parameters
**create_identity_body** | Option<[**CreateIdentityBody**](CreateIdentityBody.md)> | | |
### Return type
[**crate::models::Identity**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
## create_recovery_code_for_identity
> crate::models::RecoveryCodeForIdentity create_recovery_code_for_identity(create_recovery_code_for_identity_body)
Create a Recovery Code
This endpoint creates a recovery code which should be given to the user in order for them to recover (or activate) their account.
### Parameters
**create_recovery_code_for_identity_body** | Option<[**CreateRecoveryCodeForIdentityBody**](CreateRecoveryCodeForIdentityBody.md)> | | |
### Return type
[**crate::models::RecoveryCodeForIdentity**](recoveryCodeForIdentity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
## create_recovery_link_for_identity
> crate::models::RecoveryLinkForIdentity create_recovery_link_for_identity(create_recovery_link_for_identity_body)
Create a Recovery Link
This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.
### Parameters
**create_recovery_link_for_identity_body** | Option<[**CreateRecoveryLinkForIdentityBody**](CreateRecoveryLinkForIdentityBody.md)> | | |
### Return type
[**crate::models::RecoveryLinkForIdentity**](recoveryLinkForIdentity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
## delete_identity
> delete_identity(id)
Delete an Identity
Calling this endpoint irrecoverably and permanently deletes the [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model) given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already.
### Parameters
**id** | **String** | ID is the identity's ID. | [required] |
### Return type
(empty response body)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## delete_identity_credentials
> crate::models::Identity delete_identity_credentials(id, _type)
Delete a credential for a specific identity
Delete an [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model) credential by its type You can only delete second factor (aal2) credentials.
### Parameters
**id** | **String** | ID is the identity's ID. | [required] |
**_type** | **String** | Type is the credential's Type. One of totp, webauthn, lookup | [required] |
### Return type
[**crate::models::Identity**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## delete_identity_sessions
> delete_identity_sessions(id)
Delete & Invalidate an Identity's Sessions
Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity.
### Parameters
**id** | **String** | ID is the identity's ID. | [required] |
### Return type
(empty response body)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## disable_session
> disable_session(id)
Deactivate a Session
Calling this endpoint deactivates the specified session. Session data is not deleted.
### Parameters
**id** | **String** | ID is the session's ID. | [required] |
### Return type
(empty response body)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## extend_session
> crate::models::Session extend_session(id)
Extend a Session
Calling this endpoint extends the given session ID. If `session.earliest_possible_extend` is set it will only extend the session after the specified time has passed. Retrieve the session ID from the `/sessions/whoami` endpoint / `toSession` SDK method.
### Parameters
**id** | **String** | ID is the session's ID. | [required] |
### Return type
[**crate::models::Session**](session.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## get_identity
> crate::models::Identity get_identity(id, include_credential)
Get an Identity
Return an [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model) by its ID. You can optionally include credentials (e.g. social sign in connections) in the response by using the `include_credential` query parameter.
### Parameters
**id** | **String** | ID must be set to the ID of identity you want to get | [required] |
**include_credential** | Option<[**Vec<String>**](String.md)> | Include Credentials in Response Currently, only `oidc` is supported. This will return the initial OAuth 2.0 Access, Refresh and (optionally) OpenID Connect ID Token. | |
### Return type
[**crate::models::Identity**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## get_identity_schema
> serde_json::Value get_identity_schema(id)
Get Identity JSON Schema
Return a specific identity schema.
### Parameters
**id** | **String** | ID must be set to the ID of schema you want to get | [required] |
### Return type
[**serde_json::Value**](serde_json::Value.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## get_session
> crate::models::Session get_session(id, expand)
Get Session
This endpoint is useful for: Getting a session object with all specified expandables that exist in an administrative context.
### Parameters
**id** | **String** | ID is the session's ID. | [required] |
**expand** | Option<[**Vec<String>**](String.md)> | ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. Example - ?expand=Identity&expand=Devices If no value is provided, the expandable properties are skipped. | |
### Return type
[**crate::models::Session**](session.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## list_identities
> Vec<crate::models::Identity> list_identities(per_page, page, identifier)
List Identities
Lists all [identities](https://www.ory.sh/docs/kratos/concepts/identity-user-model) in the system.
### Parameters
**per_page** | Option<**i64**> | Items per Page This is the number of items per page. | |[default to 250]
**page** | Option<**i64**> | Pagination Page This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. | |[default to 1]
**identifier** | Option<**String**> | Identifier This query parameter can be used to lookup an identity using its identifier. For example - an email address | |
### Return type
[**Vec<crate::models::Identity>**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## list_identity_schemas
> Vec<crate::models::IdentitySchemaContainer> list_identity_schemas(per_page, page)
Get all Identity Schemas
Returns a list of all identity schemas currently in use.
### Parameters
**per_page** | Option<**i64**> | Items per Page This is the number of items per page. | |[default to 250]
**page** | Option<**i64**> | Pagination Page This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. | |[default to 1]
### Return type
[**Vec<crate::models::IdentitySchemaContainer>**](identitySchemaContainer.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## list_identity_sessions
> Vec<crate::models::Session> list_identity_sessions(id, per_page, page, active)
List an Identity's Sessions
This endpoint returns all sessions that belong to the given Identity.
### Parameters
**id** | **String** | ID is the identity's ID. | [required] |
**per_page** | Option<**i64**> | Items per Page This is the number of items per page. | |[default to 250]
**page** | Option<**i64**> | Pagination Page This value is currently an integer, but it is not sequential. The value is not the page number, but a reference. The next page can be any number and some numbers might return an empty list. For example, page 2 might not follow after page 1. And even if page 3 and 5 exist, but page 4 might not exist. | |[default to 1]
**active** | Option<**bool**> | Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned. | |
### Return type
[**Vec<crate::models::Session>**](session.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## list_sessions
> Vec<crate::models::Session> list_sessions(page_size, page_token, active, expand)
List All Sessions
Listing all sessions that exist.
### Parameters
**page_size** | Option<**i64**> | Items per Page This is the number of items per page to return. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). | |[default to 250]
**page_token** | Option<**String**> | Next Page Token The next page token. For details on pagination please head over to the [pagination documentation](https://www.ory.sh/docs/ecosystem/api-design#pagination). | |
**active** | Option<**bool**> | Active is a boolean flag that filters out sessions based on the state. If no value is provided, all sessions are returned. | |
**expand** | Option<[**Vec<String>**](String.md)> | ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session. If no value is provided, the expandable properties are skipped. | |
### Return type
[**Vec<crate::models::Session>**](session.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[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)
## patch_identity
> crate::models::Identity patch_identity(id, json_patch)
Patch an Identity
Partially updates an [identity's](https://www.ory.sh/docs/kratos/concepts/identity-user-model) field using [JSON Patch](https://jsonpatch.com/). The fields `id`, `stateChangedAt` and `credentials` can not be updated using this method.
### Parameters
**id** | **String** | ID must be set to the ID of identity you want to update | [required] |
**json_patch** | Option<[**Vec<crate::models::JsonPatch>**](jsonPatch.md)> | | |
### Return type
[**crate::models::Identity**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)
## update_identity
> crate::models::Identity update_identity(id, update_identity_body)
Update an Identity
This endpoint updates an [identity](https://www.ory.sh/docs/kratos/concepts/identity-user-model). The full identity payload (except credentials) is expected. It is possible to update the identity's credentials as well.
### Parameters
**id** | **String** | ID must be set to the ID of identity you want to update | [required] |
**update_identity_body** | Option<[**UpdateIdentityBody**](UpdateIdentityBody.md)> | | |
### Return type
[**crate::models::Identity**](identity.md)
### Authorization
[oryAccessToken](../README.md#oryAccessToken)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[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)