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

# Custom authentication

> Create Tight accounts with a few lines of code

If your platform rolls its own authentication mechanism, utilize the Tight API to provision user accounts and retrieve access tokens.

## Create a company

When a business opts into your new Bookkeeping product, [create their company in Tight](/api-reference/company-management/create-a-company).

The creation of the company accepts a `userId` for the business owner from your system, so there is no need to store any Tight identifiers in your platform.

## Get an access token

Using the `userId` used to create the user's company along with your client credentials, make a simple request to retrieve an access token:

```bash theme={null}
curl -X POST https://sandbox.tight.com/v6/auth/token \
-u client_id:client_secret \
-d userId=your_userId
```

The Tight API will respond with your granted access token:

```json theme={null}
{
    "access_token": "<access_token>",
    "token_type": "Bearer",
    "expires_in": 3600
}
```

This token can be used to [embed Tight UI](/embeddable-ui/react/patterns/embedding) or to directly [hit the Tight API](/api-reference/authentication#using-the-access-token).
