Secondbase API (1.0.0)

Download OpenAPI specification:

Auto-generated from Zod using zod-openapi

Authentication

Authenticate user and return JWT token.

Authenticate user and return JWT token.

Request Body schema: application/json
user
required
string non-empty
password
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "user": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}

Company

Create a new company.

Create a new company.

Request Body schema: application/json
name
required
string non-empty
nickname
string
type
required
string non-empty
parentCompanyId
string <uuid>
org
string
vat
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "nickname": "string",
  • "type": "string",
  • "parentCompanyId": "c1e0c60d-3cd3-459b-bc97-06b0e47f3958",
  • "org": "string",
  • "vat": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "subscription_status": true,
  • "subscription_date": "string",
  • "name": "string",
  • "nickname": "string",
  • "org": "string",
  • "vat": "string",
  • "type": "string",
  • "reseller": 0
}

List companies with optional filtering.

List companies with optional filtering.

query Parameters
parentCompanyId
string
limit
number ( 0 .. 100 ]
nextToken
string

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "nextToken": "string",
  • "total": 0
}

Delete a company.

Delete a company.

path Parameters
id
required
string

Responses

Update an existing company.

Update an existing company.

path Parameters
id
required
string <uuid>
Request Body schema: application/json
name
required
string non-empty
nickname
string
type
required
string non-empty
parentCompanyId
string <uuid>
org
string
vat
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "nickname": "string",
  • "type": "string",
  • "parentCompanyId": "c1e0c60d-3cd3-459b-bc97-06b0e47f3958",
  • "org": "string",
  • "vat": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "subscription_status": true,
  • "subscription_date": "string",
  • "name": "string",
  • "nickname": "string",
  • "org": "string",
  • "vat": "string",
  • "type": "string",
  • "reseller": 0
}

Get the overview document for a company.

Get the overview document for a company.

path Parameters
id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "subscription_status": true,
  • "subscription_date": "string",
  • "name": "string",
  • "nickname": "string",
  • "org": "string",
  • "vat": "string",
  • "type": "string",
  • "reseller": 0,
  • "resellers": [
    ],
  • "modules": {
    },
  • "users": [
    ],
  • "projects": [
    ]
}

Users

Create a new user under a company.

Create a new user under a company.

Request Body schema: application/json
companyId
required
string non-empty
fullName
string non-empty
email
required
string <email>
role
string
Default: "viewer"
Enum: "admin" "editor" "viewer"

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "fullName": "string",
  • "email": "user@example.com",
  • "role": "admin"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "companyId": "string",
  • "fullName": "string",
  • "email": "string",
  • "role": "admin",
  • "createdAt": "string",
  • "status": "active"
}

List users with optional filtering.

List users with optional filtering.

query Parameters
companyId
string
role
string
Enum: "admin" "editor" "viewer"
status
string
Enum: "active" "pending" "suspended" "inactive"
limit
number ( 0 .. 100 ]
nextToken
string

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "nextToken": "string",
  • "total": 0
}

Delete a user.

Delete a user.

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Update an existing user.

Update an existing user.

path Parameters
id
required
string
Request Body schema: application/json
userId
required
string non-empty
email
string <email>
firstName
string non-empty
lastName
string non-empty
role
string
Enum: "admin" "user" "viewer"
companyId
string
object

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "email": "user@example.com",
  • "firstName": "string",
  • "lastName": "string",
  • "role": "admin",
  • "companyId": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "item": {
    }
}

Login user and return JWT token.

Login user and return JWT token.

Request Body schema: application/json
email
required
string <email>
password
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Alternative login endpoint for users.

Alternative login endpoint for users.

Request Body schema: application/json
email
required
string <email>
password
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "user": {
    }
}

Verify user email with code and set password.

Verify user email with code and set password.

Request Body schema: application/json
userId
required
string non-empty
code
required
string non-empty
password
required
string >= 8 characters

Responses

Request samples

Content type
application/json
{
  • "userId": "string",
  • "code": "string",
  • "password": "stringst"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "verified": true
}

Get user information from JWT token.

Get user information from JWT token.

header Parameters
Authorization
required
string

Bearer JWT token

Responses

Response samples

Content type
application/json
{
  • "item": {
    }
}

Projects

Create a new project under a company.

Create a new project under a company.

Request Body schema: application/json
companyId
required
string non-empty
name
required
string non-empty
description
string
object

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "name": "string",
  • "description": "string",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "companyId": "string",
  • "name": "string",
  • "description": "string",
  • "settings": {
    },
  • "createdAt": "string",
  • "updatedAt": "string",
  • "status": "active"
}

List projects with optional filtering.

List projects with optional filtering.

query Parameters
companyId
string
status
string
Enum: "active" "archived" "draft"
limit
number ( 0 .. 100 ]
nextToken
string

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "nextToken": "string",
  • "total": 0
}

Update an existing project.

Update an existing project.

Request Body schema: application/json
projectId
required
string non-empty
name
string non-empty
description
string
status
string
Enum: "active" "inactive" "archived"
object

Responses

Request samples

Content type
application/json
{
  • "projectId": "string",
  • "name": "string",
  • "description": "string",
  • "status": "active",
  • "settings": {
    }
}

Response samples

Content type
application/json
{
  • "item": {
    }
}

Delete a project.

Delete a project.

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Pages

Create a new page under a project.

Create a new page under a project.

Request Body schema: application/json
projectId
required
string non-empty
type
required
string
Enum: "set" "page" "archive" "alias" "trash"
name
required
string non-empty
slug
string
parentId
string
aliasTargetId
string
index
integer

Responses

Request samples

Content type
application/json
{
  • "projectId": "string",
  • "type": "set",
  • "name": "string",
  • "slug": "string",
  • "parentId": "string",
  • "aliasTargetId": "string",
  • "index": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "type": "set",
  • "name": "string",
  • "parentId": "string",
  • "aliasTargetId": "string",
  • "createdAt": "string"
}

List pages for a company with optional filtering.

List pages for a company with optional filtering.

query Parameters
projectId
required
string
parent
number or null
target
number or null
open_root
boolean or null
open_target
boolean or null
search
string
limit
number > 0

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total": 0,
  • "hasMore": true
}

Update an existing page.

Update an existing page.

Request Body schema: application/json
pageId
required
string non-empty
projectId
required
string non-empty
name
string non-empty
slug
string
type
string
Enum: "set" "page" "archive" "alias" "trash"
parentId
string
aliasTargetId
string
index
integer

Responses

Request samples

Content type
application/json
{
  • "pageId": "string",
  • "projectId": "string",
  • "name": "string",
  • "slug": "string",
  • "type": "set",
  • "parentId": "string",
  • "aliasTargetId": "string",
  • "index": 0
}

Response samples

Content type
application/json
{
  • "item": {
    }
}

Templates

Create a new template for a project.

Create a new template for a project.

Request Body schema: application/json
projectId
required
string non-empty
templateName
required
string non-empty
templateContent
required
string non-empty
description
string

Responses

Request samples

Content type
application/json
{
  • "projectId": "string",
  • "templateName": "string",
  • "templateContent": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "item": {
    }
}

Update an existing template.

Update an existing template.

Request Body schema: application/json
projectId
required
string non-empty
templateName
required
string non-empty
templateContent
string non-empty
description
string

Responses

Request samples

Content type
application/json
{
  • "projectId": "string",
  • "templateName": "string",
  • "templateContent": "string",
  • "description": "string"
}

Response samples

Content type
application/json
{
  • "item": {
    }
}

List templates for a project.

List templates for a project.

query Parameters
projectId
required
string non-empty

Responses

Response samples

Content type
application/json
{
  • "items": [
    ]
}

Render

Render a page using its template.

Render a page using its template.

Request Body schema: application/json
projectId
required
string non-empty
pageId
required
string non-empty

Responses

Request samples

Content type
application/json
{
  • "projectId": "string",
  • "pageId": "string"
}

Response samples

Content type
application/json
{
  • "html": "string",
  • "page": {
    }
}