---
title: Quickstart
description: Make your first authenticated GitLite API call and create a repository in about a minute.
url: https://pr-1-12825562dfc9.thally.app/quickstart
lastVerified: 2026-09-15T00:00:00.000Z
verifiedVersion: GitLite 1.27.3
---

# Quickstart

Make your first authenticated GitLite API call and create a repository in about a minute.

You will create an access token, confirm who you are authenticated as, and create
a repository through the API.

## Before you begin

- A running GitLite server at `http://localhost:3000`
- A GitLite user account
- `curl`, or Node.js 18 or later

#### Create an access token

    In the GitLite web UI, open **Settings → Applications → Manage Access Tokens**,
    enter a token name, select the `write:repository` and `read:user` scopes, and
    select **Generate Token**. Copy the token; GitLite shows it only once.

    Store it in your shell:

    ```bash
    export GITLITE_TOKEN="<your 40-character token>"
    export GITLITE_AUTH="Bearer $GITLITE_TOKEN"
    ```

    Every example in these docs sends `Authorization: $GITLITE_AUTH`, so the
    authorization scheme is set in this one place.

    To create a token from the command line instead, see
    [Create a token with the API](/authentication#create-a-token-with-the-api).

#### Make your first authenticated request

    Send the token in the `Authorization` header, prefixed with the word `Bearer`
    and a space.

#### curl

        ```bash
        curl -s http://localhost:3000/api/v1/user \
          -H "Authorization: $GITLITE_AUTH"
        ```

#### JavaScript

        ```js
        const res = await fetch('http://localhost:3000/api/v1/user', {
          headers: { Authorization: process.env.GITLITE_AUTH },
        })
        console.log(res.status, (await res.json()).login)
        ```

    A `200 OK` response contains your user object, including `login`.

#### Create a repository

#### curl

        ```bash
        curl -s -X POST http://localhost:3000/api/v1/user/repos \
          -H "Authorization: $GITLITE_AUTH" \
          -H "Content-Type: application/json" \
          -d '{"name": "quickstart-repo", "auto_init": true}'
        ```

#### JavaScript

        ```js
        const res = await fetch('http://localhost:3000/api/v1/user/repos', {
          method: 'POST',
          headers: {
            Authorization: process.env.GITLITE_AUTH,
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ name: 'quickstart-repo-js', auto_init: true }),
        })
        console.log(res.status, (await res.json()).full_name)
        ```

#### Verify the result

    A `201 Created` response contains the new repository, and `full_name` is
    `<your-login>/quickstart-repo`. If you receive `401`, check that the header
    starts with `Bearer ` and that the token was copied completely. If you receive
    `403`, the token is missing the `write:repository` scope. See
    [Handling errors](/guides/errors).

## Next steps

- List your repositories and read later pages: [Pagination](/pagination)
- Choose the narrowest scopes for production tokens: [Authentication](/authentication)