> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synti.co/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API Examples

> Ready-to-adapt configurations for connecting common REST APIs to Synti's agent.

This page collects working configurations for popular services so you can copy one, swap in your own values, and connect it as a [REST API source](/sources/apis/overview). Each example shows the `config.json` you'd write, the matching `curl` request it produces, and the kind of endpoints the agent can then reach. Only the fields shown are required—Synti fills in the rest.

<Note>
  The `curl` snippets are illustrative: they show the request Synti's HTTP tool constructs on your behalf. You don't run them yourself. Your token or key is entered once, encrypted on disk, and attached automatically.
</Note>

## Bearer token

The most common pattern. Services like GitHub, OpenAI, and Stripe accept a token in the `Authorization` header.

<CodeGroup>
  ```json GitHub theme={null}
  {
    "type": "api",
    "name": "GitHub",
    "slug": "github",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.github.com",
      "authType": "bearer",
      "testEndpoint": "/user"
    }
  }
  ```

  ```bash Request theme={null}
  curl https://api.github.com/user/repos \
    -H "Authorization: Bearer $TOKEN" \
    -H "Accept: application/vnd.github+json"
  ```
</CodeGroup>

With this in place the agent can list repositories via `GET /user/repos`, open issues via `POST /repos/{owner}/{repo}/issues`, and inspect pull requests. Two more bearer examples:

<CodeGroup>
  ```json OpenAI theme={null}
  {
    "type": "api",
    "name": "OpenAI",
    "slug": "openai",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.openai.com/v1",
      "authType": "bearer",
      "testEndpoint": "/models"
    }
  }
  ```

  ```json Stripe theme={null}
  {
    "type": "api",
    "name": "Stripe",
    "slug": "stripe",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.stripe.com/v1",
      "authType": "bearer",
      "testEndpoint": "/balance"
    }
  }
  ```
</CodeGroup>

## Custom header

Some services expect the key in a header of their own naming. Set `authType` to `header` and name it with `headerName`.

<CodeGroup>
  ```json config.json theme={null}
  {
    "type": "api",
    "name": "Exa Search",
    "slug": "exa",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.exa.ai",
      "authType": "header",
      "headerName": "x-api-key",
      "testEndpoint": "/search"
    }
  }
  ```

  ```bash Request theme={null}
  curl https://api.exa.ai/search \
    -H "x-api-key: $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"query": "latest research on agents"}'
  ```
</CodeGroup>

## Query parameter

Older services often want the key in the URL. Use `authType: "query"` and name the parameter with `queryParam`; Synti appends `?key={api_key}` to each request.

<CodeGroup>
  ```json config.json theme={null}
  {
    "type": "api",
    "name": "WeatherAPI",
    "slug": "weatherapi",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.weatherapi.com/v1",
      "authType": "query",
      "queryParam": "key",
      "testEndpoint": "/current.json?q=London"
    }
  }
  ```

  ```bash Request theme={null}
  curl "https://api.weatherapi.com/v1/current.json?q=London&key=$API_KEY"
  ```
</CodeGroup>

## Basic authentication

Services like Twilio use a username and password pair—for Twilio, the Account SID and Auth Token.

<CodeGroup>
  ```json config.json theme={null}
  {
    "type": "api",
    "name": "Twilio",
    "slug": "twilio",
    "enabled": true,
    "api": {
      "baseUrl": "https://api.twilio.com/2010-04-01",
      "authType": "basic",
      "testEndpoint": "/Accounts.json"
    }
  }
  ```

  ```bash Request theme={null}
  curl https://api.twilio.com/2010-04-01/Accounts.json \
    -u "$ACCOUNT_SID:$AUTH_TOKEN"
  ```
</CodeGroup>

## Controlling the request

When the agent calls an API, it can set the HTTP method, path, query parameters, and body. For anything other than JSON, two special parameters let it send raw content:

| Parameter      | Effect                                                                            |
| -------------- | --------------------------------------------------------------------------------- |
| `_rawBody`     | Sends the value as-is (plain text, XML, form data) instead of JSON-serializing it |
| `_contentType` | Overrides the `Content-Type` header to match the raw body                         |

## Choosing a test endpoint

`testEndpoint` validates the source right after you connect it. Good choices require authentication, return quickly, and are always available—`/user`, `/me`, `/health`, or a capped list like `/items?limit=1`. Avoid anything that writes or deletes data, since Synti calls it during validation.

<Tip>
  Once connected, run `/source reload {slug}` to re-test a source after changing its configuration, and `/tools -v` to confirm the HTTP tool is available.
</Tip>
