---
agentTools:
  projectIndex: https://docs.agilite.io/llms.txt
---

# API Server Fundamentals

This section explains how to interface with Agilit-e's API Server

[block:api-header]
{
  "title": "Overview"
}
[/block]

The URL address for interfacing with the Agilit-e API Server is: <https://api.agilite.io>.

[block:callout]
{
  "type": "warning",
  "body": "In nearly every case, the URL for accessing the Agilit-e API Server on-premise would be one of the following addresses:\n* localhost:6010\n* 127.0.0.1:6010\n* custom-ip-address:6010\n\nFor containerized environments, the url will be based on the IP address and port assigned to the Agilit-e API Server container.",
  "title": "NOTE: For on-premise or containerized environments"
}
[/block]

[block:api-header]
{
  "title": "API Key (Header Parameter)"
}
[/block]

For every API call made to the Agilit-e API Server, a API Key (aka Agilit-e token) is required in the header of the API request. The header parameter to hold the token is called `api-key`. Below is an example of this:

[block:code]
{
  "codes": [
    {
      "code": "curl --request GET \\\n  --url https://api.agilite.io/keywords/data \\\n  --header 'api-key: agilite_token'",
      "language": "curl",
      "name": "Get Keywords"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "danger",
  "body": "**Note:** You will need to create an API Key in the [API Keys Module](https://docs.agilite.io/docs/api-keys-overview) via the Agilit-e Admin Portal. It is important that this is setup, as the API Key uniquely identifies your Agilit-e Account and tells the [Agilit-e API Reference](https://docs.agilite.io/v5/reference) page that you are a part of Agilit-e. Once the API Key is provided for one API, it will exist for the rest\nThis will be covered next, in the [Obtaining an API Key (Agilit-e Token)](https://docs.agilite.io/docs/obtaining-an-api-key-agilit-e-token) section.",
  "title": "Regarding API Keys"
}
[/block]

[block:api-header]
{
  "title": "API Response Schema"
}
[/block]

For every API request (when the response is not an Array Buffer object - e.g. [/files](https://docs.agilite.io/reference/files-1) or [/generatePDF](https://docs.agilite.io/reference/generatepdf)), the default response is always JSON that has the following properties:

* success (boolean) - Used to determine if the API transaction was successful or not
* messages (array) - Holds 1 or more error descriptions if `success = false`
* data (mixed object) - Holds the actual data returned from the API request

Below is an example of this:

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"success\": true,\n  \"messages\": [],\n  \"data\": {}\n}",
      "language": "json",
      "name": "API Response Schema"
    }
  ]
}
[/block]

[block:api-header]
{
  "title": "Data Only (Header Parameter)"
}
[/block]

There is a header parameter that can be used for every API request to Agilit-e called `data-only`. This parameter affects how the API request returns the JSON response. `data-only` is an optional parameter and is assumed `false` by default. If this parameter is set to `true`, the default API response schema will be modified to only return the actual data, and not the response headers. See below example of both:

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"success\": true,\n  \"messages\": [],\n  \"data\": {\"param\":\"value\"}\n}",
      "language": "json",
      "name": "data-only = false"
    },
    {
      "code": "{\"param\":\"value\"}",
      "language": "json",
      "name": "data-only=true"
    }
  ]
}
[/block]