---
title: "Update a prompt"
description: "Update prompt metadata such as its name or description."
---

<a id="playground-button:docs/apis/prompts/update-prompt"></a>

**PATCH** `https://api.respan.ai/api/prompts/{prompt_id}/`

Update prompt metadata such as its name or description.

## Servers

`https://api.respan.ai`: Respan API Server

<a id="request.auth"></a>

## Authentication

<a id="request.auth.Authorization"></a>

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


**Or:**

### DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: `bearer`; format: `Dashboard JWT`.


```http
Authorization: Bearer $RESPAN_DASHBOARD_JWT
```


<a id="request.path"></a>

## Path parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="request.path.prompt_id"></a>`prompt_id` | `string` | Required | The unique prompt identifier. |


<a id="request"></a>

## Request body

A request body is required.

### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | - |
| <a id="request.body.name"></a>`name` | `string` | Optional | Updated prompt name.<br />Example: `"enhanced_customer_support"` |
| <a id="request.body.description"></a>`description` | `string` | Optional | Updated prompt description.<br />Example: `"Improved version with better context handling"` |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Updated prompt name.",
      "example": "enhanced_customer_support"
    },
    "description": {
      "type": "string",
      "description": "Updated prompt description.",
      "example": "Improved version with better context handling"
    }
  }
}
```

</details>

<a id="response"></a>

## Responses

### 200

Prompt updated successfully.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Example: `{"id":"prompt_abc123","name":"Enhanced Customer Support Assistant","description":"Improved version with better context handling","updated_at":"2026-01-21T12:30:00Z"}` |
| <a id="response.body.id"></a>`id` | `string` | Optional | - |
| <a id="response.body.name"></a>`name` | `string` | Optional | - |
| <a id="response.body.description"></a>`description` | `string or null` | Optional | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string",
      "nullable": true
    }
  },
  "example": {
    "id": "prompt_abc123",
    "name": "Enhanced Customer Support Assistant",
    "description": "Improved version with better context handling",
    "updated_at": "2026-01-21T12:30:00Z"
  }
}
```

</details>

<a id="response.error"></a>

### 400

Bad Request

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `error` | `string` | Optional | Example: `"Validation error"` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "example": "Validation error"
    }
  }
}
```

</details>

### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 404

Prompt not found

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Prompt not found"
}
```


## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Update a prompt",
  "operationId": "updatePrompt",
  "tags": [
    "Prompts"
  ],
  "description": "Update prompt metadata such as its name or description.",
  "parameters": [
    {
      "name": "prompt_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The unique prompt identifier."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Updated prompt name.",
              "example": "enhanced_customer_support"
            },
            "description": {
              "type": "string",
              "description": "Updated prompt description.",
              "example": "Improved version with better context handling"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Prompt updated successfully.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string",
                "nullable": true
              }
            },
            "example": {
              "id": "prompt_abc123",
              "name": "Enhanced Customer Support Assistant",
              "description": "Improved version with better context handling",
              "updated_at": "2026-01-21T12:30:00Z"
            }
          }
        }
      }
    },
    "400": {
      "description": "Bad Request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "example": "Validation error"
              }
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "Prompt not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Prompt not found"
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
