Skip to main content
POST
https://sandbox.getcollate.io/api
/
v1
/
apiEndpoints
POST /v1/apiEndpoints
from metadata.sdk import configure
from metadata.sdk.entities import APIEndpoints
from metadata.generated.schema.api.data.createAPIEndpoint import CreateAPIEndpointRequest

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

request = CreateAPIEndpointRequest(
    name="addPet",
    displayName="Add Pet",
    apiCollection="sample_api_service.pet",
    description="Add a new pet to the store",
    endpointURL="https://petstore3.swagger.io/#/pet/addPet",
    requestMethod="POST",
    requestSchema={
        "schemaType": "JSON",
        "schemaFields": [
            {"name": "id", "dataType": "INT", "description": "ID of pet"}
        ]
    }
)

endpoint = APIEndpoints.create(request)
print(f"Created: {endpoint.fullyQualifiedName}")
{
  "id": "1f61427a-4a64-4070-9ac8-1d29302dac7c",
  "name": "addPet",
  "displayName": "Add Pet",
  "fullyQualifiedName": "sample_api_service.pet.addPet",
  "description": "add a new pet",
  "version": 0.1,
  "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": []
}

Create an API Endpoint

Create a new API endpoint within an API collection.

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 (e.g., sample_api_service.pet).
endpointURL
string
URL for the API endpoint (e.g., https://petstore3.swagger.io/#/pet/addPet).
requestMethod
string
HTTP request method: GET, POST, PUT, PATCH, or DELETE.
requestSchema
object
Schema describing the request body.
responseSchema
object
Schema describing the response body.
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.
domain
string
Fully qualified name of the domain to assign for governance purposes.
tags
array
Array of classification tags to apply to the API endpoint.
extension
object
Custom property values defined by your organization’s metadata schema.
POST /v1/apiEndpoints
from metadata.sdk import configure
from metadata.sdk.entities import APIEndpoints
from metadata.generated.schema.api.data.createAPIEndpoint import CreateAPIEndpointRequest

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

request = CreateAPIEndpointRequest(
    name="addPet",
    displayName="Add Pet",
    apiCollection="sample_api_service.pet",
    description="Add a new pet to the store",
    endpointURL="https://petstore3.swagger.io/#/pet/addPet",
    requestMethod="POST",
    requestSchema={
        "schemaType": "JSON",
        "schemaFields": [
            {"name": "id", "dataType": "INT", "description": "ID of pet"}
        ]
    }
)

endpoint = APIEndpoints.create(request)
print(f"Created: {endpoint.fullyQualifiedName}")
{
  "id": "1f61427a-4a64-4070-9ac8-1d29302dac7c",
  "name": "addPet",
  "displayName": "Add Pet",
  "fullyQualifiedName": "sample_api_service.pet.addPet",
  "description": "add a new pet",
  "version": 0.1,
  "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 created API endpoint object with all specified properties and system-generated fields.

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.
displayName
string
Human-readable display name.
description
string
Description of the API endpoint in Markdown format.
endpointURL
string
URL for the API endpoint.
requestMethod
string
HTTP request method (GET, POST, PUT, PATCH, DELETE).
requestSchema
object
Schema describing the request body.
responseSchema
object
Schema describing the response body.
service
object
Reference to the parent API service.
serviceType
string
Type of API service (e.g., Rest).
owners
array
List of owners assigned to the API endpoint.
domains
array
Domain assignments for governance.
tags
array
Classification tags applied to the API endpoint.
extension
object
Custom property values defined by your organization’s metadata schema.
version
number
Version number for the entity (starts at 0.1).

Create or Update (PUT)

Use PUT /v1/apiEndpoints instead of POST to perform an upsert. If an API endpoint with the same fullyQualifiedName already exists, it will be updated; otherwise, a new API endpoint is created. The request body is the same as POST.
curl -X PUT "{base_url}/api/v1/apiEndpoints" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
PUT will not return a 409 conflict error if the entity already exists — it will update the existing entity instead.

Bulk Create or Update (PUT)

Use PUT /v1/apiEndpoints/bulk to create or update multiple API endpoints in a single request. The request body is an array of create request objects.
curl -X PUT "{base_url}/api/v1/apiEndpoints/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "addPet", "apiCollection": "sample_api_service.pet", "requestMethod": "POST" },
    { "name": "getPet", "apiCollection": "sample_api_service.pet", "requestMethod": "GET" }
  ]'

Error Handling

CodeError TypeDescription
400BAD_REQUESTInvalid request body or missing required fields
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to create API endpoints
409ENTITY_ALREADY_EXISTSAPI endpoint with same name already exists in collection (POST only)