Skip to content
Home » API Documentation

API Documentation

CodelessONE API Documentation

Codeless ONE provides a comprehensive REST API that replicates the features available in its user interface, empowering users to create advanced customizations, automate workflows, and integrate seamlessly with external systems. This API enhances flexibility by allowing for greater control and scripting options.

The base URL for the Codeless ONE REST API:

Authentication: The majority of the Codeless ONE API endpoints require authentication using an API Key associated with a Codeless ONE Application.

To obtain your API Key follow the steps:

1. Login to app.codelessone.com

2. Go into your application

3. Click on application settings

4. Select the API option from the App Settings panel.

5. Generate the API key.

Note – Entities form a core part of the application’s structure in Codeless ONE. For detailed information on retrieving entities and their fields, including parameters, responses, and example requests, please refer to ‘Fetching Entities via API’.

To authenticate or validate the API Key

GET      

Me

When the API Key is authenticated, Codeless ONE returns a JSON object structured as follows:

json

    {
        "userId": "62d08f0d-b2c5-45dc-9f0e-bccd53f63015",
        "appId": "78101516-5453-42b0-b1c4-989d3c72e315",
        "orgId": "aa699b0a-a55c-4e8b-9421-3291180efe60",
        "appLabel": "Sales Management (Production)"
    }
  • userid (string): Unique identifier for the user, represented as an UUID.
  • appid (string): Unique identifier for the application, represented as an UUID.
  • orgid (string): Unique identifier for the organization to which the user and application belong, represented as an UUID.
  • appLabel (string): Human-readable label for the application (e.g. “Sales Management”).

Each UUID serves as a unique identifier within the system, distinguishing users, applications, and organizations across the the system.

Note: All entity records or changes created using the api will be linked or considered as a change by the user who has generated the API Key.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

Example Response

Users

This set of endpoints control the users belong to the application in Codeless ONE.

GET

Get Users

This endpoint makes an HTTP GET request to retrieve a list of users.

Request

The request does not require any specific parameters.

Response

The response will be a JSON array containing user objects with the following fields:

json

[
    {
        "userId": "",
        "firstName": "",
        "lastName": "",
        "displayName": "",
        "email": "",
        "phone": "",
        "country": ""
    }
]

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

Entities

This set of endpoints control the entities belong to the application.

GET

Get Application Entities

This endpoint makes an HTTP GET request to retrieve list of entities.

The JSON response contains the array of all the entities exist in the Codeless ONE application.

Each entity object contains:

name: The system name.

entityId: ID of the entity.

label: Label or a user friendly name of the entity.

json

[
    {
        "name": "leada1d563",
        "entityId": "a1d563ea-c7c6-477a-b156-5c6945d81050",
        "label": "Lead"
    }
]

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

GET

Get Entity Details

This endpoint makes an HTTP GET request to retrieve information about a specific entity. The path parameter “accountc9f0ba” represents the entity name, and the response will be based on the entity name provided.

Request

Query Parameters

  • fetchfields (boolean): Set to true to fetch fields of the entity.
  • fetchrelations (boolean): Set to true to fetch relations with other entities.

Response

The response will contain the details of the specified entity, including its fields and relations if requested.

Fixed Parameters: The response will always include the following fixed parameters:

  • Id: The ID field.

  • CreatedBy: The field which contains created by user identity.

  • CreatedOn: The timestamp field when the entity was created.

  • UpdatedBy: The user field who last updated the entity.

  • UpdatedOn: The timestamp field when the entity was last updated.

Dynamic Properties: In addition to the fixed parameters, the response will include dynamic fields specific to the entity. These fields can vary for each entity and include attributes such as Lead SourceLead StatusFirst NameLast Name, etc.

Related Entities: If fetchrelations is set to true, the response will include related entities. Each related entity will have the following properties:

  • subEntityType: The name of related entity.
  • name: The name of the relation.
  • cardinality: The cardinality of the relation (e.g., 1-1).
  • type: The type of the relation (e.g., subEntity).
  • reverseRelationName: The name of the reverse relation.
  • relationAttribute: The attribute used for the relation, if any.
  • label: The label of the related entity.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

PARAMS

fetchfields

 

fetchrelations

true


true

Entity Records

Endpoints related to data records of entity types.

GET

Get Entity Records

/rest/entityrecords/{entityName}?count={count}&offset={offset}

This endpoint retrieves records of a specific entity. The entityName is included as a path parameter, and the query parameters count and offset determine the number of records to fetch and the starting point, respectively.

Path Parameters:

  • entityName (string): The name of the entity to retrieve records for. Example: accountc9f0ba.

Query Parameters:

  • count (integer): The number of records to fetch. Example: 1.
  • offset (integer): The starting point for fetching records. Example: 1.

The response will contain the records of the specified entity. The fields of the entity records will vary depending on the entity passed in the request.EndFragment

AUTHORIZATION

Bearer Token

TOKEN

{{apiKey}}

PARAMS

count

offset

1

1

DELETE

Delete Entity Record

DELETE {{baseUrl}}/rest/entityrecords/{entityName}/{id}

This endpoint deletes a specific record of an entity. The entityName and id are included as path parameters.

Path Parameters:

  • entityName (string): The name of the entity to delete the record from. Example: accountc9f0ba.
  • id (integer): The ID of the record to delete. Example: 3.

The response will confirm the deletion of the specified record with a message and a 200 HTTP status code.

Response Example:

{ “message”: “accountc9f0ba record with Id 3 deleted successfully” }

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

PUT

Update Entity Record

PUT {{baseUrl}}/rest/entityrecords/{entityName}/{id}

This endpoint updates a specific record of an entity. The entityName and id are included as path parameters. The request body should contain the fields specific to the entity being updated.

Path Parameters:

  • entityName (string): The name of the entity to update the record for. Example: accountc9f0ba.
  • id (integer): The ID of the record to update. Example: 1.

Request Body: The request body should contain the fields specific to the entity being updated. The fields will vary depending on the entityName.

PUT {{baseUrl}}/rest/entityrecords/accountc9f0ba/1
Content-Type: application/json

{
“field1”: “value1”,
“field2”: “value2”,

}

Response: The response will contain the complete updated entity record with its fields.

Note: The fields in the request body should match the fields specific to the entity being updated.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

Body

raw (json)

json
  {
    "accountnamefcb39a": "updated from api"
   }

POST

Create Entity Record

POST {{baseUrl}}/rest/entityrecords/{entityName}

This endpoint creates a new record for a specific entity. The entityName is included as a path parameter. The request body should contain the fields specific to the entity being created.

Path Parameters:

  • entityName (string): The name of the entity to create the record for. Example: accountc9f0ba.

Request Example:

POST {{baseUrl}}/rest/entityrecords/accountc9f0ba
Content-Type: application/json

{
“field1”: “value1”,
“field2”: “value2”,

}

Response: The response will contain the complete created entity record with its fields.

AUTHORIZATION

Token Bearer

Token

{{apiKey}}

Body

raw (json)

json

    {
    "accountnamefcb39a": "created from api"
    }

POST

Create Link Record

Plain Text

POST

{{baseUrl}}/rest/entityrecords/{parentEntityName}/{parentId}/relations/{childEntityName}/{relationName}

Description: This endpoint creates a new record for a child entity and links it to a specific record of the parent entity. The parentEntityNameparentIdchildEntityName, and relationName are included as path parameters. The request body should contain the fields specific to the child entity being created.

Path Parameters:

  • parentEntityName (string): The name of the parent entity. Example: accountc9f0ba.
  • parentId (integer): The ID of the parent entity record to link to. Example: 7.
  • childEntityName (string): The name of the child entity to create the record for. Example: opportunityb2eefc.
  • relationName (string): The name of the relation of Parent with Child Entity. Example: accountopportunity3is the relation name of Account (parent) with Opportunity (child)

Request Body: The request body should contain the fields specific to the child entity being created. The fields will vary depending on the child entity.

Plain Text

Post {{baseUrl}}/rest/entityrecords/accountc9f0ba/7/relations/opportunityb2eefc/accountopportunity3 Content-Type: application/json
 {
    "field1": "value1",
    "field2": "value2",
    ...
    }

Response: The response will contain the complete created child entity record with its fields and confirm the link to the parent entity record.

Note:

  • The entity’s relation can be fetched using the request: GET {{baseUrl}}/rest/entities/{entityName}?fetchfields=true&fetchrelations=true.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

Body

raw (json)

json

    {
    "opportunityname6cd3e0": "New Opp from API"
    }

PUT

Link to existing Record

POST {{baseUrl}}/rest/entityrecords/{parentEntityName}/{parentId}/relations/{childEntityName}/{childId}/{relationName}

Description: This endpoint links an existing record of a child entity to a specific record of the parent entity. The parentEntityNameparentIdchildEntityNamechildId, and relationName are included as path parameters.

Path Parameters:

  • parentEntityName (string): The name of the parent entity. Example: accountc9f0ba.
  • parentId (integer): The ID of the parent entity record to link to. Example: 7.
  • childEntityName (string): The name of the child entity. Example: opportunityb2eefc.
  • childId (integer): The ID of the child entity record to link. Example: 31.
  • relationName (string): The name of the relation. Example: accountopportunity3.

Request Example:

Plain Text

Post {{baseUrl}}/rest/entityrecords/accountc9f0ba/7/relations/opportunityb2eefc/31/accountopportunity3

Response: The response will confirm the linking of the specified child entity record to the parent entity record with a message and a 200 HTTP status code.

Response Example:

Plain Text
    {
    "message": "Record Linked successfully"
    }

Note: 

  • The entity’s relation can be fetched using the request:

GET {{baseUrl}}/rest/entities/{entityName}?fetchfields=true&fetchrelations=true.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

POST

Search Entity Records

Plain Text

Post {{baseUrl}}/rest/entityrecords/{entityName}?filterrecords={filterRecords}&timezone={timezone}&count={count}&offset={offset}

Description:

This endpoint searches for records of a specific entity based on a filter. The entityName is included as a path parameter, and the query parameters filterrecordstimezonecount, and offset determine the filtering criteria, timezone, number of records to fetch, and the starting point, respectively.

Path Parameters:

  • entityName (string): The name of the entity to search records for. Example: accountc9f0ba.

Query Parameters:

  • filterrecords (boolean): Indicates whether to apply filters to the records. Set to true to filter records.
  • timezone (string): The timezone to use for filtering records. Example: Asia/Karachi.
  • count (integer): The number of records to fetch. Example: 2.
  • offset (integer): The starting point for fetching records. Example: 0.

Request Body:

The request body should contain the filter criteria specific to the entity being searched. The filter criteria will vary depending on the entity.

Request Example:

Plain Text

Post {{baseUrl}}/rest/entityrecords/accountc9f0ba?filterrecords=true&timezone=America/Toronto&count=2&offset=0
Content-Type: application/json

    {
    "filters": 
    [
        {
            "field": "CreatedOn",
            "operator": "Greater Than Or Equal",
            "value": "11/04/2024 12:00 AM"
        },
        {
            "field": "CreatedOn",
            "operator": "Less Than Or Equal",
            "value": "11/04/2024 11:59 PM"
        },
        {
            "field": "accounttypea9e9c3",
            "operator": "Equals",
            "value": "Prospect"
        }
    ]
}

Example:

The sample filter passed in the request body is searching for records of the entity accountc9f0ba that meet the following criteria:

  • CreatedOn field with the operator Greater Than Or Equal and value 11/04/2024 12:00 AM, which means records created on or after midnight of November 4th, 2024.
  • CreatedOn field with the operator Less Than Or Equal and value 11/04/2024 11:59 PM, which means records created on or before 11:59 PM of November 4th, 2024.
  • accounttypea9e9c3 field with the operator Equals and value Prospect, which means records where the account type is Prospect.

This filter ensures that only records created within the specified date range (November 4th, 2024) and with the account type Prospect are returned in the timezone “America/Toronto”

Response:

The response will contain the records of the specified entity that match the filter criteria.

Supported Filters by Field Type

Field Type Supported Filters
Integer Equals, Not Equal To, In, Not In, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal
Datetime, Date, Time Equals, Not Equal To, Greater Than, Greater Than Or Equal, Less Than, Less Than Or Equal
String Equals, Not Equal To, Starts With, Ends With, Contains, Does not Contain, In, Not In, Is Blank
Treepath Equals, Not Equal To, Under, Not Under

Notes:

  • The fields in the request body should match the filter criteria/field names specific to the entity being searched.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

PARAMS

Filterrecords

timezone

count

offset

true

America/Toronto

2

0

Body

raw (json)

json
{
"filters": [{"field": "CreatedOn", "operator": "Greater Than Or Equal","value": "11/04/2024 12:00 AM"},{"field": "CreatedOn","operator": "Less Than Or Equal","value": "11/04/2024 11:59 PM"},{"field": "accounttypea9e9c3","operator": "Equals", "value": "Prospect"}]
}

GET

Get Entity Record by ID

Plain Text

Get /rest/entityrecords/{entityName}/{id}

Description: This endpoint retrieves a specific record of an entity. The entityName and id are included as path parameters.

Path Parameters:

  • entityName (string): The name of the entity to retrieve the record for. Example: accountc9f0ba.
  • id (integer): The ID of the record to retrieve. Example: 9.

Request Example:

GET /rest/entityrecords/accountc9f0ba/9

Response: The response will contain the details of the specified entity record, including its fields.

AUTHORIZATION

Bearer Token

Token

{{apiKey}}

Emails

POST

Send Email

Send Email

Endpoint:

Plain Text

Post {{BaseURL}}/rest/emails/sendemail

Description:

This endpoint sends an email with the specified details. The request body should contain the email details including the sender, recipient, subject, and body.

Request Body:
The request body should contain the following fields:

  • from (string): The email address of the sender. Example: info@codelessone.com.
  • fromName (string): The name of the sender. Example: Codeless ONE.
  • to (string): The email address of the recipient. Example: arsalan.younus@codelessone.com.
  • subject (string): The subject of the email. Example: test email.
  • body (string): The body of the email. This can be in HTML or plain text format.
  • bodyType (string): The type of the email body. This can be html or text.

Request Example:

Plain Text

Post {{BaseURL}}/rest/emails/sendemail
Content-Type: application/json
    {
    "from": "info@codelessone.com",
    "fromName": "Codeless ONE",
    "to": "mao@codelessone.com",
    "subject": "test email",
    "body": "<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Test Email</title></head><body><h1 class='preserveHtml'>Hello,</h1><p class='preserveHtml'>This is a test email to verify the functionality of the email API.</p><p class='preserveHtml'>Here are some details:</p><ul class='preserveHtml'><li class='preserveHtml'><strong class='preserveHtml'>Date:</strong> January 1, 2025</li><li class='preserveHtml'><strong class='preserveHtml'>Event:</strong> New Year Celebration</li><li class='preserveHtml'><strong class='preserveHtml'>Location:</strong> CodelessOne Headquarters</li></ul><p class='preserveHtml'>Thank you for using our service!</p><p class='preserveHtml'>Best regards,</p><p class='preserveHtml'><strong class='preserveHtml'>CodelessOne Team</strong></p></body></html>",
    "bodyType": "html"
    }

Response:

The response will confirm the sending of the email with a message and a 200 HTTP status code.

Response Example:

json
{
"messageId": "c6268189-c18e-43e7-a007-e21bbf41307a", 
"message": "Email sent successfully"
}

Notes:

  • Ensure that the Authorization header is included in the request with a valid token.
  • The bodyType should be set to html if the email body is in HTML format, or plain if it is in plain text format.
  • Emails can be sent from a custom domain, but the domain must be added and verified in the organization to which the app belongs.

AUTHORIZATION

Bearer Token

Token         {{apiKey}}

Body raw (json) 

json
    {
    "from": "info@codelessone.com",
    "fromName": "Codeless ONE",
    "to": "arsalan.younus@codelessone.com",
    "subject": "test email",
    "body": "<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Test Email</title></head><body><h1>Hello,</h1><p>This is a test email to verify the functionality of the email API.</p><p>Here are some details:</p><ul><li><strong>Date:</strong> January 1, 2025</li><li><strong>Event:</strong> New Year Celebration</li><li><strong>Location:</strong> CodelessOne Headquarters</li></ul><p>Thank you for using our service!</p><p>Best regards,</p><p><strong>CodelessOne Team</strong></p></body></html>",
    "bodyType": "html"
    }