# Onboard a lead

Creates a lead, puts its first task on somebody and sends an intro text or email, in one call. The lead and the task are atomic; the greeting is attempted afterwards and its outcome is reported in intro rather than failing the call. Use it instead of three separate calls when taking on a new lead end to end.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/onboard`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "cells": {},
    "intro": {
      "body": "string",
      "medium": "string",
      "subject": "string",
      "to": "string"
    },
    "task": {
      "assigneeUserId": 1,
      "description": "string",
      "dueAt": "string",
      "priority": "string",
      "title": "string"
    }
  },
  "params": {
    ":key": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "intro": {
      "sent": true
    },
    "lead": {
      "cells": {
        "<uuid-1>": "string",
        "<uuid-3>": "string"
      },
      "createdBy": "string",
      "id": "",
      "position": 1.5,
      "source": "string"
    }
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
