> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an API Endpoint

> Create or update an API endpoint with a full request body

# Update an API Endpoint

Create an API endpoint or update it if it already exists, using `PUT /v1/apiEndpoints` with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use `PATCH` with a JSON Patch array and the `application/json-patch+json` content type, as shown in the PATCH examples below.

## Body Parameters

**name** `string` *required*

Name of the API endpoint. Must be unique within the parent API collection.

**apiCollection** `string` *required*

Fully qualified name of the parent APICollection, for example `sample_api_service.pet`.

**endpointURL** `string`

URL for the API endpoint, for example `https://petstore3.swagger.io/#/pet/addPet`.

**requestMethod** `string`

HTTP request method: `GET`, `POST`, `PUT`, `PATCH`, or `DELETE`.

**requestSchema** `object`

Schema describing the request body.

**properties**

**schemaType** `string`

Type of schema, for example `JSON`.

**schemaFields** `array`

Array of field objects describing the schema.

**properties**

**name** `string`

Name of the field.

**dataType** `string`

Data type of the field, for example `INT`, `STRING`, `RECORD`.

**description** `string`

Description of the field.

**responseSchema** `object`

Schema describing the response body.

**properties**

**schemaType** `string`

Type of schema, for example `JSON`.

**schemaFields** `array`

Array of field objects describing the schema.

**properties**

**name** `string`

Name of the field.

**dataType** `string`

Data type of the field.

**description** `string`

Description of the field.

**displayName** `string`

Human-readable display name for the API endpoint.

**description** `string`

Description of the API endpoint in Markdown format.

**owners** `array`

Array of owner references (users or teams) to assign to the API endpoint.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the API endpoint.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**extension** `object`

Custom property values defined by your organization's metadata schema.

```bash PUT /v1/apiEndpoints theme={null}
curl -X PUT "{base_url}/api/v1/apiEndpoints" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "addPet",
    "displayName": "Add Pet",
    "apiCollection": "sample_api_service.pet",
    "description": "add a new pet",
    "endpointURL": "https://petstore3.swagger.io/#/pet/addPet",
    "requestMethod": "POST",
    "requestSchema": {
      "schemaType": "JSON",
      "schemaFields": [
        {"name": "id", "dataType": "INT", "description": "ID of pet"}
      ]
    }
  }'
```

```python PATCH /v1/apiEndpoints/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import APIEndpoints

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Retrieve, modify, and update
ep = APIEndpoints.retrieve("1f61427a-4a64-4070-9ac8-1d29302dac7c")
ep.description = "Updated: Add a new pet to the store inventory"
updated = APIEndpoints.update(ep)

print(f"Updated to version {updated.version.root}")
```

```java PATCH /v1/apiEndpoints/{id} theme={null}
import org.openmetadata.schema.entity.data.APIEndpoint;

// client is an initialized OpenMetadataClient.

// Retrieve, modify, and update
APIEndpoint ep = client.apiEndpoints().get("1f61427a-4a64-4070-9ac8-1d29302dac7c");
ep.setDescription("Updated: Add a new pet to the store inventory");
APIEndpoint updated = client.apiEndpoints().update("1f61427a-4a64-4070-9ac8-1d29302dac7c", ep);
```

```bash PATCH /v1/apiEndpoints/{id} theme={null}
# Update by ID
curl -X PATCH "{base_url}/api/v1/apiEndpoints/1f61427a-4a64-4070-9ac8-1d29302dac7c" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated: Add a new pet to the store inventory"}
  ]'

# Update by name
curl -X PATCH "{base_url}/api/v1/apiEndpoints/name/sample_api_service.pet.addPet" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json-patch+json" \
  -d '[
    {"op": "replace", "path": "/description", "value": "Updated: Add a new pet to the store inventory"}
  ]'
```

```json Response theme={null}
{
  "id": "1f61427a-4a64-4070-9ac8-1d29302dac7c",
  "name": "addPet",
  "displayName": "Add Pet",
  "fullyQualifiedName": "sample_api_service.pet.addPet",
  "description": "Updated: Add a new pet to the store inventory",
  "version": 0.2,
  "updatedAt": 1769982733987,
  "updatedBy": "admin",
  "endpointURL": "https://petstore3.swagger.io/#/pet/addPet",
  "requestMethod": "POST",
  "requestSchema": {
    "schemaType": "JSON",
    "schemaFields": [
      {"name": "id", "dataType": "INT", "description": "ID of pet"}
    ]
  },
  "href": "http://localhost:8585/api/v1/apiEndpoints/1f61427a-4a64-4070-9ac8-1d29302dac7c",
  "owners": [],
  "tags": [],
  "service": {
    "id": "58d413a8-abc3-4a6d-bd8a-13a0234b1ff8",
    "type": "apiService",
    "name": "sample_api_service",
    "deleted": false
  },
  "serviceType": "Rest",
  "deleted": false,
  "domains": []
}
```

***

## Returns

Returns the updated API endpoint object with the new version number.

## Response

**id** `string`

Unique identifier for the API endpoint (UUID format).

**name** `string`

API endpoint name.

**fullyQualifiedName** `string`

Fully qualified name in format `service.collection.endpointName`.

**description** `string`

Updated description.

**version** `number`

Incremented version number.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid or malformed request body |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to update this API endpoint |
| `409` | `CONFLICT` | Concurrent modification detected |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.