---
schema_version: "1"
id: 89646abebf8d4b40cc3ac70b103820bb6d2d1579044cf93db35b14ece1699dad
title: Include Authorization Headers in RPC Method Calls
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/event-bus/pub-sub-api/guides/rpc-method-headers.md
canonical_url: https://developer.salesforce.com/docs/platform/pub-sub-api/guide/rpc-method-headers.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 601a4559aec7afe9f99ef2027863b4c5e476f633f92d25e8514f83cafd208c08
products:
  - Pub/Sub API
  - Event Bus Docs
---
# Include Authorization Headers in RPC Method Calls

Every time an RPC method executes, it uses the headers to authorize access to resources.

How you set the headers depends on your programming language. In Python, the headers are provided in a tuple as a parameter to each call. For more information, see [Python Quick Start for Pub/Sub API](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-python-quick-start.md). In other languages, such as Java, you can provide the headers in the stub separately before making a gRPC call.

## `accesstoken`

The OAuth access token or the session ID returned in the `login()` call response. For more information about getting an OAuth access token, see [OAuth Authorization Flows](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_flows.htm&type=5) in _Salesforce Help_. For more information about the `login()` call, see [login()](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_login.htm) in the _SOAP API Developer Guide_.

## `instanceurl`

The first part of your Salesforce server URL without the ending path portion. You can get this URL in one of two ways.

- From the `login()` call result in `serverUrl`, as outlined in the [quick start example](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-python-quick-start.md) in this guide. For more information, see [LoginResult](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_login_loginresult.htm) in the _SOAP API Developer Guide_.
- From the result that Salesforce returns as part of the OAuth authorization flow in `instance_url`. For more information, see [OAuth 2.0 User-Agent Flow for Desktop or Mobile App Integration](https://help.salesforce.com/s/articleView?id=remoteaccess_oauth_user_agent_flow.htm&type=5&language=en_US) in _Salesforce Help_.

The Salesforce URL can be:

- A MyDomain URL. For example, `https://MyDomainName.my.salesforce.com`.
- A custom domain URL. For example, `https://www.example.com`.

## `tenantid`

An ID that uniquely identifies your org. If you set this header to the org ID, the Pub/Sub API constructs the entire value for you. These values are valid.

- `{Org ID}`
- `core/{Subdomain}/{Org ID}`

Examples:

- Org ID: `00D5e000003TIrB`
- Entire value: `core/MyDomainName/00D5e000003TIrB`

The org ID is returned in the [login()](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_login.htm) call response. Alternatively, you can get your org ID value by following the steps in [Find your Salesforce Organization ID](https://help.salesforce.com/articleView?id=000325251&mode=1&type=1) in _Salesforce Help_.

If you build the entire value, use your org’s My Domain login URL. You can find this value in **Setup > My Domain**. For more information, see [What Is My Domain?](https://help.salesforce.com/s/articleView?id=xcloud.faq_domain_name_what.htm&type=5) in _Salesforce Help_.
