Create a new graph
POST/graphs
Create a new graph.
Request
- application/json
Body
required
- Array [
- ]
- Array [
- ]
name stringrequired
nodes object[]required
id number
name string
type string
orientation boolean
pose object
edges object[]required
id number
name string
type string
orientation boolean
pose object
bidirectional boolean
weight number
source number
target number
Responses
- 201
- 400
- 401
- 403
- 409
- 500
Graph created
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
- Array [
- ]
_id uuid
name string
nodes object[]
id number
name string
type string
orientation boolean
_id uuid
createdAt date-time
updatedAt date-time
edges object[]
id number
name string
orientation boolean
bidirectional boolean
type string
direction string
weight number
source number
target number
_id uuid
createdAt date-time
updatedAt date-time
createdAt date-time
updatedAt date-time
{
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"nodes": [
{
"id": 0,
"name": "string",
"type": "string",
"orientation": true,
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": "2025-06-05T13:40:40.747Z",
"updatedAt": "2025-06-05T13:40:40.747Z"
}
],
"edges": [
{
"id": 0,
"name": "string",
"orientation": true,
"bidirectional": true,
"type": "string",
"direction": "string",
"weight": 0,
"source": 0,
"target": 0,
"_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": "2025-06-05T13:40:40.747Z",
"updatedAt": "2025-06-05T13:40:40.747Z"
}
],
"createdAt": "2025-06-05T13:40:40.747Z",
"updatedAt": "2025-06-05T13:40:40.747Z"
}
Bad Request due to validation errors in the request body
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Validation failed.",
"errors": [
{
"field": "name",
"message": "Name is required."
},
{
"field": "nodes",
"message": "nodes can not be empty."
},
{
"field": "edges",
"message": "edges can not be empty."
}
]
}
{
"message": "Validation failed.",
"errors": [
{
"field": "name",
"message": "Name is required."
},
{
"field": "nodes",
"message": "nodes can not be empty."
},
{
"field": "edges",
"message": "edges can not be empty."
}
]
}
Unauthorized.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Authentication token not provided."
}
{
"message": "Authentication token not provided."
}
Forbidden.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Access to this resource is forbidden."
}
{
"message": "Access to this resource is forbidden."
}
A graph with the given details already exists.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "A graph with the given details already exists."
}
{
"message": "A graph with the given details already exists."
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
- Example
Schema
- any
{
"message": "Internal Server Error. Please try again later."
}
{
"message": "Internal Server Error. Please try again later."
}
Loading...