Making a GraphQL request in the integration builder for AI agents

<div class="article-banners">
<div id="docs-wmp-link"><a href="https://support.zendesk.com/hc/en-us/articles/5411234991258-plan" rel="noopener noreferrer" target="_blank">What's my plan?</a></div>
<div class="article-banner" id="suite_all"><figure class="wysiwyg-table wysiwyg-table-align-left"><table><tbody><tr>
<td><strong>All Suites</strong></td>
<td>Team, Growth, Professional, Enterprise, or Enterprise Plus</td>
</tr></tbody></table></figure></div>
<div class="article-banner" id="support_all"><figure class="wysiwyg-table wysiwyg-table-align-left"><table><tbody><tr>
<td><strong>Support</strong></td>
<td>Team, Professional, or Enterprise</td>
</tr></tbody></table></figure></div>
</div><div class="body">

<p>While REST APIs have long been a standard for enabling integrations, GraphQL is rapidly gaining traction due to its flexibility and efficiency. You can leverage the integration builder's features to integrate with GraphQL APIs. You can take advantage of GraphQL’s key features, such as requesting only the data you need and handling complex queries with ease.</p>
<p>In this article, we’ll walk you through the process of setting up a GraphQL request using the integration builder, from understanding the GraphQL schema to constructing queries and integrating responses into your conversations.</p>
<p><strong>To set up a GraphQL request</strong></p>
<ol>
<li data-list-item-id="e9a1a57480457a6d91220d49a2672c07b">Find the GraphQL endpoint URL, usually provided by the API documentation (for example, https://api.example.com/graphql or for Shopify: https://{{storeName}}.myshopify.com/admin/api/2023-04/graphql.json).</li>
<li data-list-item-id="e88f20f3bad091b11ffe67427881d91ce">Add it to the integration builder interface.<ol>
<li data-list-item-id="e8d7ee983c181315b4bd64440848a5dc8">Navigate to Environments and select the POST method type (if you are requesting data).</li>
<li data-list-item-id="e771a0af676185d1419b635832b02eb56">Add your GraphQL endpoint into the URL input.<br><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aiaa_graphql_1.png" width="600">
</li>
</ol>
</li>
<li data-list-item-id="eb5ca6c6f8d30a6660401bef9652a0b62">Select your authentication method (if required).</li>
<li data-list-item-id="e4d5b16bc3f3d6b7de008783d77e6aeca">If needed, add your credentials to the headers. For example, if it’s a Shopify integration, it will look like this:<br><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aiaa_graphql_2.png" width="600">
</li>
<li data-list-item-id="e9fa9d4262408289444faa7a32a35e9a7"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;">Understand the GraphQL Schema to select the data that you want returned from the server.</span></li>
<li data-list-item-id="e6762359e6425303164e2c871a0d3daae">Obtain the schema from the GraphQL server.<br><br>It defines the available queries, mutations, and types. Use tools like Postman, GraphiQL or Apollo Explorer to inspect the schema, and to test and refine the query.<br><br>We recommend obtaining the query from Postman by navigating to the Code snippet tab and checking for data where you should see an object with the key “query”. Copy the object to use in the next step.<br><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aiaa_graphql_3.png" width="600">
</li>
<li data-list-item-id="e881e982d27383885f59916255d469f4a">In the Body tab, add the GraphQL query specifying the data you need or the action you want to perform (if making a mutation request to modify data; create, update, delete).<br>This must be in JSON format.<br>Example query:<br>```{"query":"{\n __type(name: \"Order\") {\n name,\n fields {\n name\n type {\n name\n kind\n }\n }\n }\n}","variables":{}}```<br><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aiaa_graphql_4.png" width="600">
</li>
<li data-list-item-id="e0d846a10ea03ecc81520d2e47700999b">Navigate to the Success scenario to add your session parameters.</li>
<li data-list-item-id="ea7b3afc29dc0a0f5aa392cd0a19bcefd">Using JSONata, write your queries to access and transform (if needed) the data in the response. See below for an example:<br><img src="https://zen-marketing-documentation.s3.amazonaws.com/docs/en/aiaa_graphql_5.png" width="600">
</li>
</ol>
<p> </p>
<script id="docs-schema-markup" type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"@id": "https://support.zendesk.com/hc/en-us/articles/8920184187034",
"url": "https://support.zendesk.com/hc/en-us/articles/8920184187034-Making-a-GraphQL-request-in-the-integration-builder-for-advanced-AI-agents",
"headline": "Making a GraphQL request in the integration builder for advanced AI agents",
"description": "You can set up a GraphQL request in the integration builder by configuring the endpoint, authentication, and query to retrieve or modify data based on the GraphQL schema and handle the response with JSONata.",
"articleSection": "Integrating other platforms with advanced AI agents",
"datePublished": "2025-02-19T18:46:31+00:00",
"dateModified": "2025-09-05T23:12:39+00:00",
"inLanguage": "en-US",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://support.zendesk.com/hc/en-us/articles/8920184187034"
},
"author": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"publisher": {
"@type": "Organization",
"name": "Zendesk",
"@id": "https://www.zendesk.com"
},
"isPartOf": {
"@type": "WebSite",
"name": "Zendesk Help",
"@id": "https://support.zendesk.com/hc/"
},
"about": {
"@type": "SoftwareApplication",
"name": "Zendesk",
"@id": "https://www.zendesk.com",
"softwareAddOn": {
"@type": "SoftwareApplication",
"name": "AI agents",
"@id": "https://support.zendesk.com/hc/en-us/sections/8988994355994"
}
}
}
</script>
</div>