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

# API Reference

> REST API documentation for Deepline tools, integrations, and workflow runs. Includes auth, payloads, response formats, and backend examples.

Use the REST API when Deepline is called from a backend service, serverless
function, notebook, Airflow job, warehouse task, or other non-CLI runtime.

## Authentication

All public REST endpoints accept a workspace API key as a bearer token:

```http theme={null}
Authorization: Bearer <DEEPLINE_API_KEY>
```

No request-signing scheme is required for direct server-side calls to tool or
play endpoints. Store the API key only in trusted server-side environments. Do
not expose it in browser code.

## Execute a tool

Tool execution requests use the tool ID in the URL:

```bash theme={null}
POST /api/v2/integrations/{toolId}/execute
```

The request body wraps the tool input in `payload`:

```json theme={null}
{
  "payload": {
    "domain": "stripe.com"
  }
}
```

Example:

```bash theme={null}
curl -X POST "https://code.deepline.com/api/v2/integrations/test_company_search/execute" \
  -H "Authorization: Bearer $DEEPLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {
      "domain": "stripe.com"
    }
  }'
```

`POST /api/v2/integrations/execute` is the legacy endpoint and should not be
used for new callers.

## Deno / Supabase Edge Functions

```ts theme={null}
const response = await fetch(
  'https://code.deepline.com/api/v2/integrations/test_company_search/execute',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${Deno.env.get('DEEPLINE_API_KEY')}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      payload: {
        domain: 'stripe.com',
      },
    }),
  },
);

if (!response.ok) {
  throw new Error(
    `Deepline returned ${response.status}: ${await response.text()}`,
  );
}

const result = await response.json();
```

## Execute a saved or prebuilt play

For multi-step workflows, start a play run:

```bash theme={null}
curl -X POST "https://code.deepline.com/api/v2/plays/run" \
  -H "Authorization: Bearer $DEEPLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "person-linkedin-to-email",
    "input": {
      "linkedin_url": "https://www.linkedin.com/in/example-person/",
      "first_name": "Jane",
      "last_name": "Smith",
      "company_name": "ExampleCo",
      "domain": "example.com"
    }
  }'
```

Then poll the returned `workflowId`:

```bash theme={null}
curl "https://code.deepline.com/api/v2/plays/run/$WORKFLOW_ID" \
  -H "Authorization: Bearer $DEEPLINE_API_KEY"
```

## Environment variables

* `DEEPLINE_API_KEY` (workspace-scoped)
* Per-provider keys are documented in each provider guide (for BYOK providers)

For payload fields on each action, open the provider page under `Integrations` and pick the operation.
