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

# Authentication

> Learn how to authenticate your requests to the NeetoInvoice API using API keys.

### Generating an API Key

To use the NeetoInvoice APIs, you must first generate an API key.
[Learn how to generate your API key here.](https://help.neetoinvoice.com/articles/api-keys)

### Making Authenticated API Requests

To authenticate your API requests, include a valid API key in the X-Api-Key header.

```bash theme={"system"}
curl https://{your-subdomain}.neetoinvoice.com/api/external/v1/team_members \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json"
```

### Header Format

Include your API key in the `X-Api-Key` header of every request:

```http theme={"system"}
X-Api-Key: your_api_key_here
```

<Tip>
  Generate separate API keys for different workspaces. An API key generated in
  one workspace will not work in another.
</Tip>

<Warning>
  API keys provide access to sensitive data. Treat them like passwords and
  follow security best practices.
</Warning>

## Error Responses

### 401 Unauthorized

If your API key is missing, invalid, or expired, you'll receive a 401 error:

```json theme={"system"}
{
  "error": "Could not authenticate, invalid API Key"
}
```

### Common Authentication Issues

<AccordionGroup>
  <Accordion title="Invalid API Key">
    **Problem**: API key is missing or invalid <br />
    **Solution**: Verify your API key is correct and hasn't been revoked/expired
  </Accordion>

  <Accordion title="Incorrect workspace subdomain">
    **Problem**: Subdomain is left as the default value (**spinkart**) or incorrect<br />
    **Solution**: Verify your subdomain name is properly added in the request URL
  </Accordion>
</AccordionGroup>
