> For the complete documentation index, see [llms.txt](https://docs.lingoblocks.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lingoblocks.com/docs/assistant/actions.md).

# Actions

Learn how to create custom actions by making one or more APIs available to your AI agent.\
\
Actions allow agents to integrate external data or interact with the real-world, such as connecting agents to databases, plugging them into your emails, or making them your shopping assistant, all through APIs.

Actions are defined using the [OpenAPI specification](https://swagger.io/specification/), which is a standard for describing APIs.

### Create a new action

**Navigate to Actions in the dashboard.** Tap the + New button.

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

**Enter a valid JSON OpenAPI specification** into the Schema input.\
\
\&#xNAN;*Note:* The Authentication feature is not yet functional. This inconvenience is temporary and will become functional soon.

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

The code block below is an OpenAPI specification example that uses the Coindesk API to get the real-time price of Bitcoin.

{% code lineNumbers="true" %}

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "CoinDesk Price Index API",
    "description": "An API that provides the current prices for various cryptocurrencies and fiat currencies.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.coindesk.com"
    }
  ],
  "paths": {
    "/v1/bpi/currentprice/{symbol}.json": {
      "get": {
        "summary": "Get current price for a specified currency or cryptocurrency",
        "operationId": "getCurrentPrice",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The symbol for the currency or cryptocurrency to get the price for (e.g., BTC, USD, ETH)"
          }
        ],
        "responses": {
          "200": {
            "description": "Current price for the specified currency or cryptocurrency",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "time": {
                      "$ref": "#/components/schemas/Time"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "bpi": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/CurrencyPrice"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Time": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "string",
            "description": "Human-readable updated time"
          },
          "updatedISO": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 formatted updated time"
          },
          "updateduk": {
            "type": "string",
            "description": "UK formatted updated time"
          }
        },
        "required": ["updated", "updatedISO", "updateduk"]
      },
      "CurrencyPrice": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The currency or cryptocurrency code"
          },
          "rate": {
            "type": "string",
            "description": "The current rate in the specified currency or for the specified cryptocurrency"
          },
          "description": {
            "type": "string",
            "description": "Description of the currency or cryptocurrency"
          },
          "rate_float": {
            "type": "number",
            "description": "The rate as a floating-point number"
          }
        },
        "required": ["code", "rate", "description", "rate_float"]
      }
    }
  }
}
```

{% endcode %}

**Tap the Save button.**

<figure><img src="/files/4WOEhbqJkcn4QyVGZTbV" alt=""><figcaption></figcaption></figure>

**You should now see the custom action** you just created.\
\
\&#xNAN;*Note:* If the OpenAPI specification is invalid, the action will not appear.

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

**Test and confirm your new action works** as expected by chatting with your AI agent.

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

### Troubleshooting

If you need help creating a new custom action, please consider joining our [Discord community](https://discord.gg/K6tCnJtVFy) for support.
