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

# Request headers

> User, company and period information sent with every request.

The token determines which organization you access. Headers tell the API **on behalf of which user** and **in which company** you are working.

<ParamField header="X-UserID" type="integer" required>
  ID of the Noyax user performing the operation. The user must not be deleted. Created, updated and deleted records show this user as the person who made the change. The user's [sharing codes](/en/v1/guides/sharing-codes) determine which records are visible.
</ParamField>

<ParamField header="X-CompanyID" type="integer" required>
  ID of the company. The user must be assigned to this company. All reads are limited to this company and new records are written to it.
</ParamField>

<ParamField header="X-PeriodID" type="integer">
  ID of the accounting period. Optional for customer endpoints; if sent, it is written to new records. It will be required for accounting endpoints.
</ParamField>

## Validation rules

* Values must be integers greater than `0`. This also applies to the optional `X-PeriodID` when it is sent; invalid values are not ignored.
* All header errors are returned together in a single **400** response:

```json theme={null}
{
  "Success": false,
  "ResultCode": "0201",
  "Message": "X-UserID header is required. X-CompanyID header must be an integer greater than 0. Received: 'abc'.",
  "Errors": [
    { "Code": "0201", "Message": "X-UserID header is required." },
    { "Code": "0204", "Message": "X-CompanyID header must be an integer greater than 0. Received: 'abc'." }
  ]
}
```

| Code                     | Message                                                        | Cause                                                                 |
| ------------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------- |
| `0201` / `0203`          | `X-UserID header is required.`                                 | Required header not sent                                              |
| `0202` / `0204` / `0205` | `... must be an integer greater than 0.`                       | Value is not a number, or is 0 or negative                            |
| `0210`                   | `User not found.`                                              | User does not exist or is deleted                                     |
| `0211`                   | `Company not found or the user has no access to this company.` | Company does not exist, is deleted, or the user is not assigned to it |

<Tip>
  User and company checks are cached. If a user's company assignment or sharing codes were just changed in Noyax, it can take up to 30 minutes for the API to reflect the change.
</Tip>
