# How to setup a database and generate APIs

To get started, follow below steps:

#### **Step 1: Create a new database**

Once logged in, create a new database on your dashboard. Enter the details like database name, table, column, type of column and then click **Add**.

![](/files/OnoBSOf6yMti7HGYYRru)

**After few seconds, your API endpoints will be generated for your above database.**

![](/files/rDFg7tk0zuZmn7zM9lGd)

#### **Step 2: Generate Secret Key**

Once the APIs are generated, the next step is to generate a secret key for your database. This is a critical step, and without this you will not be able to access the generated APIs.

Simply, **click on Generate Secret Key**. It will take you to the Secret Key page. Here's you access your past keys, if any.

![](/files/DeCFmDDdQERSCya4uj2k)

Click Generate button. And in a few seconds, you will have access to a newly generated Secret Key, as below.

![](/files/d0go8W50jfRDQNEoifmH)

#### **Step 3: Open the Dynamically Generated API Documentation**

Click on the button below the secret key to access the auto generated API documentation for your database. It contains all the endpoints as per your designed database. Here, you can test out your APIs by creating a new record, updating a record, deleting a record and fetching all the records.

![](/files/zgfisaZJQGYMmQmafAEt)

#### **Step 4: Test your APIs**

Lets test one of the endpoint from the doc. Lets try creating a new record via the API.

First, add your secret key by clicking the 'Authorize' button.

<figure><img src="/files/3YTDDtIFpd0pvTTKoYc8" alt=""><figcaption></figcaption></figure>

Then, simply expand the POST endpoint, and click 'Try out'. Inside the body, type the book name we want to create.

![](/files/QaYSz4ufXbVRdfyT0Tnx)

Click 'Execute'. And our new record will be created. You can see the response as success.

![](/files/Ytq9TfXAdP4BIqoF3z4n)

Similarly, you can try testing other endpoints as well. The final step is an optional step to copy the curl command generated for your API operation. This can be used to test the APIs in postman.

#### Step 4: Copy the CURL command

When you perform a certain action like POST or GET, etc., you will see a CURL command getting generated. This can be used to integrate the API with any 3rd party that accepts curl as an API path. In our case, we performed POST request in the last step. Hence a curl command for POST has been generated below. You can simply copy this and use in tool like Postman, bubble.io etc.

![](/files/iVLmmShDT3uRNhMm7nnm)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nocodebackend.com/how-to-setup-a-database-and-generate-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
