# Search contracts

`GET /api/contracts/search/{keysearch}`



- **Group:** Contracts
- **Since:** v0.3.0
- **Authentication:** `authtoken` header, created under Setup > API > API Management
- **HTML version:** /apiguide/contracts/get-contract-search/

## Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `authtoken` | String | **required** | Authentication token, generated from admin area |

## Parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `keysearch` | String | **required** | Search keywords, matched against subject and description. |

## Example request

```bash
curl -X GET "https://yoursite.com/api/contracts/search/acme" \
  -H "authtoken: YOUR_API_TOKEN"
```

## Success response

### Success-Response:

```json
HTTP/1.1 200 OK
[
  {
    "id": "12",
    "content": "",
    "description": "Annual maintenance and support retainer covering the corporate website and internal tooling.",
    "subject": "Website Maintenance Retainer 2026",
    "client": "9",
    "datestart": "2026-01-01",
    "dateend": "2026-12-31",
    "contract_type": "1",
    "project_id": "4",
    "addedfrom": "1",
    "dateadded": "2026-01-05 09:30:12",
    "isexpirynotified": "0",
    "contract_value": "24000.00",
    "trash": "0",
    "not_visible_to_client": "0",
    "hash": "8f14e45fceea167a5a36dedd4bea2543",
    "signed": "1",
    "signature": null,
    "marked_as_signed": "0",
    "acceptance_firstname": "John",
    "acceptance_lastname": "Doe",
    "acceptance_email": "john.doe@example.com",
    "acceptance_date": "2026-01-05 10:15:44",
    "acceptance_ip": "203.0.113.24",
    "short_link": null,
    "customfields": []
  }
]
```

## Error responses

### Error-Response:

```json
HTTP/1.1 400 Bad Request
{
  "status": false,
  "message": "Search term is required. Use /api/contracts/search/{term} or /api/contracts/search?q={term}"
}
```

### Error-Response:

```json
HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "No data were found"
}
```

---

Perfex CRM REST API by Themesic Interactive. Full reference: /apiguide/
