# Taseli API

> Read a business's ads as Taseli runs them, and get an event when something waits or changes.

Source: https://taseli.co.il/en/developers

|  |  |
| --- | --- |
| Base URL | `https://taseli.co.il/api/v1` |
| Format | JSON over HTTPS. Dates in ISO 8601, money in the account's currency. |
| Auth | `Authorization: Bearer <key>` |
| Spec | [OpenAPI 3.1](https://taseli.co.il/api/v1/openapi.json): import it into Postman, Insomnia or a client generator. |

## What it's for

| You want to | Use |
| --- | --- |
| Pull daily numbers into a dashboard | [GET /accounts/{id}/metrics](https://taseli.co.il/en/developers/reference#get-account-metrics) |
| Tell a CRM or Slack that a decision waits | [Webhook](https://taseli.co.il/en/developers/webhooks) `proposal.created` |
| Keep a record of what Taseli changed | [GET /proposals](https://taseli.co.il/en/developers/reference#list-proposals) with `status=done`, and [GET /activity](https://taseli.co.il/en/developers/reference#list-activity) |
| Rank creatives by their own results | [GET /creatives](https://taseli.co.il/en/developers/reference#list-creatives) |
| Work from an AI agent | [MCP server](https://taseli.co.il/en/product/mcp) at `https://mcp.taseli.co.il/mcp`, not this API |

The API reads. It never changes an ad account and never approves. Every change is a proposal the owner approves in Taseli; each proposal's `approvalUrl` is the link. The only things you can write are your own webhooks.

## Quickstart

### 1. Create a key

In Taseli: Settings › AI agents. Copy the key when it's shown; it starts with `tsl_`. Keep it on your server, in an environment variable.

```bash
export TASELI_KEY="tsl_..."
```

### 2. Make a request

curl:

```bash
curl https://taseli.co.il/api/v1/workspace \
  -H "Authorization: Bearer $TASELI_KEY"
```

JavaScript:

```js
const res = await fetch("https://taseli.co.il/api/v1/workspace", {
  headers: { Authorization: `Bearer ${process.env.TASELI_KEY}` },
});
const { data } = await res.json();
```

Response 200:

```json
{
  "data": {
    "id": "0b6f3c1e-7a42-4c55-9b1d-2f6e8a1c4d90",
    "name": "Dan Plumbing",
    "slug": "dan-plumbing",
    "currency": "ILS",
    "plan": "pro",
    "accounts": 2
  }
}
```

### 3. See what waits for the owner

```bash
curl "https://taseli.co.il/api/v1/proposals?status=waiting&language=en" \
  -H "Authorization: Bearer $TASELI_KEY"
```

Most valuable first. Show `title`, `why` and `monthlyValue`, and link to `approvalUrl`.

### 4. Get told instead of asking

Register a URL and Taseli posts signed events to it. See [Webhooks](https://taseli.co.il/en/developers/webhooks).

curl:

```bash
curl -X POST https://taseli.co.il/api/v1/webhooks \
  -H "Authorization: Bearer $TASELI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://crm.example.com/hooks/taseli","events":["proposal.created"],"language":"en"}'
```

JavaScript:

```js
const res = await fetch("https://taseli.co.il/api/v1/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TASELI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://crm.example.com/hooks/taseli",
    events: ["proposal.created"],
    language: "en",
  }),
});
const { data } = await res.json();
// Store data.secret now. It isn't shown again.
```

## No test mode

There's no sandbox. Reads change nothing and the only writes are your own webhooks, so a real key is safe to try. Create a read-only key if reading is all you need.
