> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.tarla.io/llms.txt
> Use this file to discover all available pages before exploring further.

# User Settings

> This page provides important information about the details required to make API requests, such as language selection, user registration, account activation and account subscription processes.

# 1. API Language Selection

You can use API messages with different language translations by using the `Accept-Language` header in the requests. This applies to API endpoints that do not require input. Supported language selections are given in the example below.

```
Accept-Language: tr
Accept-Language: en
```

## <Icon icon="lock-open" iconType="regular" size={24} /> Login-free API endpoints

* Authorization Service
  * New User Registration - `/v1/auth/register`
  * Login Process - `/v1/auth/login`
  * Access Token Refresh - `/v1/auth/refresh`
* User Service
  * Password Reset Request `/v1/users/password-reset-request`

## <Icon icon="flag" iconType="regular" size={24} /> User Language Selection

After a user logs in, the system recognizes the user's locale and language selection and translates the API responses accordingly, thanks to the **Access Token** sent to the API endpoints they request. In addition, the ***User Update Process*** available on the `/v1/users/update` API endpoint allows the user to change their (or any user's if they are ADMIN) language, locale and timezone settings.

# 2. User Registration and Account Activation

<Steps>
  <Step title="New User Registration">
    * A new user registration is created via the **New User Registration** - `/v1/auth/register` API endpoint by entering the following information:
      1. Username (email address)
      2. Password
      3. Name
      4. Middle Name, if any
      5. Surname
      6. Language and Locale Preference
      7. Time Zone Preference
    * During registration, if there is a user with the same username (email), the error message `Existing User` is returned with the code `400 - Bad Request`.
    * If the registration was successful, the user status will be created as `INACTIVE`.
  </Step>

  <Step title="Account Activation Request">
    * A new account registration is created by entering the following information via the **Account Activation Request** - `/v1/accounts/account-activation-request` API endpoint:
      1. User ID
      2. Account Type
      3. Mobile Phone Number
      4. Location Address
      5. Company
      6. Industry
      7. Link to Account Activation Page
    * Handles the activation request for a new account. This method processes the activation request, performs necessary validations (such as checking if an account already exists for the user), and creates a new account if valid.
    * It also sends an email to the user with an account activation link.
  </Step>

  <Step title="Account Activation">
    * It finalizes the registration of a new account via the **Account Activation** - `/v1/accounts/activate-account` API endpoint by entering the following information:
      1. User ID
      2. Account ID
      3. Email Verification Token
    * Activates a user account by verifying the provided email verification token. It validates the token, updates account and user status, and ensures the token has not expired.
    * Once verified, the account is marked as email verified and token fields are cleared.
  </Step>

  <Step title="Mobile Phone Number Verification Request">
    A phone number verification request is made via the **Mobile Phone Number Activation Request** - `/v1/accounts/phone-number-activation-request` API endpoint by entering the following information:

    1. User ID
    2. Account ID
    3. Link to Phone Number Activation Page

    * Handles the activation process for a user's phone number. This includes validating the account, generating a phone number verification token, composing an activation message, and sending the activation SMS.
    * It is an optional step, this and the next step can be skipped, but the user will not receive SMS notifications if the phone number is not verified.
  </Step>

  <Step title="Mobile Phone Number Verification">
    The phone number verification process is finalized by entering the following information via the **Mobile Phone Number Activation** - `/v1/accounts/activate-phone-number` API endpoint:

    1. User ID
    2. Account ID
    3. Phone Number Validation Token

    * Activates a phone number for a user by verifying the provided phone number verification token associated with their account.
  </Step>

  <Step title="Subscription Selection">
    The user cannot use paid services unless a subscription is selected. Therefore, it is necessary to select a subscription as described in the next section.
  </Step>
</Steps>

# 3. Subscription Operations

* The subscription update process is performed for the user by entering the following information via the **Update Subscription** - `/v1/accounts/update-subscription` API endpoint;
  * Plan Selection
    1. User ID
    2. Subscriber ID
    3. Subscription Plan Name
  * Creating a Custom Plan
    1. User ID
    2. Subscriber ID
    3. Plan Details
       1. Subscription Period
       2. Limit Reset Recurrence
       3. Geographical Boundary
       4. Api Service Limits
          1. Api Version
          2. Api Endpoint Name
          3. Maximum Number of Calls
* Updates the subscription plan for a user account. The endpoint ensures that the user has the required role and the account exists.
* It sets the account's subscription plan to the specified value and adjusts the user's status if necessary.
* Returns error message if validation errors occur or required entities are not found.

## 3.1. Subscription Plans

| Plan Name         | Subscription Period | Limit Type        | Limit Count       | API Call Count    | Country Boundary  | Region Boundary   | Note                                                                                                                         |
| ----------------- | ------------------- | ----------------- | ----------------- | ----------------- | ----------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| None              | -                   | -                 | -                 | -                 | -                 | -                 | For users who do not have a subscription or whose subscription has been canceled.                                            |
| Trial             | 1 month             | day               | 5                 | very few          | -                 | -                 | Available for users who have not previously had a trial subscription. A user cannot select the trial more than once.         |
| Basic - Monthly   | 1 month             | month             | 1                 | limited           | -                 | -                 | API call count is limited, it is an economical subscription type. There is a 1-month usage limit, must be renewed afterward. |
| Basic - Annual    | 1 year              | quota             | -                 | limited           | -                 | -                 | API call count is limited, an economical type where the total annual quota can be used at any time within the year.          |
| Premium - Monthly | 1 month             | month             | 1                 | sufficient        | -                 | -                 | API call count is sufficient, top-tier subscription. There is a 1-month usage limit, must be renewed afterward.              |
| Premium - Annual  | 1 year              | quota             | -                 | sufficient        | -                 | -                 | API call count is sufficient, top-tier subscription where the total annual quota can be used at any time within the year.    |
| Custom            | depends on choice   | depends on choice | depends on choice | depends on choice | depends on choice | depends on choice | A custom subscription type where each parameter can be customized.                                                           |

## 3.2. Geo-bounding Options for Custom Subscription Option

<Tabs>
  <Tab title="Türiye" icon="flag">
    1. All
    2. Akdeniz Region
    3. Doğu Anadolu Region
    4. Ege Region
    5. Güneydoğu Anadolu Region
    6. İç Anadolu Region
    7. Marmara Region
    8. Karadeniz Region
  </Tab>

  <Tab title="Europe" icon="earth-europe">
    1. All
    2. Eastern
    3. Western
    4. Northern
    5. Southern
  </Tab>

  <Tab title="Asia" icon="earth-asia">
    1. Iran
  </Tab>

  <Tab title="World" icon="globe">
    1. All
  </Tab>
</Tabs>
