Update prompt
You can update a prompt by sending a PATCH request to the prompt endpoint. The request should include the name of the prompt and an optional description.
- `name` *string*: The name of the prompt.
- `description` *string*: Description of the prompt
```Python Python
url = "https://api.respan.ai/api/prompts/{prompt_id}/"
api_key = "YOUR_RESPAN_API_KEY" # Replace with your actual Respan API key
data = {
"name": "Your Prompt Name",
"description": "Your Prompt Description"
}
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
```
```TypeScript TypeScript
// Define the function with TypeScript
fetch('https://api.respan.ai/api/prompts/{prompt_id}/', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_RESPAN_API_KEY'
},
body: JSON.stringify({
name: "Your Prompt Name",
description: "Your Prompt Description"
})
})
.then(response => response.json())
.then(data => console.log(data));
```
Authentication
AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys
Path parameters
prompt_id
Prompt Id
Request
This endpoint expects an object.
Response
Successful response for Update prompt
Errors
401
Unauthorized Error