Was this helpful?


API Platform Base Path: https://api.enterprise.apigee.com/v1/o/{org_name}

API Resource Path:

/environments/{env_name} /apis/{api_name}/revisions/{revision_number}/debugsessions

Description: Creates a debug session on Apigee

Verb: POST
Auth: Basic Auth
Media types:


A debug session records detailed information on messages, the Flow processing, and policy execution during processing by an API proxy.

The data returned in the debug session is a single XML or JSON representation of all debug data for each message exchange. The debug data is the same as that used to generate the 'Trace' view in the Management UI.

A debug session captures a maximum of 10 messages or records for a maximum for 2 minutes (by default), whichever comes first.

NOTE: In this API call, /organizations cannot be abbreviated as /o.

Debugging involves the following steps:

1. Start a debug session by creating a debug session

2. Send a message for that deployed API proxy.

3. Retrieve the debug data associated with the debug session. The data can be fetched by issuing a GET call on the session.

4 Close the debug session. (Closing the debug session discards all the associated data)

Sample Request:
$ curl -H "Content-type:application/octet-stream" -X POST https://api.enterprise.apigee.com/v1/organizations/{org_name}/environments/{env_name}/apis/{api_name}/revisions/{revision_number}/debugsessions?"session=MySession" \
-u myname:mypass
Query Parameters:
Name Description Default Required?
session The user-given name of the debug session (used to retrieve the results after debugging completes). N/A Yes
timeout The time in seconds after which the particular session should be discarded. Default is 120 seconds. 120 (seconds) No
Sample Response:
  "matchingHeaders" : {
  "matchingQParams" : {
  "name" : "MySession"
  "code" : "distribution.NotDeployed",
  "message" : "Revision 5 of APIProxy weatherapi is not deployed to the environment test",
  "contexts" : [ ]

Add new comment

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.