> For the complete documentation index, see [llms.txt](https://calcom.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calcom.gitbook.io/docs/how-to-guides/how-to-test-api-in-a-local-instance.md).

# How to test API in a local instance

To test API in your local instance, you have the following pre-requisites:

1. Cal.com repo clone. You can get it by following the instructions provided in [Installation](/docs/introduction/quick-start/self-hosting/installation.md)
2. A staging license key that goes in as value for `CALCOM_LICENSE_KEY` in your root `.env` file.
   1. To get the staging license key, please proceed to create a dev account on `console.cal.dev`&#x20;
   2. Next, click on New Deployment

      <figure><img src="/files/NPaOF1MBForuPeN1TJqp" alt=""><figcaption></figcaption></figure>
   3. Then, click on Next with Self-hosted selected

      <figure><img src="/files/TYBHTgLy6pOdp0urQccO" alt=""><figcaption></figcaption></figure>
   4. Next, type in your deployment name as you like<br>

      <figure><img src="/files/WKc3LO0kVIEDYid2b0U8" alt=""><figcaption></figcaption></figure>
   5. Finally, you would be taken to the test Stripe payment page. This is where you enter the Stripe test card information. So, simply enter `4242 4242 4242 4242` as the card number, fill the rest as you wish and finish the payment step.<br>

      <figure><img src="/files/pCJbhoBMt6o7elcGpuJR" alt=""><figcaption></figcaption></figure>

      Once this is done, you will be redirected to your deployments page containing the list of your deployments. You can then click on the newly created deployment to copy the license key, which is your test license key.<br>

      <figure><img src="/files/l448GILp9QWisaqstWQb" alt=""><figcaption></figcaption></figure>
3. Next, you need to install API submodule by following the instructions provided in [API submodule](/docs/introduction/quick-start/self-hosting/installation/platform/api-submodule.md)
4. Start the cal.com server using `yarn dev` on localhost and create the test API keys by visiting `/settings/developer/api-keys`
5. Start the API server by running `yarn workspace @calcom/api dev` and start testing your API locally

{% hint style="info" %}
By default, the app server runs on port 3000 and the API server runs on port 3002
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://calcom.gitbook.io/docs/how-to-guides/how-to-test-api-in-a-local-instance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
