---
schema_version: "1"
id: 1b5c954061c019f236c13543f08cb1fadb8c20efde5090c5e8718b76847fde53
title: Get Started with Ingestion API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-int/references/ingestionapi/c360-a-api-get-started.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-int/references/data-cloud-ingestionapi-ref/c360-a-api-get-started.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 586e9cce0df5e941a47e9489f1cefbfbbafc905447ec4c3507b57770b7469f46
products:
  - Data 360 Integration Guide
  - Data 360 Developer Documentation
---
# Get Started with Ingestion API

Before using Ingestion API in Data 360, complete the prerequisites, set up authentication, and know the limits that apply to bulk ingestion and streaming ingestion.

## Prerequisites

- Setup [Ingestion API connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-ingestion-api.html) to define the endpoints and payload to ingest data.
- Create an Ingestion API data stream to configure ingestion jobs and expose the API for external consumption.
- Contact your admin to configure endpoint details.

## Authentication

Set up a connected app to authenticate and request access to Data 360 Ingestion API. The connected app enables standard OAuth protocols for authentication and authorization. Follow the instructions in [_Salesforce Help_ Create a Connected App](https://help.salesforce.com/articleView?id=connected_app_create.htm&type=5), and configure the app as needed. In your connected app, make sure **Enable OAuth Settings** and necessary OAuth scopes are selected. The possible scopes are:

- Access and manage your Data 360 Ingestion API data (cdp_ingest_api).
- Access and manage your data (api).
- Perform requests on your behalf at any time (refresh_token, offline_access).

**important:** Your orgs must be provisioned with Data Cloud licenses and the users must be assigned to appropriate roles for having full access to objects in the Data Cloud. Refer to [User Roles and Permission Sets in Data Cloud](https://help.salesforce.com/s/articleView?id=data.c360_a_userpermissions.htm&type=5) before setting up the Connected App.

**Acquire a Salesforce Access Token**

Send a request for acquiring the Salesforce access token. Here’s how a sample request is going to look like.

```nolang

POST https://login.salesforce.com/services/oauth2/token
Content-Type:application/x-www-form-urlencoded
grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer &assertion=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlcGljLjAxMjAwOTdhNDFhMEBvcmdmYXJtLm91dCIsImlzcyI6IjNNVkc5bDNSOUY5bUhPR2FHdWVNM1NPNm5aZXhZSnJLSlFkYVZpZXoxMFZxWXNCOUlYRFNqdThkaHZKWjVqYVpURV9mdWJrbm45SDRUU0NTc01sdUgiLCJhdWQiOiJodHRwczovL2xvZ2luLnRlc3QxLnBjLXJuZC5zYWxlc2ZvcmNlLmNvbSIsImV4cCI6IjE3NDczMTQxOTUifQ.p39J8N52KrVhWpxpXazoS8CHzcw2-2CcNiNSQcMV5IUy2-uruZN2zR2hFRE_ZTGNOREWEUs0tRa2ddQNM3ur262reOGs78gMz6MKkFpfsOc_lcSSkwKOx5dwHjj8Q08AoRNLej8QjoXDBG3mDoG0ILqrGc0z8_kqe3MEbK7jYaCsLarp_KC5RSgqVaRVLlZ6Ujc3qOlFUtnMgOCwt6aE1Q1E6NSSX69bpiG1v5qsGGVD9G4Wf815H4zASzCq-wL0XrB_IFm5j-jiuc9_PFGlqVLMwpLWXpt9-MePIAycCy13fyCh2BuxbLHN7otU-NIyQysmt9Hh711oZ8jbC-hPiw

```

**note:** Refer to [OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration](https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm) for creating a JWT assertion.

**Response Format**

This example shows a response from Salesforce.

```nolang
{
"access_token":"00DSB00000Mjbpy!AQEAQL7yNSYYLEiUMmSv.AOe.JrwjKN_vqbwCbzeJDDtNpXqW0PsN2wOBMy83vkrn2ffryoCRC3P8pCSRd45c_mHeaKJujb0",
"scope":"cdp_query_api cdp_ingest_api api",
"instance_url":"https://mycompany.my.salesforce.com/services/a360/token",
"id":"https://login.test1.pc-rnd.salesforce.com/id/00DSB00000Mjbpy2AB/005SB00000HenY6YAJ",
"token_type":"Bearer"
}
```

**Exchanging Salesforce Access Token for Data 360 Access Token**

Now that you've acquired the Salesforce access token, use it to get the Data 360 access token to invoke the Ingestion API.

This example shows a request for Data 360 access token. From the response received while acquiring the Salesforce access token, use the instance_url for POST and use the access_token for the subject_token.

```nolang

POST https://mycompany.my.salesforce.com/services/a360/token
Content-Type: application/x-www-form-urlencoded
grant_type=urn:salesforce:grant-type:external:cdp
&subject_token=00DSB00000Mjbpy!AQEAQL7yNSYYLEiUMmSv.AOe.JrwjKN_vqbwCbzeJDDtNpXqW0PsN2wOBMy83vkrn2ffryoCRC3P8pCSRd45c_mHeaKJujb0
&subject_token_type=urn:ietf:params:oauth:token-type:access_token

```

This example shows a sample response.

```nolang
{
"access_token":"eyJraWQiOiJDT1JFLjAwRFNCMDAwMDBNamJweS4xNzQzODMwMzEyOTA4IiwidHlwIjoiSldUIiwiYWxnIjoiRVMyNTYifQ.eyJzdWIiOiJodHRwczovL2xvZ2luLnRlc3QxLnBjLXJuZC5zYWxlc2ZvcmNlLmNvbS9pZC8wMERTQjAwMDAwTWpicHkyQUIvMDA1U0IwMDAwMEhlblk2WUFKIiwic2NwIjoiY2RwX2luZ2VzdF9hcGkgY2RwX3F1ZXJ5X2FwaSIsImlzcyI6Imh0dHBzOi8vbG9naW4udGVzdDEucGMtcm5kLnNhbGVzZm9yY2UuY29tLyIsIm9yZ0lkIjoiMDBEU0IwMDAwME1qYnB5IiwiaXNzdWVyVGVuYW50SWQiOiJjb3JlL2ZhbGNvbnRlc3QxLWNvcmU0c2RiMy8wMERTQjAwMDAwTWpicHkyQUIiLCJzZmFwcGlkIjoiM01WRzlsM1I5RjltSE9HYUd1ZU0zU082blpleFlKcktKUWRhVmllejEwVnFZc0I5SVhEU2p1OGRodkpaNWphWlRFX2Z1YmtubjlINFRTQ1NzTWx1SCIsImF1ZGllbmNlVGVuYW50SWQiOiJhMzYwL2ZhbGNvbnRlc3QvNzE2N2QyOTRjZWFmNDFjM2IyMWZjNzFlOTU5MjczMDMiLCJjdXN0b21fYXR0cmlidXRlcyI6eyJkYXRhc3BhY2UiOiJkZWZhdWx0IiwidXNlci1pZCI6IjAwNVNCMDAwMDBIZW5ZNiIsInN5c3RlbS1jb250ZXh0IjoidHJ1ZSJ9LCJhdWQiOiJhcGkuYTM2MC5zYWxlc2ZvcmNlLmNvbSIsIm5iZiI6MTc0NzM5NDkxMiwic2ZvaWQiOiIwMERTQjAwMDAwTWpicHkiLCJzZnVpZCI6IjAwNVNCMDAwMDBIZW5ZNiIsImV4cCI6MTc0NzQwMjE2OCwiaWF0IjoxNzQ3Mzk0OTcyLCJqdGkiOiIwZTM3NjJhMi05NDY3LTQ5MDktYTQ5NS0yZWVlYWU0ZjhlY2UifQ.vbDgiFAP19k5R-ilyCdRYS0eBD5Yg6DHBZHSqQxAee038VdpcJxj-b9_MtTGiyYaowW8oBy0lf7yb1q8zAlyFw",
"instance_url":"gnrdmpldh1zggzrtm74t8zrzg6.pc-rnd.c360a.salesforce.com",
"token_type":"Bearer",
"issued_token_type":"urn:ietf:params:oauth:token-type:jwt", "expires_in":7196
}
```

The instance url in the response is the [tenant specific endpoint](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-tenant-specific-endpoint.html) in the Data 360 ingestion api connector detail page. You can control the JWT “expires_in” time by setting the timeout value for the connected app. See [Manage Session Policies for a Connected App](https://help.salesforce.com/s/articleView?id=xcloud.connected_app_manage_session_policies.htm&type=5).

## Bulk Ingest API Limits

| Item                                                      | Description                                                                                                                                                 |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API usage limits                                          | After each request, your app must check the response code. The `HTTP 429 Too Many Requests`status code indicates the app must reduce its request frequency. |
| Bulk Job Retention Time                                   | Any open bulk jobs with the status of Open or Upload Complete that are older than 7 days, are deleted from the ingestion queue.                             |
| Maximum Number of Files per Job                           | You can upload one file at a time per bulk job. A job can have a maximum of 100 files.                                                                      |
| Maximum Payload size                                      | CSV files uploaded via Bulk API have a maximum size of 150 MB.                                                                                              |
| Number of Requests or Jobs Allowed per Hour               | 20                                                                                                                                                          |
| Number of Concurrent Requests or Jobs Allowed at One Time | 5                                                                                                                                                           |

## Streaming Ingest API Limits

| Item                                                                          | Description                                                                                                                                                  |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| API usage limits                                                              | After each request, your app must check the response code. The `HTTP 429 Too Many Requests` status code indicates the app must reduce its request frequency. |
| Expected Latency                                                              | Data is processed asynchronously approximately every 3 minutes.                                                                                              |
| Maximum Payload Size Per Request                                              | JSON data uploaded via Streaming API have a maximum body size of 200 KB per request                                                                          |
| Maximum Number of Records that can be Deleted                                 | You can delete a maximum of 200 records via Streaming API.                                                                                                   |
| Total Number of Requests per Second Across All Ingestion API Object Endpoints | 250 requests                                                                                                                                                 |

**note:** Ingestion API uses eventual consistency. After bulk or streaming data is ingested, allow a minimum of 30 seconds for internal caches to refresh before the data becomes available to query in Data 360.

## Status Codes and Error Responses

| HTTP Response Code        | Description                                                                                                                   |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| 200 OK                    | Request succeeded.                                                                                                            |
| 201 Created               | Indicates that the resource was successfully created.                                                                         |
| 202 Accepted              | The request was accepted and the data will be processed asynchronously.                                                       |
| 204 No Content            | Job was successfully deleted.                                                                                                 |
| 400 Bad Request           | Server can’t process the request due to client error. Possible causes are a malformed request syntax or invalid request body. |
| 401 Unauthorized          | Authentication failed because the JWT is invalid or expired. Refresh the token.                                               |
| 404 Not Found             | Client error: the requested resource doesn’t exist.                                                                           |
| 409 Conflict              | Client error: unable to update the job state given its status.                                                                |
| 429 Conflict              | The user has sent too many requests in a given amount of time. Implement a back-off policy to reduce the number of requests.  |
| 500 Internal Server Error | Internal server error. Retry the request.                                                                                     |

## Data Upload Limits

- For streaming: Small payloads (up to 200 KB per single request)
- For bulk: Large CSVs up to 150 MB

**note:** For guidance on overall limitations view [Data 360 Limits and Guidelines](https://help.salesforce.com/s/articleView?id=data.c360_a_limits_and_guidelines.htm&type=5).

- [**Streaming Ingestion Walkthrough**](https://developer.salesforce.com/docs/data/data-cloud-int/references/data-cloud-ingestionapi-ref/c360-a-api-streaming-insert-example.md)

  Use this walkthrough to understand the steps for loading records using streaming ingestion.

- [**Bulk Ingestion Walkthrough**](https://developer.salesforce.com/docs/data/data-cloud-int/references/data-cloud-ingestionapi-ref/c360-a-api-bulk-insert-example.md)

  This walkthrough guides you through the steps for loading records using bulk ingestion.

**See Also**

- [_Data Cloud Developer Guide_: Quick Start](https://developer.salesforce.com/docs/data/data-cloud-dev/guide/dc-quick-start.html)
