MENU navbar-image

Introduction

ERD tool for Mysql and Postgres

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Authentication

POST api/register

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\",
    \"password\": \"Secret1!\"
}"
const url = new URL(
    "https://sql-designer.com/api/register"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "user@example.com",
    "password": "Secret1!"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/register

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

The user's email address. Must be unique. Example: user@example.com

password   string     

The password. Min 8 chars, mixed case and numbers required. Example: Secret1!

POST api/login

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\",
    \"password\": \"secret\"
}"
const url = new URL(
    "https://sql-designer.com/api/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "user@example.com",
    "password": "secret"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/login

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

The user's email address. Example: user@example.com

password   string     

The user's password. Example: secret

POST api/logout

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/logout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/logout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/logout

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

POST api/email/resend

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/email/resend" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/email/resend"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/email/resend

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Diagrams

Sharing

GET api/diagrams/embed/{token}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/embed/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/embed/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (404):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "No query results for model [App\\Models\\Diagram]."
}
 

Request      

GET api/diagrams/embed/{token}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

token   string     

Example: consequatur

GET api/diagrams/shared/{token}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/shared/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/shared/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/shared/{token}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

token   string     

Example: consequatur

PATCH api/diagrams/shared/{token}

requires authentication

Example request:
curl --request PATCH \
    "https://sql-designer.com/api/diagrams/shared/consequatur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/shared/consequatur"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/diagrams/shared/{token}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

token   string     

Example: consequatur

POST api/diagrams/{diagram_id}/share

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams/3/share" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/share"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/diagrams/{diagram_id}/share

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

DELETE api/diagrams/{diagram_id}/share

requires authentication

Example request:
curl --request DELETE \
    "https://sql-designer.com/api/diagrams/3/share" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/share"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/diagrams/{diagram_id}/share

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

PATCH api/diagrams/{diagram_id}/share

requires authentication

Example request:
curl --request PATCH \
    "https://sql-designer.com/api/diagrams/3/share" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/share"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/diagrams/{diagram_id}/share

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

GET api/diagrams/{diagram_id}/visitors

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/3/visitors" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/visitors"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/{diagram_id}/visitors

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

POST api/diagrams/{diagram_id}/visitors/{visitor_id}/approve

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams/3/visitors/2/approve" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/visitors/2/approve"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/diagrams/{diagram_id}/visitors/{visitor_id}/approve

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

visitor_id   integer     

The ID of the visitor. Example: 2

PATCH api/diagrams/{diagram_id}/visitors/{visitor_id}

requires authentication

Example request:
curl --request PATCH \
    "https://sql-designer.com/api/diagrams/3/visitors/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/visitors/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Request      

PATCH api/diagrams/{diagram_id}/visitors/{visitor_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

visitor_id   integer     

The ID of the visitor. Example: 2

CRUD

GET api/diagrams

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/diagrams/{diagram_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

POST api/diagrams

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"My ERD\",
    \"db_type\": \"postgresql\"
}"
const url = new URL(
    "https://sql-designer.com/api/diagrams"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "My ERD",
    "db_type": "postgresql"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/diagrams

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

name   string  optional    

The diagram name. Must be unique per user. Example: My ERD

db_type   string  optional    

The database type. Allowed: mysql, postgresql. Example: postgresql

PUT api/diagrams/{diagram_id}

requires authentication

Example request:
curl --request PUT \
    "https://sql-designer.com/api/diagrams/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"My ERD\",
    \"db_type\": \"postgresql\"
}"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "My ERD",
    "db_type": "postgresql"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/diagrams/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

Body Parameters

name   string  optional    

The diagram name. Must be unique per user. Example: My ERD

db_type   string  optional    

The database type. Allowed: mysql, postgresql. Example: postgresql

DELETE api/diagrams/{diagram_id}

requires authentication

Example request:
curl --request DELETE \
    "https://sql-designer.com/api/diagrams/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/diagrams/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

SQL

POST api/diagrams/sql/import/{diagram_id}

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams/sql/import/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/sql/import/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/diagrams/sql/import/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

GET api/diagrams/sql/import-status/{diagram_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/sql/import-status/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/sql/import-status/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/sql/import-status/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

POST api/diagrams/sql/export/{diagram_id}

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams/sql/export/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/sql/export/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/diagrams/sql/export/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

GET api/diagrams/sql/export-status/{diagram_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/sql/export-status/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/sql/export-status/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/sql/export-status/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

GET api/diagrams/json/export/{diagram_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/json/export/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/json/export/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/json/export/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

GET api/diagrams/migration/export/{diagram_id}

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/migration/export/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/migration/export/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/migration/export/{diagram_id}

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

Changelog

GET api/diagrams/{diagram_id}/changelog

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/diagrams/3/changelog" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/changelog"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/diagrams/{diagram_id}/changelog

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

POST api/diagrams/{diagram_id}/changelog

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/diagrams/3/changelog" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"action\": \"vmqeopfuudtdsufvyvddq\"
}"
const url = new URL(
    "https://sql-designer.com/api/diagrams/3/changelog"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "action": "vmqeopfuudtdsufvyvddq"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/diagrams/{diagram_id}/changelog

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

diagram_id   integer     

The ID of the diagram. Example: 3

Body Parameters

action   string     

Must not be greater than 100 characters. Example: vmqeopfuudtdsufvyvddq

details   object  optional    

Endpoints

POST api/feedback

requires authentication

Example request:
curl --request POST \
    "https://sql-designer.com/api/feedback" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\",
    \"message\": \"I love this tool!\"
}"
const url = new URL(
    "https://sql-designer.com/api/feedback"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "user@example.com",
    "message": "I love this tool!"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/feedback

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string  optional    

The sender's email address. Example: user@example.com

message   string     

The feedback message. Example: I love this tool!

GET api/user

requires authentication

Example request:
curl --request GET \
    --get "https://sql-designer.com/api/user" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://sql-designer.com/api/user"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};


fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: https://sql-designer.com
 

{
    "message": "Unauthenticated."
}
 

Request      

GET api/user

Headers

Content-Type        

Example: application/json

Accept        

Example: application/json