> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Get a Context Graph ask

GET https://api.postman.com/context-graph/asks/{askId}

Gets a submitted ask's status and, once the ask completes, its result.

Poll this endpoint after submitting an ask. The `status` property is `pending` or `running` while the ask is in progress, and `completed` or `failed` once it reaches a terminal state. The `result` property is only present once `status` is `completed`.


Reference: https://learning.postman.com/api-docs/api-reference/context-graph/get-context-graph-ask

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `askId` (string, required) — The ask's ID.

## Response

### 200

Successful Response

- `askId` (string, required) — The ask's ID.
- `status` (enum, required) — The ask's lifecycle state.
  - Allowed values: `pending`, `running`, `completed`, `failed`
- `question` (string, required) — The natural-language question that was asked.
- `revision` (integer, required, nullable) — The graph revision the ask was evaluated against.
- `createdAt` (datetime, required) — The date and time the ask was submitted, in ISO 8601 format.
- `completedAt` (datetime, optional, nullable) — The date and time the ask reached a terminal state, in ISO 8601 format. This value is `null` until the ask is `completed` or `failed`.
- `error` (string, optional, nullable) — A short reason the ask failed, such as the ask having timed out. This property is only present if `status` is `failed`.
- `result` (object, optional) — The ask's result. This property is only present if `status` is `completed`.
  - `provenance` (object, required) — Information about how the ask reached its answer.
    - `revision` (integer, required) — The graph revision the ask ran against.
    - `steps` (list of object, required) — The ordered tool calls the ask made to reach its answer.
      - `tool` (string, required) — The name of the read-only tool that was called.
      - `type` (string, optional) — The preset query type the tool was called with. This property is only present if the tool was called with one.
      - `rowCount` (integer, optional) — The number of rows the tool returned.
      - `error` (string, optional) — The error message for this step. This property is only present if the step failed.
    - `truncated` (boolean, optional) — Whether the ask reached its deadline and returned a partial result.
  - `citations` (list of map from string to any, required) — The graph entities the answer is grounded in. The shape of each item varies with the entity's kind.
  - `usage` (object, required) — A summary of the resources the ask consumed.
    - `steps` (integer, required) — The number of tool calls the ask made.
    - `outputTokens` (integer, optional) — The number of LLM output tokens the ask consumed. This property is only present if the value is known.
  - `answer` (string, optional, nullable) — The natural-language answer to the question. This value is `null` if `includeAnswer` was `false` in the request.
  - `structured` (map from string to any, optional) — The graph data the answer rests on. The shape of this object varies with the question.

## Errors

### 401 Unauthorized Error

Unauthorized

- `object or object`
  - Error (Type, Title, Detail, Status)
    - `type` (string or string, optional) — The type of error.
    - `title` (string, optional) — A short summary of the problem.
    - `detail` (string, optional) — Information about the error.
    - `status` (integer, optional) — The error's HTTP status code.
  - Error (Name, Message)
    - `error` (object, optional) — Information about the error.
      - `name` (string, optional) — The error name.
      - `message` (string, optional) — The error message.

### 403 Forbidden Error

Forbidden

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 404 Not Found Error

Not Found

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 429 Too Many Requests Error

Too Many Requests

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### 500 Internal Server Error

Internal Server Error

- `object or object or object`
  - Error (Type, Title, Detail)
    - `type` (string, optional) — The type of error.
    - `title` (string, optional) — A short summary of the problem.
    - `detail` (string or map from string to any, optional) — Information about the error.
  - Error (Type, Title, Detail, Status)
    - `type` (string or string, optional) — The type of error.
    - `title` (string, optional) — A short summary of the problem.
    - `detail` (string, optional) — Information about the error.
    - `status` (integer, optional) — The error's HTTP status code.
  - Error (Name, Message)
    - `error` (object, optional) — Information about the error.
      - `name` (string, optional) — The error name.
      - `message` (string, optional) — The error message.

## Examples

### Completed Ask

**Response**

```json
{
  "askId": "01a03dd2-114a-766f-820b-4209e4fc78d2",
  "status": "completed",
  "question": "What endpoints does authentication-service expose?",
  "revision": 1,
  "createdAt": "2026-08-26T11:26:12.000Z",
  "completedAt": "2026-08-26T11:26:28.000Z",
  "result": {
    "provenance": {
      "revision": 1,
      "steps": [
        {
          "tool": "run_typed_query",
          "type": "api-detail"
        },
        {
          "tool": "run_cypher",
          "rowCount": 31
        }
      ]
    },
    "citations": [
      {
        "api_name": "authentication-service"
      },
      {
        "path": "/api/auth/logout"
      }
    ],
    "usage": {
      "steps": 2,
      "outputTokens": 707
    },
    "answer": "The authentication-service exposes 31 endpoints, organized into health checks, public auth, handover and token exchange, certificate management, and internal auth-scheme management.",
    "structured": {
      "entities": [
        {
          "name": "authentication-service",
          "type": "api"
        }
      ]
    }
  }
}
```

**SDK Code**

```python Completed Ask
import requests

url = "https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Completed Ask
const url = 'https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Completed Ask
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Completed Ask
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Completed Ask
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Completed Ask
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Completed Ask
using RestSharp;

var client = new RestClient("https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Completed Ask
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/context-graph/asks/01a03dd2-114a-766f-820b-4209e4fc78d2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Running Ask

**Response**

```json
{
  "askId": "01a03dd2-0d99-766e-b3df-e36dcaaee706",
  "status": "running",
  "question": "Which APIs are in the graph and what does each expose?",
  "revision": 1,
  "createdAt": "2026-08-26T11:20:00.000Z",
  "completedAt": null
}
```

**SDK Code**

```python Running Ask
import requests

url = "https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Running Ask
const url = 'https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Running Ask
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Running Ask
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Running Ask
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Running Ask
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Running Ask
using RestSharp;

var client = new RestClient("https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Running Ask
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/context-graph/asks/01a03dd2-0d99-766e-b3df-e36dcaaee706")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```