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

# Authentication

<Columns cols={2}>
  <div>
    <p>
      The End Close API uses API keys to authenticate requests. You can view and manage your API keys in the Settings section of the <a href="https://app.endclose.com" target="_blank">End Close dashboard</a>.
    </p>

    <p>
      API keys are sensitive and should always be kept secret. You should not store API keys in publically accessible code such as public GitHub repositories or client-side code.
    </p>

    <p>
      Provide your API key as the value of the Authorization header.
    </p>
  </div>

  <div>
    <CodeGroup dropdown>
      ```javascript JavaScript lines icon="js" theme={null}
        fetch('https://api.endclose.com/v1/{endpoint}', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            X-API-KEY: YOUR_API_KEY
          }
        })
      ```

      ```ruby Ruby lines icon="ruby" theme={null}
        require 'net/http'
        require 'uri'
        require 'json'
        
        uri = URI.parse('https://api.endclose.com/v1/{endpoint}')
        
        request = Net::HTTP::Post.new(uri)
        request['Content-Type'] = 'application/json'
        request['X-API-KEY'] = YOUR_API_KEY
        
        http.request(request)
      ```

      ```python Python lines icon="python" theme={null}
        import requests

        url = "https://api.endclose.com/v1/{endpoint}"

        headers = {
            "Content-Type": "application/json",
            "X-API-KEY": YOUR_API_KEY,
        }

        requests.post(url, headers=headers)
      ```

      ```bash cURL lines icon="terminal" theme={null}
        curl -X POST 'https://api.endclose.com/v1/{endpoint}' \
          -H 'X-API-KEY: YOUR_API_KEY'
      ```
    </CodeGroup>
  </div>
</Columns>
