login()
Sign in with email or username
Checks account credentials and returns an access token plus a refresh token. Send the access token as `Authorization: Bearer `.
Signature
client.authorization.login(options: AuthorizationLoginOptions): Promise<AuthorizationLoginResponse>Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
body | LoginRequestRequest | Required | — |
Example
const result = await client.authorization.login({ body: { "password": "Correct-Horse-Battery-Staple-42" }});Returns
TokenPairResponseThe operation completed successfully.
typeTokenPairResponse2fields
tokenstringrefreshstringThrows
ApiErrorNormalized API, transport, and response processing failure.
kind: "validation"The request arguments or business rules are invalid.kind: "network"The request could not reach ProxyRequest.kind: "unexpected"The response could not be decoded or did not match the SDK contract.
Advanced variants
client.authorization.loginWithResponse(options): Promise<ApiResponse<AuthorizationLoginResponse>>Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
client.authorization.login(*, body: LoginRequest, accept_language: str | Unset=UNSET) -> TokenPairResponse | OTPChallengeawait async_client.authorization.login(*, body: LoginRequest, accept_language: str | Unset=UNSET) -> TokenPairResponse | OTPChallengeParameters
| Name | Type | Requirement | Description |
|---|---|---|---|
accept_language | str | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
body | LoginRequestRequest | Required | — |
Example
result = client.authorization.login( body=models.LoginRequestRequest.from_dict({'password': 'Correct-Horse-Battery-Staple-42'}), )Async example
result = await async_client.authorization.login( body=models.LoginRequestRequest.from_dict({'password': 'Correct-Horse-Battery-Staple-42'}), )Returns
TokenPairResponse | OTPChallengeThe operation completed successfully.
classTokenPairResponse2fields
tokenstrrefreshstrclassOTPChallenge3fields
statusstrchallengestrexpires_inintThrows
ApiErrorNormalized API, transport, and response processing failure.
ErrorKind.VALIDATIONThe request arguments or business rules are invalid.ErrorKind.NETWORKThe request could not reach ProxyRequest.ErrorKind.UNEXPECTEDThe response could not be decoded or did not match the SDK contract.
Advanced variants
client.authorization.login_with_response(*, body: LoginRequest, accept_language: str | Unset=UNSET) -> ApiResponse[TokenPairResponse | OTPChallenge]Returns response status, headers, ETag and idempotency metadata with the decoded data.
Signature
$client->authorization()->login($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0])Parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
acceptLanguage | string | Optional | Preferred language for human-readable API errors. Supported languages: en, ru, uk, de, it, fr, es, zh-hans, ja. Regional language tags and quality weights are accepted; unsupported or omitted values use English. |
loginRequest | LoginRequest | Required | — |
Example
$result = $client->authorization()->login( loginRequest: new Dto\LoginRequest([ 'password' => 'Correct-Horse-Battery-Staple-42', ]),);Returns
TokenPairResponseThe operation completed successfully.
classTokenPairResponse2fields
tokenstringrefreshstringThrows
ApiExceptionNormalized API, transport, and response processing failure.
ErrorKind::ValidationThe request arguments or business rules are invalid.ErrorKind::NetworkThe request could not reach ProxyRequest.ErrorKind::UnexpectedThe response could not be decoded or did not match the SDK contract.
InvalidArgumentExceptionA required argument is missing or violates a local SDK constraint.
local validationThe request was rejected before it was sent.
Advanced variants
$client->authorization()->loginWithResponse($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0]): \ProxyRequest\ApiResponseReturns an ApiResponse with decoded data and HTTP metadata.
$client->authorization()->loginWithHttpInfo($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0])Returns the OpenAPI Generator response tuple.
$client->authorization()->loginAsync($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0])Returns a Guzzle promise for the decoded result.
$client->authorization()->loginAsyncWithHttpInfo($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0])Returns a Guzzle promise for the response tuple.
$client->authorization()->loginRequest($loginRequest, $acceptLanguage = null, string $contentType = self::contentTypes['login'][0])Builds the PSR-7 request without sending it.