---
title: "Create Or Update Edge (saveEdge)"
method: POST
path: "/api/edge"
tags: ["edge-controller"]
---

# Create Or Update Edge (saveEdge)

`POST /api/edge`

Create or update the Edge. When creating edge, platform generates Edge Id as [time-based UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)). The newly created edge id will be present in the response. Specify existing Edge id to update the edge. Referencing non-existing Edge Id will cause 'Not Found' error.

Edge name is unique in the scope of tenant. Use unique identifiers like MAC or IMEI for the edge names and non-unique 'label' field for user-friendly visualization purposes.Remove 'id', 'tenantId' and optionally 'customerId' from the request body example (below) to create new Edge entity. 

Available for users with 'TENANT_ADMIN' authority.

## Request body

- Edge — A JSON value representing the edge.
  - `id` EdgeId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'EDGE', required — string
  - `createdTime` integer — Timestamp of the edge creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `customerId` CustomerId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'CUSTOMER', required — string
  - `rootRuleChainId` RuleChainId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'RULE_CHAIN', required — string
  - `name` string, required — Unique Edge Name in scope of Tenant
  - `type` string, required — Edge type
  - `label` string — Label that may be used in widgets
  - `routingKey` string, required — Edge routing key ('username') to authorize on cloud
  - `secret` string, required — Edge secret ('password') to authorize on cloud
  - `version` integer
  - `additionalInfo` unknown

## Response `200`

OK

- Edge — A JSON value representing the edge.
  - `id` EdgeId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'EDGE', required — string
  - `createdTime` integer — Timestamp of the edge creation, in milliseconds
  - `tenantId` TenantId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'TENANT', required — string
  - `customerId` CustomerId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'CUSTOMER', required — string
  - `rootRuleChainId` RuleChainId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'RULE_CHAIN', required — string
  - `name` string, required — Unique Edge Name in scope of Tenant
  - `type` string, required — Edge type
  - `label` string — Label that may be used in widgets
  - `routingKey` string, required — Edge routing key ('username') to authorize on cloud
  - `secret` string, required — Edge secret ('password') to authorize on cloud
  - `version` integer
  - `additionalInfo` unknown

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
