---
sidebar:
  label: roboto.http.headers
  order: 1
title: roboto.http.headers
---
## Module Contents

### CONTENT_TYPE_JSON_HEADER

```python
roboto.http.headers.CONTENT_TYPE_JSON_HEADER
```

`from roboto.http import CONTENT_TYPE_JSON_HEADER`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/headers.py#L17-L17)

Header naming JSON as the request body's content type, as a dictionary to merge into a request's headers.

No SDK method reads it.

### roboto_headers()

```python
def roboto.http.headers.roboto_headers(
    org_id: Optional[str] = None,
    user_id: Optional[str] = None,
    resource_owner_id: Optional[str] = None,
    additional_headers: Optional[dict[str, str]] = None,
    api_version: roboto.api_version.RobotoApiVersion = RobotoApiVersion.latest(),
)
```

`from roboto.http import roboto_headers`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/headers.py#L24-L65)

Build the headers that tell Roboto which API version, organization and user a request is for.

[`get()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.get) and the other request methods of [`RobotoClient`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient) build their headers through it, so most code never calls it. The result always names the API version; each other argument adds its header only when it is not `None`.

**Parameters**

- **org_id** (`Optional[str]`): Organization to act in, sent as [`ORG_OVERRIDE_HEADER`](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.ORG_OVERRIDE_HEADER). Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **user_id** (`Optional[str]`): ID of the user to act as, which for a person is their email address, sent as [`USER_OVERRIDE_HEADER`](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.USER_OVERRIDE_HEADER). `None` acts as the caller.
- **resource_owner_id** (`Optional[str]`): Organization that owns the resource the request reads or changes, sent as [`RESOURCE_OWNER_OVERRIDE_HEADER`](/docs/reference/python-sdk/roboto/http/constants#roboto.http.constants.RESOURCE_OWNER_OVERRIDE_HEADER). `None` omits the header.
- **additional_headers** (`Optional[dict[str, str]]`): Further headers to send. They are added last, so one with the same name as a header above replaces it.
- **api_version** (`roboto.api_version.RobotoApiVersion`): API version the request is made against. Defaults to the newest version this SDK knows.

**Returns**

- Header names mapped to their values.
