---
# System prepended metadata

title: Suchagents API

---

# Suchagents API

## Targets

Target Body
```
{
    "title": "Test target",
    "link": "test.test",
    "address": "test 123",
    "region": "test",
    "city": "test",
    "space": "123",
    "rooms": "3",
    "price": "123123",
    "desc": "Test desc",
    "type": "kauf",
    "immo_typ": "house",
    "status": 0
}
```

- Per me i bo fetch krejt targets qe nuk kan agent assigned duhet me u thirr endpoint GET `/api/v1/targets` (Active daten)
- Per me mujt me i marr targets qe jan assgined te nje agent duhet me u thirr endpoint GET `/api/v1/targets/agent?user_id={INT}` (Meine ausgevelted daten)
- Per me mujt me bo assign nje target te nje agent thirret endpoint POST `/api/v1/targets/{TARGET_ID}` me body 
```
{
    "agent": {AGENT_ID}
}
```

## Targets details
- Per me i marr detailet e nje targeti duhet me u thirr endpoint GET `/api/v1/targets/{TARGET_ID}/details`

```
{
  [
 	`json:"target_id"`
	`json:"name"`
	`json:"last_name"`
	`json:"phone_number"`
	`json:"address"`
	`json:"status"`
	`json:"comment"`
	`json:"admin_comment"`
	`json:"start_time"`
	`json:"date"` 
  ]
}
```
- Per me shtu detale per target duhet me u thirr POST `/api/v1/targets/{TARGET_ID}/details` me body (History Button)
```
{
    `json:"name"`
    `json:"last_name"`
    `json:"phone_number"`
    `json:"address"`
    `json:"status"`
    `json:"comment"`
    `json:"admin_comment"` -> NOT REQUIRED (nuk vjen prej agentit)
    `json:"start_time"` FORMATI I DATES `2022-01-02`
    `json:"date"` FORMATI I DATES `15:00`
}
```


JWT Token
```
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsImZpcnN0bmFtZSI6IkRvbmpldGEiLCJsYXN0bmFtZSI6IlNoZWh1IiwidXNlcm5hbWUiOiJkb25qZXRhc2hlaHUiLCJlbWFpbCI6ImRvbmpldGFzaGVodUBnbWFpbC5jb20iLCJyb2xlIjoiY2xpZW50In0sImV4cCI6MTY2MjkwMzA2OCwiaWF0IjoxNjYyOTAyMTY4fQ.2mrSr7EQKKcU2qd-KG-bZnu3CMF3CUHnq1UOrMyCynBWIBtLwV6ZJ-t7gvJO7mLkO5ORQaJSyFIgtwOsIKyIG0EQiyos6He25hy0Im6MpM0yKa_r-bd0C6_QBfE0GB75GjtUEcc6WC33s68AQRfwkNbHVcwavcFW5APcrAhJOrJeFriS2iAshNpnuFetW2JYaV3MruEGvDv2DsPS1FHwdJPLaHtj5ARLLNLpV75VlD2GPgg-xbQ8sY5ZsK1JeDWjkubphT6zSe30Hd4xwdtennFDTBW503tlPXus0vbGb-UuPxVwUcsdaAkw_MJ6c82bue2rpWwb_inwmtp5Zs8OKg

```

## Error format

error:{fieldName:message}