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

# Introduction

> Example section for showcasing API endpoints

<Note>
  ### Essential steps before doing anything else:

  1. Create an [account](https://app.theauthapi.com)
  2. Create a new Project (this could be the name of your API)
  3. Generate a new 'Access Key' (sometimes referred to as a root key)
  4. Copy your 'Access Key' and Project ID somewhere safe!
</Note>

## Authentication

All API endpoints are authenticated using your 'Access token'.

<CodeGroup>
  ```bash curl.txt theme={null}
  curl --request GET \
   --url https://api.theauthapi.com/ \
   --header 'x-api-key: REPLACE_WITH_YOUR_ACCESS_TOKEN'

  ```

  ```javascript helloWorld.js theme={null}
  const options = {
    method: 'GET',
    headers: {
      'x-api-key': 'REPLACE_WITH_YOUR_ACCESS_TOKEN'
    }
  };

  fetch('https://api.theauthapi.com/', options)
    .then(response => response.json())
    .then(response => console.log(response))
    .catch(err => console.error(err));
  ```

  ```python hello_world.py theme={null}
  import requests

  url = "https://api.theauthapi.com/"

  headers = {"x-api-key": "REPLACE_WITH_YOUR_ACCESS_TOKEN"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```

  ```php helloWorld.php theme={null}
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.theauthapi.com/",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
      "x-api-key: REPLACE_WITH_YOUR_ACCESS_TOKEN"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```java HelloWorld.java theme={null}
  HttpResponse<String> response = Unirest.get("https://api.theauthapi.com/")
    .header("x-api-key", "REPLACE_WITH_YOUR_ACCESS_TOKEN")
    .asString();
  ```

  ```go helloWorld.go theme={null}
  package main

  import (
  	"fmt"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://api.theauthapi.com/"

  	req, _ := http.NewRequest("GET", url, nil)

  	req.Header.Add("x-api-key", "REPLACE_WITH_YOUR_ACCESS_TOKEN")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```
</CodeGroup>
