Stay organized with collections
Save and categorize content based on your preferences.
Create a new case and associate it with a parent.
It must have the following fields set: displayName, description, classification, and priority. If you're just testing the API and don't want to route your case to an agent, set testCase=true.
EXAMPLES:
cURL:
parent="projects/some-project"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Test case created by me.",
"description": "a random test case, feel free to close",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
"timeZone": "-07:00",
"subscriberEmailAddresses": [
"foo@domain.com",
"bar@domain.com"
],
"testCase": true,
"priority": "P3"
}' \
"https://cloudsupport.googleapis.com/v2/$parent/cases"
Python:
import googleapiclient.discovery
apiVersion = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=apiVersion,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}",
)
request = supportApiService.cases().create(
parent="projects/some-project",
body={
"displayName": "A Test Case",
"description": "This is a test case.",
"testCase": True,
"priority": "P2",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
},
)
print(request.execute())
HTTP request
POST https://cloudsupport.googleapis.com/v2/{parent=*/*}/cases
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-30 UTC."],[],[],null,["# Method: cases.create\n\nCreate a new case and associate it with a parent.\n\nIt must have the following fields set: `displayName`, `description`, `classification`, and `priority`. If you're just testing the API and don't want to route your case to an agent, set `testCase=true`.\n\nEXAMPLES:\n\ncURL: \n\n parent=\"projects/some-project\"\n curl \\\n --request POST \\\n --header \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"displayName\": \"Test case created by me.\",\n \"description\": \"a random test case, feel free to close\",\n \"classification\": {\n \"id\":\n \"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8\"\n },\n \"timeZone\": \"-07:00\",\n \"subscriberEmailAddresses\": [\n \"foo@domain.com\",\n \"bar@domain.com\"\n ],\n \"testCase\": true,\n \"priority\": \"P3\"\n }' \\\n \"https://cloudsupport.googleapis.com/v2/$parent/cases\"\n\nPython: \n\n import googleapiclient.discovery\n\n apiVersion = \"v2\"\n supportApiService = googleapiclient.discovery.build(\n serviceName=\"cloudsupport\",\n version=apiVersion,\n discoveryServiceUrl=f\"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}\",\n )\n request = supportApiService.cases().create(\n parent=\"projects/some-project\",\n body={\n \"displayName\": \"A Test Case\",\n \"description\": \"This is a test case.\",\n \"testCase\": True,\n \"priority\": \"P2\",\n \"classification\": {\n \"id\":\n \"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8\"\n },\n },\n )\n print(request.execute())\n\n### HTTP request\n\n`POST https://cloudsupport.googleapis.com/v2/{parent=*/*}/cases`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains an instance of [Case](/support/docs/reference/rest/v2/cases#Case).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Case](/support/docs/reference/rest/v2/cases#Case).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloudsupport`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]