> ## Documentation Index
> Fetch the complete documentation index at: https://ileolami.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Learn how to get your API Key and Session ID

## Set Up Your API Key and Bearer Token

Follow these quick steps to obtain your API Key:

### 1. Registration

<Note>
  **Please note:** The API registration process is not optimized for mobile devices. Use a desktop computer and browser for the best experience.
  Before receiving your API key, you’ll need to agree to our terms of use. You can read them [here](https://www.themoviedb.org/documentation/api/terms-of-use).
</Note>

<AccordionGroup>
  <Accordion icon="right-to-bracket" title="Join">
    <Steps>
      <Step>
        Go to [TheMovieDB](https://www.themoviedb.org/)
      </Step>

      <Step title="Click on Join TDB">
        <Frame>
          <img height="100" noZoom src="https://mintcdn.com/ileolami/syMk3_IRf-DX-Dwg/images/tmbd.png?fit=max&auto=format&n=syMk3_IRf-DX-Dwg&q=85&s=3cc5bff7d39ddcdfa75623e81cb31557" data-path="images/tmbd.png" />
        </Frame>
      </Step>

      <Step title="Fill in your details (Username, password and email address)" />

      <Step title="Activate your Account">
        TMDB will send you a mail to confirm your address. Click on `ACTIVATE MY ACCOUNT`
      </Step>

      <Step title="Enter your email and password">
        Once your email is verified, re-enter the username and password you used for registration.
      </Step>
    </Steps>
  </Accordion>

  <Accordion icon="face-worried" title="Didn’t receive a confirmation email?">
    If you didn’t get an email, you can request a resend.

    <Frame>
      <img height="200" noZoom src="https://mintcdn.com/ileolami/syMk3_IRf-DX-Dwg/images/resend.png?fit=max&auto=format&n=syMk3_IRf-DX-Dwg&q=85&s=5546566b187f1bdb7b5c9b60d2db3c8f" data-path="images/resend.png" />
    </Frame>

    <Tip>
      If you try again and still don’t receive a confirmation email, your email address might be incorrect. Please restart the registration process and ensure you enter the correct email address.
    </Tip>
  </Accordion>
</AccordionGroup>

### 2. Generate Your API Key

<Accordion icon="key" title="Get your API Key">
  <Steps>
    <Step>
      Once logged in, click on your profile icon (the icon with the first letter of your username).
    </Step>

    <Step>
      Click on `Settings`
    </Step>

    <Step>
      On the sidebar, scroll down and click on `API`

      <Frame>
        <img height="200" noZoom src="https://mintcdn.com/ileolami/syMk3_IRf-DX-Dwg/images/API.png?fit=max&auto=format&n=syMk3_IRf-DX-Dwg&q=85&s=1c4c7a30bd97c305b51449fff380c37e" data-path="images/API.png" />
      </Frame>
    </Step>

    <Step>
      Under `Request an API Key`, click on `click here` to generate an API key.

      <Frame>
        <img height="200" noZoom src="https://mintcdn.com/ileolami/syMk3_IRf-DX-Dwg/images/click-here.png?fit=max&auto=format&n=syMk3_IRf-DX-Dwg&q=85&s=bf4f9106ad5d84c80379e2b4c404487a" data-path="images/click-here.png" />
      </Frame>
    </Step>

    <Step>
      Choose the type of API key you want to register for and accept the terms of use.
    </Step>

    <Step>
      Fill in your application details and click on `Submit`.
    </Step>

    <Step>
      After a successful submission, you’ll be redirected to another page.
      Scroll down to find your `API Read Access Token` and `API Key`.

      <Frame>
        <img height="200" noZoom src="https://mintcdn.com/ileolami/syMk3_IRf-DX-Dwg/images/read-access.png?fit=max&auto=format&n=syMk3_IRf-DX-Dwg&q=85&s=bd19d9bba6a27b4e9ec51fc1c984ef25" data-path="images/read-access.png" />
      </Frame>

      <Warning>
        Do not share these details with anyone.
      </Warning>
    </Step>
  </Steps>

  <Tip>You can always copy your [API Key](https://www.themoviedb.org/settings/api) from your account settings page.</Tip>
</Accordion>

***

## How to create session id?

<Warning>Please check out [versioning](/the-basics/versoning) and [session ID](/parameters/session-id) to have a better undestanding</Warning>

### Creating a Session ID(Version 3)

<Accordion title="How do I generate a session ID?">
  <Steps>
    <Step title="Request Token">
      First, request a new token.

      ```shell theme={null}
      curl --request GET \  
        --url https://api.themoviedb.org/3/authentication/token/new \  
        --header 'Authorization: Bearer {ACCESS_TOKEN}' \  
        --header 'accept: application/json'
      ```

      This temporary token allows you to ask the user for permission to access their account.
      <Info>This token will automatically expire after 60 minutes if unused.</Info>
    </Step>

    <Step title="Ask the user for permission">
      With a request token in hand, approve it using this URL:

      ```shell theme={null}
      https://www.themoviedb.org/authenticate/{REQUEST_TOKEN}
      ```

      Or, use this URL with a `redirect_to` parameter:

      ```shell theme={null}
      https://www.themoviedb.org/authenticate/{REQUEST_TOKEN}?redirect_to=http://www.yourapp.com/approved
      ```

      Once approved, the user will be redirected to your specified URL or to the `/authenticate/allow` path on TMDB.
      If they aren’t redirected, the page will include an `Authentication-Callback` header, containing the API call for the next step.
    </Step>

    <Step title="Create a session ID">
      By calling the new session method with the approved request token from step 2, you’ll receive a new `session_id`.
      <Warning>Treat this key like a password—keep it secret.</Warning>
    </Step>
  </Steps>
</Accordion>

***

### Creating Session ID(Version 4)

<Accordion title="How do I generate a session ID?">
  <Steps>
    <Step>
      Request a [request token](https://developer.themoviedb.org/v4/reference/auth-create-request-token) with your access token.
    </Step>

    <Step>
      Authorize it using this URL:

      ```shell theme={null}
       https://www.themoviedb.org/auth/access?request_token={REQUEST_TOKEN}
      ```
    </Step>

    <Step>
      Generate [an access token](https://developer.themoviedb.org/v4/reference/auth-create-access-token) with your request token.
    </Step>
  </Steps>
</Accordion>
