# Link a Record

```
POST /api/v1/integrations/:id/lookups
```

Links one app record to a golden record of the integration's object: for a record a pull can't match, such as one with no identity value. Later pulls keep the link. Linking a `tp_id` to the record it's already linked to changes nothing and answers `200`. Needs `integrations:edit`.

CLI: [`fob-mdm integrations link`](/docs/cli/integrations#integrations-link)

## Path Parameters

| Parameter | Type | Description |
|---|---|---|
| `id` | number | Integration id |

## Request Body

| Field | Type | Required | Description |
|---|---|---|---|
| `tp_id` | string | Yes | The app record's own id |
| `record` | number | Yes | The golden record to link it to |
| `tp_data` | object | No | The app record's data. Default: the record with this `tp_id` in `config.records`, else `{}` |

## Example Request

```bash
curl -X POST "https://mdm.finopsbricks.com/api/v1/integrations/5/lookups" \
  -H "api-key: $MDM_API_KEY" \
  -H "api-secret: $MDM_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "tp_id": "cont_8f2k",
    "record": 100
  }'
```

## Response

`201 Created`

```json
{
  "data": {
    "id": 50,
    "integration": 5,
    "object": "vendor",
    "record": 100,
    "tp_id": "cont_8f2k",
    "tp_data": {
      "tp_id": "cont_8f2k",
      "name": "ACME SUPPLIES",
      "gstin": "29ABCDE1234F1Z5",
      "bank_ifsc": "HDFC0009999"
    },
    "updated_at": "2026-11-26T07:20:08.000Z"
  }
}
```

## Errors

| Status | Code | When |
|---|---|---|
| 400 | `VALIDATION_ERROR` | `tp_id` or `record` is missing, `tp_data` isn't an object, or `config.object` is missing |
| 401 | `UNAUTHORIZED` | Missing, wrong or expired API credentials |
| 403 | `FORBIDDEN` | The key lacks `integrations:edit` permission |
| 404 | `NOT_FOUND` | No such integration, or no such record of its object, in your organization |
| 409 | `CONFLICT` | The `tp_id` is linked to another record (`details.record`); unlink it first |

See [Errors](/docs/api/errors) for the envelope.
