---
schema_version: "1"
id: ee60637b9d14e18866a9d2e6c372e41fdca34fd6e866fc9b809eeb533d49898e
title: Query Objects in Marketing Cloud Next Using Bulk API 2.0
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/mc-core/guide/mc-manage-objects/mc-manage-objects-query/mc-manage-objects-query-bulk.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-bulk.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7f8cebf858630690441ca974faf2fba2de8aab846bc75712e92f678057bed3bf
products:
  - Marketing Cloud Next
  - Marketing Cloud
---
# Query Objects in Marketing Cloud Next Using Bulk API 2.0

For complex queries, or queries that you expect to produce a large set of results, use Bulk API 2.0. Bulk API 2.0 executes queries asynchronously.

## Prerequisite

Before you issue a query request, create a SOQL statement that specifies the data that you want to retrieve. Remove any line breaks from your SOQL statement. For more information, see [Understand SOQL Queries](https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-query-soql.md).

**note:** Bulk queries don’t support the complete set of SOQL clauses and functions. For more information, see [Create a Query Job](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_create_job.htm) in the _Bulk API 2.0 and Bulk API Developer Guide_.

## Step 1: Create a Bulk Query Job

To create a bulk query job, issue a POST request to the `/services/data/{apiVersion}/jobs/query` endpoint. For more information about the properties of the request body, see [Create a Query Job](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/query_create_job.htm) in the _Bulk API 2.0 and Bulk API Developer Guide_.

```json
POST /services/data/{apiVersion}/jobs/query HTTP/1.1
Host: YOUR_SUBDOMAIN.my.salesforce.com
Content-Type: application/json
Authorization: Bearer YOUR_BEARER_TOKEN

{
  "operation" : "query",
  "query" : "SELECT Id, FirstName, LastName, MailingCountry FROM Contact WHERE MailingCountry = 'US'",
  "contentType" : "CSV",
  "columnDelimiter" : "COMMA",
  "lineEnding" : "LF"
}
```

If the request is successful, the response includes the job ID (`id`), which you use to check the status of the request and to retrieve the resulting data.

```json
{
  "id": "7501Q00001CfAxxQAF",
  "operation": "query",
  "object": "Contact",
  "createdById": "0051Q00000booXXQAI",
  "createdDate": "2024-01-18T22:19:31.000+0000",
  "systemModstamp": "2024-01-18T22:19:31.000+0000",
  "state": "UploadComplete",
  "concurrencyMode": "Parallel",
  "contentType": "CSV",
  "apiVersion": 60.0,
  "lineEnding": "LF",
  "columnDelimiter": "COMMA"
}
```

## Step 2: Check the Status of the Query

To check the status of a bulk query, issue a GET request to the `/data/{apiVersion}/jobs/query/JOB_ID` endpoint, replacing `JOB_ID` with the unique ID of the query job.

```json
{
  "id": "7501Q00001CfAdyQAF",
  "operation": "query",
  "object": "Contact",
  "createdById": "0051Q00000bogY5QAI",
  "createdDate": "2024-01-18T22:25:23.000+0000",
  "systemModstamp": "2024-01-18T22:25:24.000+0000",
  "state": "JobComplete",
  "concurrencyMode": "Parallel",
  "contentType": "CSV",
  "apiVersion": 60.0,
  "jobType": "V2Query",
  "lineEnding": "LF",
  "columnDelimiter": "COMMA",
  "numberRecordsProcessed": 2,
  "retries": 0,
  "totalProcessingTime": 341,
  "isPkChunkingSupported": false
}
```

When the status of the query job is `JobComplete`, the query has finished running and your data is ready to retrieve.

## Step 3: Retrieve the Results

To retrieve the query results, issue a GET request to the `/data/{apiVersion}/jobs/query/JOB_ID/results` endpoint.

If the request is successful, the response includes the resulting data in the requested format, as shown in this example.

```
"Id","FirstName","LastName","MailingCountry"
"0031Q00002joOXXQAM","Rachel","Rodriquez","US"
"0031Q00002joOXXQAU","Linda","Rosenberg","US"
```
