# Endpoints

These Endpoint provide request URLs and information on how to use them. Most business use cases can be solved with these APIs. However, if you need more complex business logic, then you can refer to the **logics** section.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FrMVymmAI2CgRjRorHcKU%2FScreenshot%202024-05-15%20at%2022.13.21.png?alt=media&#x26;token=20ebc360-0d0c-4002-b8f6-9f841e7a2026" alt=""><figcaption><p>Endpoint Section</p></figcaption></figure>

The image above shows the different endpoints, and below you will find more details about each one.

Here's different endpoint details

{% hint style="info" %}
{{table}} represent your actual table name.&#x20;

{{environmentName}} represent your actual environment name
{% endhint %}

<mark style="color:yellow;">**POST**</mark>**&#x20;-  Create a new record in {{table}}**

This is a **POST** type endpoint, useful for adding a record to your table using the endpoint. This endpoints can be used in the no-code UI builder or any frontend client application.

In this case, the **PK(Primary Key)** column will be **disabled** by default, as it is automatically **created** by **Fireapis** as a **unique** value.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2Foi2QpTcRENpVo6poeFBQ%2FScreenshot%202024-05-15%20at%2022.24.14.png?alt=media&#x26;token=007927e2-4383-469c-9b8e-ff35c2a6685b" alt=""><figcaption><p>Disabled Primary key Column</p></figcaption></figure>

You can find the implementation of this endpoint by using the generated URL. Here are the configuration details:

**Header:** Common header for every endpoint request.

**URL:** https\://{{environmentName}}.fireapis.com/{{table}}

**Data or Body:** JSON as provided in the endpoint section.

For more details, Refer to the images below.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FJ9UNmU5BUUHDzVIT5Juv%2FScreenshot%202024-05-15%20at%2022.36.03.png?alt=media&#x26;token=8960fc1f-afd3-45a2-b5d8-de11b7e30b04" alt=""><figcaption><p>[POST] Create a New Record in Table.</p></figcaption></figure>

<mark style="color:green;">**GET -**</mark>**&#x20;Get a record in {{table}} by ID**

This is a **GET** type endpoint, useful for retrieving a record using its primary key (ID by default in Fireapis).

Configuration details:

**Header:** Common header for every endpoint request.

**URL:** https\://{{environmentName}}.fireapis.com/{{table}}/\_\_id\_\_

**Data or Body:** No input data is required for a **GET** request.

{% hint style="info" %}
**\_\_id\_\_** represent the primary key value of a record. For example, to fetch the record with ID of 2 from your table.
{% endhint %}

For more details, Refer to the images below.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FitXuWB1p1hjkKBx6LhVx%2FScreenshot%202024-05-15%20at%2023.03.46.png?alt=media&#x26;token=7f031925-c9f6-4487-8295-6fab84059b8f" alt=""><figcaption><p>Get a Record from {{table}} by id</p></figcaption></figure>

<mark style="color:blue;">**PUT**</mark>**&#x20;- Update record in {{table}} by id**

This endpoint is PUT type endpoint which will be useful for updating a record using their primary key which is id by default in fireapis.

Here the list of configurations

**Header** - Refers common header for every end point request

**URL** - https\://{{environmentName}}.fireapis.com/{{table}}/\_\_id\_\_

**Data or Body** - JSON which is given in this endpoint section

{% hint style="info" %}
**\_\_id\_\_** represent the primary key value of an record, for eg: you want to fetch id of 2 from your table.
{% endhint %}

For all above details, Refer below images:

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2Fmk1zHBxhQj0Z7bStVyW0%2FScreenshot%202024-05-15%20at%2023.07.53.png?alt=media&#x26;token=15ca0704-7485-4fd6-89b8-b1fa8630d947" alt=""><figcaption><p>Update a Record in {{table}} by ID</p></figcaption></figure>

<mark style="color:red;">**DELETE**</mark>**&#x20;- Delete a record in {{table}} by ID**

This is a **DELETE** type endpoint, useful for deleting a record using its primary key (ID by default in Fireapis).

Configurations details:

**Header:** Common header for every endpoint request.

**URL:** https\://{{environmentName}}.fireapis.com/{{table}}/\_\_id\_\_

**Data or Body:** No input data is required for a **DELETE** request.

{% hint style="info" %}
**\_\_id\_\_** represent the primary key value of a record. For example, you want to fetch id of 2 from your table.

**Warning:** Deleting a record will permanently removes it, so be cautious when performing this action.
{% endhint %}

For more details, refer to the images below.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2F3mr0wLJTeBAOYclaVyAz%2FScreenshot%202024-05-15%20at%2023.14.32.png?alt=media&#x26;token=9f25a799-24b9-44e8-8766-f27c9a021460" alt=""><figcaption><p>Delete a record  in {{table}} by ID</p></figcaption></figure>

<mark style="color:green;">**GET**</mark>**&#x20;- Get all records in {{table}}**

This is a **GET** type endpoint, useful for retrieving all  records from particular table, with paginated enabled by default.

Configuration details:

**Header:** Common header for every endpoint request.

**URL:** https\://{{environmentName}}.fireapis.com/{{table}}/all?page=1\&take=10

**Data or Body:** No input data is required for **GET** request.

**Query Params:**  ?page=1\&take=10 in URL represent query parameters.\
1\. page: The page number for the request data\
2\. take: The Number of records to be listed on each page\
For example, ?page=2\&take20 means getting the second page with 20 records per page.&#x20;

{% hint style="info" %}
This endpoint always includes pagination by default to **optimize performance.**
{% endhint %}

For more details, Refer to the images below.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FtNAThqU9gdCzSjWuYiFB%2FScreenshot%202024-05-15%20at%2023.12.29.png?alt=media&#x26;token=3ccaa49f-9bdf-483f-884d-d4559fa37fa3" alt=""><figcaption><p>Get all record in {{table}}</p></figcaption></figure>

We have covered all the endpoints in detail and their usage.
